OPEN-SOURCE SCRIPT
Double Bottom Strategy (Long Only, ATR Trailing Stop + Alerts)

Updated chart script:
This script implements a long-only breakout strategy based on the recognition of a Double Bottom price pattern, enhanced with a 50 EMA trend filter and a dynamic ATR-based trailing stop. It is suitable for traders looking to capture reversals in trending markets using a structured pattern-based entry system.
🧠 Key Features:
Double Bottom Detection: Identifies double bottom structures using pivot lows with configurable tolerance.
ATR-Based Trailing Stop: Manages exits using a trailing stop calculated from Average True Range (ATR), dynamically adjusting to market volatility.
EMA Filter (Optional): Filters trades to only go long when price is above the 50 EMA (trend confirmation).
Alerts: Real-time alerts on entry and exit, formatted in JSON for webhook compatibility.
Backtest Range Controls: Customize historical testing period with start and end dates.
✅ Recommended Markets:
Gold (XAUUSD)
S&P 500 (SPX, ES)
Nasdaq (NDX, NQ)
Stocks (Equities)
⚠️ Not recommended for Forex due to differing behavior and noise levels in currency markets.
🛠️ User Guidance:
Tune the pivot period, tolerance, and ATR settings for best performance on your chosen asset.
Backtest thoroughly over your selected date range to assess historical effectiveness.
Use small position sizes initially to test viability in live or simulated environments.
This script implements a long-only breakout strategy based on the recognition of a Double Bottom price pattern, enhanced with a 50 EMA trend filter and a dynamic ATR-based trailing stop. It is suitable for traders looking to capture reversals in trending markets using a structured pattern-based entry system.
🧠 Key Features:
Double Bottom Detection: Identifies double bottom structures using pivot lows with configurable tolerance.
ATR-Based Trailing Stop: Manages exits using a trailing stop calculated from Average True Range (ATR), dynamically adjusting to market volatility.
EMA Filter (Optional): Filters trades to only go long when price is above the 50 EMA (trend confirmation).
Alerts: Real-time alerts on entry and exit, formatted in JSON for webhook compatibility.
Backtest Range Controls: Customize historical testing period with start and end dates.
✅ Recommended Markets:
Gold (XAUUSD)
S&P 500 (SPX, ES)
Nasdaq (NDX, NQ)
Stocks (Equities)
⚠️ Not recommended for Forex due to differing behavior and noise levels in currency markets.
🛠️ User Guidance:
Tune the pivot period, tolerance, and ATR settings for best performance on your chosen asset.
Backtest thoroughly over your selected date range to assess historical effectiveness.
Use small position sizes initially to test viability in live or simulated environments.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.