What is ATR Trailing Stop? Download ATR Trailing Stop EA!


 While most traders use several tools to enter a trade, they often fail to comprehend when to exit. A perfect exit point helps traders do their job without added mental pressure as it relieves them from added mental pressure. While many tools and indicators can help you find the exit spot, the Average True Range Trailing Stops or ATR Trailing Stops are deemed one of the best. Traders majorly use it to protect their capital. In addition, you can use it for individual trades where it can be used to lock in personal profits. When used alongside a trend filter, it can also be used to find entries.

What is ATR trailing stop?

ATR Trailing Stops or Average True Range Trailing Stop represents setting trailing stops to close positions based on the Average true range. Stop loss is determined based on the degree of price volatility (Average True Range) to protect capital and lock in profits on individual trades.

The ATR is a technical indicator that measures the volatility of an asset over a specific period. The ATR Trailing Stop takes the ATR  particular and multiplies it by a specific factor to determine the distance of the stop-loss order from the current price. The distance of the stop-loss order is then updated as the price moves in favor of the trade, trailing the price at a set distance.

For example, if a trader sets an ATR Trailing Stop of 2 times the ATR value, and the ATR value is 10 pips, the initial stop-loss order would be 20 pips from the current price. However, if the price moves in favor of the trade by 10 pips, the stop-tens order would be moved 10 pips closer to the current price, maintaining a distance of 2 times the ATR value.

The ATR Trailing Stop is a dynamic stop-loss order that adjusts to changes in the helpful entity, making it useful in managing, For example, if asset’s price. If the asset’s price becomes more volatile, the stop-loss order will be moved further away from the current price, reducing the risk of being stopped prematurely. Conversely, if the asset’s price becomes less volatile, the stop-loss order will be moved closer to the current price, protecting profits.

The concept of the Average True Range was first introduced in 1978 by J. Welles Wilder. Stock or index volatility is measured using the ATR, and a detailed explanation can be found at the Average True Range. In the initial stages, Wilder used Volatility Stops that follow trends with the Average True Range. This experiment later helped in the development of Average True Range Trailing Stops.

atr trailing stop on chart

ATR Trailing Stop Loss Strategy Example

You can use the ATR Trailing Stop to identify exit signals for both short and long positions:

  • For a long position, the exit position will be a sell position. It would help if you exited when prices cross below the trailing line created by the ATR.
  • For a short position, the exit position will be a buy position. It would help if you exited when prices move above the trailing line created by the ATR.

The graph shows the downtrend, highlighted with the ATR’s help. It also has the 63-day exponential MA used here as the trend filter.

atr strategy forexinrs

According to this graph:

  • You must go short when the price gets closed below the ATR but the exponential average remains close.
  • As soon as the price cross above the ATR trend line, you must exit.

ATR Trailing Stops Facts

The ATR period can be set from 5 to 21 days. At the same time, the developer suggests setting it for seven days for general trading, 21 days for long-term trading, and five days for short-term trading. For trailing stops, multiples range from 2.5 to 3.5 times the ATR. The lower multiples can get more susceptible to whipsaws. 

The default setting is 3X21 day ATR. The Closing Price is also set as default.

  • ATR stands for Average True Range, a technical indicator that measures the volatility of an asset over a specific period.
  • The ATR Trailing Stop is a dynamic stop-loss order that adjusts to changes in price volatility.
  • The ATR Trailing Stop takes the ATR value and multiplies it by a specific factor to determine the distance of the stop-loss order from the current price.
  • The distance of the stop-loss order is updated as the price moves in favor of the trade, trailing the price at a set distance.
  • If a trader sets an ATR Trailing Stop of 2 times the ATR value and the ATR value is ten pips, the initial stop-loss order would be 20 pips away from the current price.
  • If the price moves in favor of the trade by 10 pips, the stop-loss order would be moved 10 pips closer to the current price, maintaining a distance of 2 times the ATR value.
  • The ATR Trailing Stop is valuable for managing risk in volatile markets. The stop-loss order will be moved further away from the current price if the asset becomes more volatile and closer to the current price if the asset becomes less volatile.
  • The ATR Trailing Stop can help protect profits while allowing for potential gains as the stop-loss order is moved to follow the price movement.
  • Traders can customize the ATR Trailing Stop based on their risk tolerance and trading strategy by adjusting the ATR value and the multiplier factor.

The ATR Formula

  1. Calculate the ATR trailing stop using the following method:
  2. Next, the Average True Range (ATR), a volatility indicator that compares each day’s range to measure commitment, is calculated.
  3. The result is multiplied by this example’s chosen multiple, 3XATR.
  4. If there is an uptrend, the result from step 2 is subtracted from the Closing Price. This will be your stop for the next day.
  5. The result from step 2 is added to the closing price if the prices close below the ATR stop. This is done to track short trade.
  6. If the prices do not close below the ATR, subtract 3XATR from every following day. This will continue till the price reverse below the ATR stop.

This makes them more volatile than the rest. To avoid this volatility, you must use it with a trend filter. These stops are highly adaptable to changing market conditions than their counterparts, like the Percentage Trailing Stop. However, it yields similar results if you apply it to stocks. Keep in mind that these need to be filtered for solid trends. 

There are two possible weaknesses of Volatility Stops and the original ATR. These are:

  • In an uptrend, the stop moves downwards when the ATR widens. Therefore, a ratchet mechanism can be deployed to deal with this weakness.
  • The Reverse-and-Stop mechanism conjectures that you will switch to a short position as soon as you stop out of a long position. The opposite is true, as well. When you are in a system that follows trends, it is widespread to exit early and get the next entry in the previous trade’s direction. You can deal with this problem by using ATR Bands.

Download ATR trailing stop EA MT4.

 Download ATR trailing stop EA.

This EA please do not use for trading because trading rules are not defined. However, using this code, you can add entry rules and use ATR trailing stop for trading.

The main idea of ATR trailing EA is this code:

//–
void SendOrder(double _stop,double _take)//Order send module buy/sell
{
//—
atr = iATR(Symbol(), atrTf, atrPer, 0);
atrSL =(atr * _stop / _point);
atrTP =(atr * _take / _point);
//—
switch(Ordertype)
{
case _buy: //Buy order
_mode =OP_BUY;
pricemode = Ask;
col = Green;
_type=”BUY”;
_SL = Ask – atrSL * _point;
_TP = Ask + atrTP * _point;
break;
case _sell://Sell order
_mode = OP_SELL;
pricemode = Bid;
col = Red;
_type=”SELL”;
_SL = Bid + atrSL * _point;
_TP = Bid – atrTP * _point;
break;
}
if(CheckMoneyForTrade(Symbol(),_mode,LotSize()))
Ticket=OrderSend(Symbol(),_mode,LotSize(),pricemode,5,0,0,WindowExpertName(),MagicNumber,0,col);
if(Ticket<1)
{
Print(“Order send failed, OrderType : “,(string)_type,”, errcode : “,GetLastError());
return;
}
else
Print(“OrderType : “,(string)_type,”, executed successfully!”);
if(OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES))
{
if(!OrderModify(OrderTicket(), OrderOpenPrice(), _SL, _TP, 0))
{
Print(“Failed setting TP/SL OrderType : “,(string)_type,”, errcode : “,GetLastError());
return;
}
else
Print(“Successfully setting TP/SL on OrderType : “,(string)_type);
}
}
//–
int Position()//This function prevents this adviser from interfering with other experts you may use on the same account
{ // It checks and handles its orders.
int dir=0;
for(int i = OrdersTotal() – 1; i >= 0; i–)
{
if(!OrderSelect(i, SELECT_BY_POS))
break;
if(OrderSymbol()!=Symbol()&&OrderMagicNumber()!= MagicNumber)
continue;
if(OrderCloseTime() == 0 && OrderSymbol()==Symbol() && OrderMagicNumber()==MagicNumber)
{
if(OrderType() == OP_SELL)
dir = -1; //Short positon
if(OrderType() == OP_BUY)
dir = 1; //Long positon
}
}
return(dir);
}
//–

Conclusion

It is essential to use the right tools to spot exit signals. You will be better positioned using the Average True Range Trailing Stops combined with a trend filter.

Fxigor

Fxigor

Igor has been a trader since 2007. Currently, Igor works for several prop trading companies. He is an expert in financial niche, long-term trading, and weekly technical levels. The primary field of Igor's research is the application of machine learning in algorithmic trading. Education: Computer Engineering and Ph.D. in machine learning. Igor regularly publishes trading-related videos on the Fxigor Youtube channel. To contact Igor write on: igor@forex.in.rs

Trade gold and silver. Visit the broker's page and start trading high liquidity spot metals - the most traded instruments in the world.

Trade Gold & Silver

GET FREE MEAN REVERSION STRATEGY

Recent Posts