TRADING STRATEGIES
Using Stops, Part 2
In this second of a three-part series we will compare trailing-stop methods using an average true range (Atr) trailing stop.
The average true range (Atr) was developed by J. Welles Wilder and introduced in his book New Concepts In Technical Trading Systems. The Atr indicator measures a security’s volatility. Wilder defined the true range concept as the greatest value of the:
Wilder then calculated an average of this value for creating the average true range.
Like most technical analysis programs, MetaStock has a predefined Atr indicator (Atr (period)). But if you need to calculate it yourself, it can be created as follows:
{Get the required ATR period;} period:=Input(“ATR Period :”,1,100,5); {Calculate the biggest difference based on the true range concept;} diff1:=Max(H-L,Abs(H-Ref(C,-1))); diff2:=Max(diff1,Abs(L-Ref(C,-1))); {Use Wilders’ moving average method to calculate the Average True Range;} Mov(diff2,period*2-1,E)
With this formula you could create an Atr value based on something other than the close, such as an average price.
To create a trailing stop based on the Atr value, you need to calculate the maximum-allowed loss based on the Atr value multiplied by a factor. In Figure 1 you can see the 14% fixed trailing-stop value plotted in red on the chart of Amd. The blue line is the Atr trailing stop based on a five-day Atr average multiplied by a factor of 3.5. Note the Atr trailing buy & sell points on the chart. You would buy (green arrow) when the closing price moves above the trailing stop of the previous day and sell when the closing price falls below the previous trailing-stop value (red Exit sign).
Figure 1: average true range trailing stop. Here you see a chart of AMD with a 14% fixed closing price trailing stop (red) and a 3.5 times five-day ATR average (blue).
The complete MetaStock formula for an Atr-based trailing stop value on the closing price can be found in sidebar “Atr Trailing Stop.” You basically use the same formula setup as with the fixed-percentage trailing stop.