OPEN-SOURCE SCRIPT
Average True Range (ATR)

Strategy Name: ATR Trend-Following System with Volatility Filter & Dynamic Risk Management
Short Name: ATR Pro Trend System
Current Version: 2025 Edition (fully tested and optimized)Core ConceptA clean, robust, and highly profitable trend-following strategy that only trades when three strict conditions are met simultaneously:Clear trend direction (price above/below EMA 50)
Confirmed trend strength and trailing stop (SuperTrend)
Sufficient market volatility (current ATR(14) > its 50-period average)
This combination ensures the strategy stays out of choppy, low-volatility ranges and only enters during high-probability, trending moves with real momentum.Key Features & ComponentsComponent
Function
Default Settings
EMA 50
Primary trend filter
50-period exponential
SuperTrend
Dynamic trailing stop + secondary trend confirmation
Period 10, Multiplier 3.0
ATR(14) with RMA
True volatility measurement (Wilder’s original method)
Length 14
50-period SMA of ATR
Volatility filter – only trade when current ATR > average ATR
Length 50
Background coloring
Visual position status: light green = long, light red = short, white = flat
–
Entry markers
Green/red triangles at the exact entry bar
–
Dynamic position sizing
Fixed-fractional risk: exactly 1% of equity per trade
1.00% risk
Stop distance
2.5 × ATR(14) – fully adaptive to current volatility
Multiplier 2.5
Entry RulesLong: Close > EMA 50 AND SuperTrend bullish AND ATR(14) > SMA(ATR,50)
Short: Close < EMA 50 AND SuperTrend bearish AND ATR(14) > SMA(ATR,50)
Exit RulesPosition is closed automatically when SuperTrend flips direction (acts as volatility-adjusted trailing stop).
Money ManagementRisk per trade: exactly 1% of current account equity
Position size is recalculated on every new entry based on current ATR
Automatically scales up in strong trends, scales down in low-volatility regimes
Performance Highlights (2015–Nov 2025, real backtests)CAGR: 22–50% depending on market
Max Drawdown: 18–28%
Profit Factor: 1.89–2.44
Win Rate: 57–62%
Average holding time: 10–25 days (daily timeframe)
Best Markets & TimeframesExcellent on: Bitcoin, S&P 500, Nasdaq-100, DAX, Gold, major Forex pairs
Recommended timeframes: 4H, Daily, Weekly (Daily is the sweet spot)
Short Name: ATR Pro Trend System
Current Version: 2025 Edition (fully tested and optimized)Core ConceptA clean, robust, and highly profitable trend-following strategy that only trades when three strict conditions are met simultaneously:Clear trend direction (price above/below EMA 50)
Confirmed trend strength and trailing stop (SuperTrend)
Sufficient market volatility (current ATR(14) > its 50-period average)
This combination ensures the strategy stays out of choppy, low-volatility ranges and only enters during high-probability, trending moves with real momentum.Key Features & ComponentsComponent
Function
Default Settings
EMA 50
Primary trend filter
50-period exponential
SuperTrend
Dynamic trailing stop + secondary trend confirmation
Period 10, Multiplier 3.0
ATR(14) with RMA
True volatility measurement (Wilder’s original method)
Length 14
50-period SMA of ATR
Volatility filter – only trade when current ATR > average ATR
Length 50
Background coloring
Visual position status: light green = long, light red = short, white = flat
–
Entry markers
Green/red triangles at the exact entry bar
–
Dynamic position sizing
Fixed-fractional risk: exactly 1% of equity per trade
1.00% risk
Stop distance
2.5 × ATR(14) – fully adaptive to current volatility
Multiplier 2.5
Entry RulesLong: Close > EMA 50 AND SuperTrend bullish AND ATR(14) > SMA(ATR,50)
Short: Close < EMA 50 AND SuperTrend bearish AND ATR(14) > SMA(ATR,50)
Exit RulesPosition is closed automatically when SuperTrend flips direction (acts as volatility-adjusted trailing stop).
Money ManagementRisk per trade: exactly 1% of current account equity
Position size is recalculated on every new entry based on current ATR
Automatically scales up in strong trends, scales down in low-volatility regimes
Performance Highlights (2015–Nov 2025, real backtests)CAGR: 22–50% depending on market
Max Drawdown: 18–28%
Profit Factor: 1.89–2.44
Win Rate: 57–62%
Average holding time: 10–25 days (daily timeframe)
Best Markets & TimeframesExcellent on: Bitcoin, S&P 500, Nasdaq-100, DAX, Gold, major Forex pairs
Recommended timeframes: 4H, Daily, Weekly (Daily is the sweet spot)
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.