Hello,
I am trying to write an Indicator which will give a Historical IV Rank to a particular stock. The calculation is:
100 x (the current Historical IV level – the 52 week Historical IV low) / (the 52 week Historical IV high – 52 week Historical IV low) = IV Rank
I have tried the attached but I think that the terms “highest” and “lowest” only work with price. Does anyone know if my calculation can be performed by PRT
Many thanks
indicator1 = HistoricVolatility
indicator2 = highest [365] HistoricVolatility
indicator3 = lowest[365]HistoricVolatility
c3 = indicator1 - indicator3
c4 = indicator2 - indicator3
c5 = c3 / c4
c6 = c5 * 100
Return c6 AS "IV Rank"
//HOW IS IV RANK CALCULATED?
//The formula for IV rank is simple, really. It is:
//100 x (the current IV level - the 52 week IV low) / (the 52 week IV high - 52 week IV low) = IV Rank
This is just the stochastic of the historical volatility or a normalization of its value over the last 365 periods.
Highest and lowest instructions are working perfectly for any data serie, even if it is not price! 🙂
indi= HistoricVolatility
hh = highest [365](indi)
ll = lowest[365](indi)
result = 100*((indi-ll)/(hh-ll))
return result
Topic moved from proscreener forum (dedicated to screeners) to probuider forum (dedicated to indicators)
Nicolas,
Many thanks for your quick reply. All working now
Noobywan Sorry about that