CDC ATR Trailing Stop V2.1 (2013)
Jan 18, 2017

The CDC ATR Trailing Stop V2.1 indicator provides a dual-layer Average True Range tracking system to identify trend direction and generate execution signals based on market volatility.
Usage
The Usage section describes how the script can be used to navigate different market environments. The indicator displays two distinct lines: a fast trailing stop and a slow trailing stop.
- Fast Trailing Stop (Circles): This line is designed to be more sensitive to price action, reacting quickly to momentum shifts. It is primarily used to generate entry signals.
- Slow Trailing Stop (Solid Line): This represents a standard trailing stop-loss level. It helps traders maintain a position during a trend while providing a clear exit point if the primary trend reverses.
- Trend Visualization: Users can enable "Paint color on chart" to color bars based on trend strength and direction. Green and blue bars typically represent bullish conditions, while red and gray bars represent bearish conditions.
- Signal Execution: By enabling the "Plot Buy/Sell arrows" setting, the indicator will display visual markers on the chart when the internal logic confirms a trend reversal.
This system is particularly effective in high-volatility markets where price trends are well-defined.
Details
The CDC ATR Trailing Stop V2.1 is based on original concepts by piriya33. It functions by calculating two independent trailing stops using the Average True Range (ATR) of a specified source, typically the closing price.
The core logic involves comparing the current price to the previous trailing stop value. If the price remains above the previous stop in an uptrend, the stop is adjusted upward based on the math.max of the previous stop or the current price minus the ATR multiplier. Conversely, in a downtrend, it adjusts downward.
A unique "ATRCD Histogram" is calculated by finding the difference between the fast and slow trailing stops (trail1 - trail2). This difference is then smoothed by a 9-period Exponential Moving Average (EMA). Buy signals are triggered when the histogram is positive and above its signal line, while sell signals are triggered when the histogram is negative and below its signal line.
Settings
- Data Array: The price source used for all ATR and trailing stop calculations (default is Close).
- Fast ATR Period: The lookback period used to calculate the Average True Range for the fast trailing stop.
- Fast ATR Multiplier: The coefficient multiplied by the ATR to determine the distance of the fast stop from the price.
- Slow ATR Period: The lookback period used to calculate the Average True Range for the slow trailing stop.
- Slow ATR Multiplier: The coefficient multiplied by the ATR to determine the distance of the slow stop from the price.
- Paint color on chart: A toggle to enable or disable the coloring of price bars based on trend momentum.
- Plot Buy/Sell arrows: A toggle to display "buy" and "sell" labels and arrows on the chart when signals are generated.
FAQ
How do I interpret the different bar colors? When "Paint color" is enabled, green indicates a strong bullish trend, blue indicates a weakening bullish trend or emerging recovery, red indicates a strong bearish trend, and gray indicates a weakening bearish trend.
Can this indicator be used for risk management? Yes, the slow trailing stop line is specifically designed to act as a dynamic stop-loss level that adjusts as the trend progresses in your favor.
How to access CDC ATR Trailing Stop V2.1? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

