Skip to content

Instantly share code, notes, and snippets.

@NVentimiglia
Last active April 28, 2021 03:55
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 NVentimiglia/7c71feb025789f6ddcf6cc6ddc8ffbac to your computer and use it in GitHub Desktop.
Save NVentimiglia/7c71feb025789f6ddcf6cc6ddc8ffbac to your computer and use it in GitHub Desktop.
ThinkScript : IV Correlation, use to identify divergences in implied and realized volatility
#
# https://github.com/NVentimiglia
# Nic_IVCorrelation
# ThinkScript : IV Correlation, use to identify divergences in implied and realized volatility
#
declare lower;
input length = 10;
def ImpVol = IMP_VOLATILITY();
plot Correlation = correlation(close, ImpVol, length);
Correlation.DefineColor("Positive", Color.DOWNTICK);
Correlation.DefineColor("Negative", Color.UPTICK);
Correlation.AssignValueColor(if Correlation >= 0 then Correlation.Color("Positive") else Correlation.Color("Negative"));
Correlation.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment