The percentile rank of a score is the percentage of scores in its frequency distribution that are equal to or lower than it. For example, a test score that is greater than or equal to 75% of the scores of people taking the test is said to be at the 75th percentile, where 75 is the percentile rank. (source Wikipedia).
This indicator gives the percentile rank of the current Average True Range compared to the 200 periods previous ones. By comparing the recent ATR to the previous behaviour of it on the same instrument, we can have a clearer view of what the current volatility means because of its ranking in percentage. This kind of sorting formula could be adapted to any other values.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
ATRPctRkLookback = 200 ATRperiod = 20 rnkCount = 0 ATR = averagetruerange[ATRperiod](close) FOR i = 1 TO ATRPctRkLookback DO IF ATR > ATR[i] THEN rnkCount = rnkCount + 1 endif NEXT ATRPctRank = 100 * rnkCount / ATRPctRkLookback RETURN ATRPctRank |
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
Hi Nicolas!
As far as I’m not used to use this indicator… Can you explain a bit how can we implement it in our strategies?
Thanks in advance!
This indicator rank the actual ATR to its recent statistical values. So you can have a better view of what currently happen. With this indicator you can spot a volatility increase, even if the instrument is often very fluctuant, and also spot if the instrument is in a very calm period even if its already quiet.
Thanks Nicolas , very handy tool , I have added variables to look back period and ATR period to make it a bit more versatile . I would add ITF file if i knew how
How easy is it to remove the overnight intraday bars from the calculation?