Series Option code

young_and_dumb

New member
VIP
Hey all was trying to build something and found a few different ways to do what I neded to do.

I was wondering if anyone could share other ways to pull the series IV from the option chain. This code I am using now is the best format but lags and sometimes take a good 30 second- or never- to plot it on the chart.

Thank you to anyone that can help.


Code:
input Series_IV = 1; #hint Series_IV: Series 1 is closest expirery.

assert(series_IV > 0, "'series' must be positive: " + series_IV);

def seriesIV = if isNaN(SeriesVolatility(series = Series_IV))

               then seriesIV[7]

               else SeriesVolatility(series = Series_IV);
 

Similar threads

Top