OPEN-SOURCE SCRIPT
My strategy

This strategy is designed for BTC/USDT breakout trading on short-to-medium timeframes. It enters positions when price breaks out above recent highs or below recent lows, using automated risk management and alerts.
🔍 Core Logic
Long entry: When price breaks above the highest high of the last N candles (default: 20).
Short entry: When price breaks below the lowest low of the last N candles.
This logic helps detect momentum-driven breakout moves based on recent price consolidation.
⚙️ Strategy Settings
Capital: $10,000
Order size: 1% of equity per trade
Commission: 0.1% per trade (simulating exchange fees)
Slippage: 3 ticks (for realism)
Take Profit: 3% from entry
Stop Loss: 1.5% from entry
These settings aim to provide realistic, risk-conscious backtest results, suitable for individual traders.
📊 Visual Features
Green line = Breakout High
Red line = Breakout Low
Entry/exit markers are plotted on the chart
🔔 Alerts
Alerts are integrated for:
Long Entry
Short Entry
You can create TradingView alerts using this script to automate notifications or connect to external bots (e.g., via webhook for Telegram or Discord).
🧠 How This Strategy Is Different
While many breakout bots use standard Donchian channels, this version allows you to:
Tune the breakout sensitivity (via the adjustable lookback period)
Customize TP/SL without external inputs
Integrate alerts for real-time decision making or automation
The simplicity and flexibility make it useful as both a live tool and a framework for further development.
⚠️ Disclaimer
This script is for educational purposes only. Backtests are based on historical data and do not guarantee future results. Always test thoroughly before using in live trading. Risk only what you can afford to lose.
🔍 Core Logic
Long entry: When price breaks above the highest high of the last N candles (default: 20).
Short entry: When price breaks below the lowest low of the last N candles.
This logic helps detect momentum-driven breakout moves based on recent price consolidation.
⚙️ Strategy Settings
Capital: $10,000
Order size: 1% of equity per trade
Commission: 0.1% per trade (simulating exchange fees)
Slippage: 3 ticks (for realism)
Take Profit: 3% from entry
Stop Loss: 1.5% from entry
These settings aim to provide realistic, risk-conscious backtest results, suitable for individual traders.
📊 Visual Features
Green line = Breakout High
Red line = Breakout Low
Entry/exit markers are plotted on the chart
🔔 Alerts
Alerts are integrated for:
Long Entry
Short Entry
You can create TradingView alerts using this script to automate notifications or connect to external bots (e.g., via webhook for Telegram or Discord).
🧠 How This Strategy Is Different
While many breakout bots use standard Donchian channels, this version allows you to:
Tune the breakout sensitivity (via the adjustable lookback period)
Customize TP/SL without external inputs
Integrate alerts for real-time decision making or automation
The simplicity and flexibility make it useful as both a live tool and a framework for further development.
⚠️ Disclaimer
This script is for educational purposes only. Backtests are based on historical data and do not guarantee future results. Always test thoroughly before using in live trading. Risk only what you can afford to lose.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。