OPEN-SOURCE SCRIPT
Updated MA Color-Change

Description
This indicator identifies continuation setups built around a pullback to a moving average followed by a directional shift in candle color and a breakout of the prior bar. A signal is generated when price interacts with a short-term moving average, then prints a color change where a green candle takes out the high of a prior red candle for longs, or a red candle takes out the low of a prior green candle for shorts. The signal candle must originate near the moving average, defined by its open being within an ATR-based distance from the average, ensuring the move begins at the area of interest rather than after price has already extended.
Trend context is incorporated through both slope and higher timeframe alignment. The short moving average must be trending in the direction of the trade, and an optional long moving average filter requires price and the short moving average to be positioned on the correct side of the long-term trend. An optional confirmation rule can require the signal candle to close through the body of the prior candle, increasing selectivity and filtering weaker moves. Signals can be configured to trigger only after the candle closes to prevent intrabar fluctuations, or in real time for earlier entries.
This creates a structured framework for identifying pullback continuation opportunities where price reacts at a key dynamic level, confirms direction through a color change and range expansion, and aligns with the prevailing trend.
This indicator identifies continuation setups built around a pullback to a moving average followed by a directional shift in candle color and a breakout of the prior bar. A signal is generated when price interacts with a short-term moving average, then prints a color change where a green candle takes out the high of a prior red candle for longs, or a red candle takes out the low of a prior green candle for shorts. The signal candle must originate near the moving average, defined by its open being within an ATR-based distance from the average, ensuring the move begins at the area of interest rather than after price has already extended.
Trend context is incorporated through both slope and higher timeframe alignment. The short moving average must be trending in the direction of the trade, and an optional long moving average filter requires price and the short moving average to be positioned on the correct side of the long-term trend. An optional confirmation rule can require the signal candle to close through the body of the prior candle, increasing selectivity and filtering weaker moves. Signals can be configured to trigger only after the candle closes to prevent intrabar fluctuations, or in real time for earlier entries.
This creates a structured framework for identifying pullback continuation opportunities where price reacts at a key dynamic level, confirms direction through a color change and range expansion, and aligns with the prevailing trend.
Release Notes
Internal logic updated.Defaults updated.
Release Notes
Keltner lines & user control added.One signal per trend option added.
Internal logic updated.
Default inputs updated.
Release Notes
Pine category updated.Current Model: Trend-following moving average indicator that identifies bullish and bearish continuation/reversal entries after major MA crossover trend shifts. Signals are generated when price pulls back near the slow moving average within an ATR-defined zone, then confirms direction with a candle color change and breakout takeout using either wick or close confirmation. Includes dynamic MA trend coloring, ATR bands, optional one-signal-per-trend filtering, and built-in buy/sell alerts for structured trend-entry setups.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.