Skip to content

Instantly share code, notes, and snippets.

@antonywu
Created June 9, 2016 19:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonywu/214554e19b276b9cab3164a82849d5e3 to your computer and use it in GitHub Desktop.
Save antonywu/214554e19b276b9cab3164a82849d5e3 to your computer and use it in GitHub Desktop.
ThinkScript
#begin custom quote: IV Rank
#
# from TastyTrade: You've Got Mail 4Sep2013
# use on Market Watch -> Quotes to see vol percentile(ranking)
# go Long when vol percentile is low
# go Short when vol percentile is high
#
def ivol = if !IsNaN(imp_volatility) then imp_volatility else 0;
#
# the number after ivol refers to the number of trading days to include in the comparison. The current IV is compared to the lowest and highest IV over that period.
# 21 = 1 month past
# 42 = 2 months past(21 tradings days per month)
# 63 = 3 months past
# 252 = trading days in 1 year
def lowvol = Lowest(ivol, 252);
def highvol = Highest(ivol, 252);
#
def currentvol = imp_volatility;
plot data = ((currentvol - lowvol) / (highvol - lowvol) * 100);
#
#end custom quote.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment