Nicolas

ATR percentile rank

Category: Indicators By: Nicolas Created: May 19, 2016, 4:46 PM
May 19, 2016, 4:46 PM
Indicators
6 Comments
ATR percentile rank

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. 

 

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

 

No files found.

Nicolas
Nicolas Legend
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Carburo
11 months ago
#

Good morning, Nicolas. Your indicator provides information that becomes very useful when you can compare the ATR of the current bar (ATRperiod=1 or an average of your choice) with the ATR (single bar or average) of the same bar(s) from previous trading days. Graphically, this comparison between multiple times could be done by highlighting only those bars with consistent times, starting from the current one and working backwards, and applying a transparency color to the others. Alternatively, it could be achieved by connecting the upper ends of the bars with segments. Is there a way, applied to the indicator you have created, to achieve what I have tried to explain? The image, taken from another situation, shows both examples (please ignore the numerical data). I have made several attempts, but without achieving anything concrete. Such a method could be useful at an educational level to apply to other indicators. Thank you very much. [url=https://postimages.org/][img]https://i.postimg.cc/bJHnmknV/Istogramma.jpg[/img][/url]

Nicolas
11 months ago
#

Please create a forum topic specific for that demand. Thank you.

rufus.round
4 years ago
#

How easy is it to remove the overnight intraday bars from the calculation?

Brisvegas
9 years ago
#

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

Adolfo Onrubia
10 years ago
#

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!

Nicolas
10 years ago
#

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.

ProRealCode ProRealCode
Loading...