This is a trading object shared by a member. You can use this object as well as hundreds of others with QuantShare - Trading Software.
Click on the Like button or on one of the share buttons to share this object and spread the word about QuantShare.
QuantShare is an advanced trading software for stock, forex, futures, ETF and options markets. It is the best and the most complete EOD trading software software and it is FREE (beta version).
The Percentile or Percent Rank function calculates the percentage of observations or values, within a lookback period, that are below the current value of a given function. It is the percentage of values in the provided time series frequency distribution that are lower than the value of any given bar.
As an example, using the close price and making the calculation for the previous 50 bars; the percentile value of the close price for the bar number 1000 is the percentage of close values, in the range of bar n 950 to 1000, that are below the close price for the bar number 1000.
The percentile is equal to 100%, when the current bar close price is higher that all values of the previous 50 bars.
The percentile is equal to 0% when the current bar close price is lower than all values of the previous 50 bars
Here is another example:
Bar 10: 12.5
Bar 11: 13.2
Bar 12: 16.1
Bar 13: 15.6
Bar 14: 13.8
Bar 15: 16.9
Bar 16 (Current bar): 15.2
When applied to the above time series, the percent rank function, with a lookback period of seven bars, will return a value 50% on bar number 16. This is because three bars' values are above 15.2 and three other bars' values are below 15.2
The function accepts any kind of time series; you can for example calculate the percentile rank of a technical analysis indicator such as the RSI or relative strength index or the percentile rank of the Relative Strength (RS) of a stock compared to its index (S&P 500 for example).