Marc@uTS
New member
Hi there,
I´m just trying to display IV for an individual time period, for instance 45 days, below the price chart of my Thinkorswim desktop version.
This is my code:
But the chart is staying completely empty.
If I delete the parameter daystoexpiration from the code then the chart shows the default IV calculation value (I guess for options with 30 days to expiration) but that´s not what I want.
Does someone know how to display IV calculated on basis of options with 45 days to expiration?
Cheers,
Marc
I´m just trying to display IV for an individual time period, for instance 45 days, below the price chart of my Thinkorswim desktop version.
This is my code:
Code:
declare lower;
input daysToExpiration = 45;
def iv = Imp_Volatility(GetSymbol(), daysToExpiration);
#def iv = Imp_Volatility(GetSymbol()); #If I do it like this then the IV is shown in the chart.
plot ImpliedVolatility = iv;
ImpliedVolatility.SetDefaultColor(Color.CYAN);
ImpliedVolatility.SetLineWeight(2);
But the chart is staying completely empty.
If I delete the parameter daystoexpiration from the code then the chart shows the default IV calculation value (I guess for options with 30 days to expiration) but that´s not what I want.
Does someone know how to display IV calculated on basis of options with 45 days to expiration?
Cheers,
Marc