ATR (Average True Range) was introduced first by Welles Wilder in his book “New concepts in technical trading”. The version you find in every trading software doesn’t take in consideration that ATR was built originally to deal only with commodities. This means that if we have stock A and stock B with the same ATR, but respectively a close price of 200 Euros and 30 Euros, they are considered to be equal in terms of ATR but in reality they are very different in terms of ability to perform well in the market and in terms of volatility.
This code should help to adapt Wilder’s ATR to the stock world.
Blue skies!!
1 2 3 4 5 6 7 8 9 10 11 12 13 |
//period=14 //MM=3 a=range/close[1] b=abs(high-close[1])/close[1] c=abs(low-close[1])/close[1] trbalanced=100*max(a,max(b,c)) atrbalanced=average[period,mm](trbalanced) return atrbalanced as "Balanced ATR" |
Share this
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.
ProRealTime ITF files and other attachments :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials