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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.