Skip to content
All library documents

ATR-Band Trend Strategy with Moving Average and Excursion-Based Exits

Article TradingView scripts

Summary

This strategy uses a configurable moving average as its trend reference and places upper and lower bands at a multiple of ATR. A trend is confirmed after price remains beyond a band for the required consecutive bars, with confirmation based on either closes or highs and lows. Entries can follow the confirmed breakout or use a moving-average cross as a pullback entry. An optional volatility filter restricts trading to periods when ATR exceeds its average.

The script tracks each detected trend’s maximum favorable and adverse excursions, then calculates percentile distributions that can set take-profit and stop-loss distances; manual percentage levels are also available. It reports trend and trade statistics, including excursion measures, efficiency, volatility, win rate, profit factor, expectancy, and drawdown. The provided code describes configurable logic and analytics, not validated results: performance depends on market, timeframe, costs, and settings, and historical excursion percentiles may not predict future trends.

Key ideas

  • The strategy defines directional bands around a moving average using a multiple of ATR.
  • It confirms trends after consecutive price observations beyond the relevant band.
  • Entries can use trend breakouts or moving-average crosses during an established trend.
  • Historical favorable and adverse excursion percentiles can determine adaptive profit and loss levels.
  • The displayed trade statistics are backtest measures and do not establish future performance.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.