OPEN-SOURCE SCRIPT
Moving Average Channel Breakout (No Repaint)

This indicator creates a channel using two simple moving averages: SMA of highs (upper line) and SMA of lows (lower line).
How it works:
- When a candle closes above the upper channel line, the following candles turn green (bullish trend)
- When a candle closes below the lower channel line, the following candles turn red (bearish trend)
- The trend color remains until a breakout in the opposite direction occurs
Anti-repaint:
This indicator does NOT repaint. The candle color is determined at the open, based on the previous candle's close. Once a candle opens with a color, that color never changes.
Breakout strategy:
- Candle opens green → Long entry signal
- Candle opens red → Short entry signal
The signal and entry moment are perfectly synchronized at the candle open, making it ideal for systematic breakout strategies.
How it works:
- When a candle closes above the upper channel line, the following candles turn green (bullish trend)
- When a candle closes below the lower channel line, the following candles turn red (bearish trend)
- The trend color remains until a breakout in the opposite direction occurs
Anti-repaint:
This indicator does NOT repaint. The candle color is determined at the open, based on the previous candle's close. Once a candle opens with a color, that color never changes.
Breakout strategy:
- Candle opens green → Long entry signal
- Candle opens red → Short entry signal
The signal and entry moment are perfectly synchronized at the candle open, making it ideal for systematic breakout strategies.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.