Skip to content

Instantly share code, notes, and snippets.

@NVentimiglia
Last active May 27, 2024 23:11
Show Gist options
  • 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