Created
June 9, 2016 19:16
-
-
Save antonywu/214554e19b276b9cab3164a82849d5e3 to your computer and use it in GitHub Desktop.
ThinkScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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