OPEN-SOURCE SCRIPT
Cập nhật 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.
Phát hành các Ghi chú
Internal logic updated.Defaults updated.
Phát hành các Ghi chú
Keltner lines & user control added.One signal per trend option added.
Internal logic updated.
Default inputs updated.
Phát hành các Ghi chú
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.