Advertisement IC Markets

ATR based trailing stop vs fixed pips in my scalping EA, what the tester showed

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
Fairman
Posts: 3303
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

ATR based trailing stop vs fixed pips in my scalping EA, what the tester showed

Post by Fairman »

ATR based trailing stop vs fixed pips in my scalping EA, what the tester showed

I had a fixed pip trailing stop in my EA for a long time because it was simple. It was fine on some days and terrible on others, and when I thought about it, that makes sense. A fixed ten pip trail is tight on a volatile London morning and huge on a quiet Asia afternoon.

So I switched to a trail based on ATR, the average true range over the last few candles on the same timeframe, with a multiplier. In volatile conditions the trail widens, and in quiet conditions it tightens. On the tester it smoothed out the results a bit, fewer trades stopped out by a normal wiggle in busy sessions.

The catch is the ATR period and multiplier are two more parameters to curve fit, so I picked values that made sense rather than the best ones in the optimizer. I also put a minimum distance so the trail never gets closer than the spread plus a small buffer. Anybody else using volatility based trails on M1 or M5? Curious what multiplier people like.
It’s Fairman :geek:
Recommended broker for automated trading & scalping IC Markets
Fairman
Posts: 3303
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: ATR based trailing stop vs fixed pips in my scalping EA, what the tester showed

Post by Fairman »

To answer a couple of replies about settings, I ended up using a fourteen period ATR on the same timeframe as the entries, with a multiplier somewhere around two. I tested a range of multipliers and picked one from the middle of a flat area of decent results, not the single best value. If the results only look good at one exact number and fall apart either side, that number is probably luck. A setting that works okay across a wide range is the one I trust.
It’s Fairman :geek:
Fairman
Posts: 3303
Joined: Tue Jul 21, 2026 7:11 am
Location: Abuja

Re: ATR based trailing stop vs fixed pips in my scalping EA, what the tester showed

Post by Fairman »

One problem I hit after switching was that the trail would sometimes widen during a fast move, because ATR jumps when candles get bigger. That meant a trade that was in profit could give back more than I liked when volatility spiked. My fix was to only let the trail move in my favour and never widen once set. So the ATR decides the initial distance and how far each step moves, but the stop itself never goes backwards. That made the results much more predictable.
It’s Fairman :geek:
Post Reply