OPEN-SOURCE SCRIPT
Diupdate Smart Breakout with ATR Stop-Loss

The Smart Breakout indicator combines a classic 20-day Donchian channel breakout with a tight trailing stop, drawing green lines and “ENTRY” labels at the bar after a valid breakout, and red lines and “EXIT” label at the bar after a stop-loss breach.
By default it uses the chart’s timeframe to compute ATR and stops, but you can flip on Daily lock to freeze both ATR and price reads at the daily resolution—so your stops stay the same whether you view at 1s, 15 m, 4h or lower frequency bars.
Key features:
By default it uses the chart’s timeframe to compute ATR and stops, but you can flip on Daily lock to freeze both ATR and price reads at the daily resolution—so your stops stay the same whether you view at 1s, 15 m, 4h or lower frequency bars.
Key features:
- 20-day Donchian breakout: entry when price closes above the highest high of the previous 20 bars
- 2 × ATR(14) trailing stop: initialized at entry and raised only when the new (close – 2 × ATR) exceeds the prior stop
- Daily lock option: Ensures all ATR and close values are calculated on the daily timeframe, keeping stop levels consistent across resolutions
Catatan Rilis
This Smart Breakout indicator is a classic 20-day Donchian breakout with a tight trailing stop, drawing a green line with “ENTRY" label at the bar after a valid breakout , and a red line and “EXIT” labels at the bar after a stop-loss breach. By default it uses your chart’s timeframe to compute ATR and stops, but you can flip on Daily lock to freeze both ATR and price reads at the daily resolution—so your stops stay the same whether you view 15 m, 4 h or even lower resolutions.
- Donchian breakout: Entry when price closes above the highest high of the previous 20 bars (Default: 20 bars)
- ATR-based trailing stop: Initialized at entry and raised only when the new (close – 2 × ATR) exceeds the prior stop. (Default: 2 x ATR)
- Daily lock option: Forces all ATR and Breakout values to come from the daily timeframe, keeping entry and exit levels consistent across resolutions.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menjadikannya sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Hormat untuk penulisnya! Meskipun anda dapat menggunakannya secara gratis, ingatlah bahwa penerbitan ulang kode tersebut tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.