Skip to content

Instantly share code, notes, and snippets.

@r2k0
Created May 5, 2014 23:19
Show Gist options
  • Save r2k0/681c92d2316feddb0915 to your computer and use it in GitHub Desktop.
Save r2k0/681c92d2316feddb0915 to your computer and use it in GitHub Desktop.
declare upper;
input period = AggregationPeriod.DAY;
input length = 252;
def periodHigh = Highest(imp_volatility(period = period), length = length);
def periodLow = Lowest(imp_volatility(period = period), length = length);
def ivRange = periodHigh - periodLow;
def ivp = round(100*(imp_volatility(period=period)-periodLow)/ivRange, 0);
AddLabel(1, Concat("IV%", ivp), color.DARK_ORANGE);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment