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.
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、このスクリプトの作者はコードをオープンソースとして公開してくれました。トレーダーが内容を確認・検証できるようにという配慮です。作者に拍手を送りましょう!無料で利用できますが、コードの再公開はハウスルールに従う必要があります。
免責事項
この情報および投稿は、TradingViewが提供または推奨する金融、投資、トレード、その他のアドバイスや推奨を意図するものではなく、それらを構成するものでもありません。詳細は利用規約をご覧ください。