Option Heatmap and OI Strikes For ThinkOrSwim

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

Awesome work in putting this script together, thank you for sharing (y)

However it is extremely memory intensive and takes time to load to a point where sometimes it simply won't work or thinkorswim becomes very slow (RAM is not an issue as I got more than enough).

Is there a better way so we can limit how many data points it looks (e.g. top 3 put call based on OI & volume on both sides ITM/OTM, or immediate next 3 strikes in either direction, etc) or come up with optimize parameters so it works relatively quickly without slowing down the platform!
 
Most Recent Update
Edit: Now works for prices > 1000
Code:
#hint barLength: The number of bars used to calculate the ADX <b>(Default is 14)</b>


#hint barLength: The number of bars used to calculate the ADX <b>(Default is 14)</b>


def series = 1;

input show_label = yes;
input mode = {default AUTO, MANUAL};


def RTHopen = open(period = AggregationPeriod.DAY);
def CurrentYear = GetYear();
def CurrentMonth = GetMonth();
def CurrentDOM = GetDayOfMonth(GetYYYYMMDD());
def Day1DOW1 = GetDayOfWeek((CurrentYear * 10000) + (CurrentMonth * 100) + 1); # First DOM is this DOW
def FirstFridayDOM1 = if Day1DOW1 < 6
then 6 - Day1DOW1
else if Day1DOW1 == 6
then 7
else 6;

def SecondFridayDOM = FirstFridayDOM1 + 7;
def ThirdFridayDOM = FirstFridayDOM1 + 14;
def FourthFridayDOM = FirstFridayDOM1 + 21;
def RollDOM = FirstFridayDOM1 + 14; #changed to 21 to pick up all Fridays of the current month for weekly options
def ExpMonthA = if RollDOM > CurrentDOM #MK - expmonth1 changed to ExpmonthA
then CurrentMonth + series - 1
else CurrentMonth + series;

def ExpMonthB = if ExpMonthA > 12 #options month input -- #MK - expmonth2 changed to ExpmonthB
then ExpMonthA - 12
else ExpMonthA;

def ExpYear = if ExpMonthA > 12 #options year input
then CurrentYear + 1
else CurrentYear;


def Day1DOW = GetDayOfWeek(ExpYear * 10000 + ExpMonthB * 100 + 1); #first friday expiry calc
def FirstFridayDOM = if Day1DOW < 6
then 6 - Day1DOW
else if Day1DOW == 6
then 7
else 6;

#MK added easier input to fix date
input datefix = 0;
def ExpDOM = FirstFridayDOM + 14 + datefix;

def ExpMonth2 = ExpMonthB; #MK in case more date issues need to be fixed

#strike spacing inputs
input maxStrikeSpacing = 25;
input manualCenterStrike = 440;
input manualStrikeSpacing = 1.0;


#centerstrike
rec centerStrike = if (mode == mode.AUTO and !IsNaN(close)) then Round(close / 10.0, 0) * 10.0 else if (mode == mode.MANUAL and !IsNaN(close)) then manualcenterstrike else centerStrike[1]; #MK - imported from prev code - plot now working

#strikeSpacing
def strikeSpacingC = fold i = 1 to maxStrikeSpacing with spacing = 0 do if !IsNaN( open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", Asprice(centerStrike + (maxStrikeSpacing - i)))))) then maxStrikeSpacing - i else spacing;

rec strikeSpacing = if (mode == mode.AUTO and !IsNaN(close)) then strikeSpacingC else if (mode == mode.MANUAL and !IsNaN(close)) then manualStrikeSpacing else strikeSpacing[1];

### bar vars ###
input displayOffset = 5; # Number of bars to right of current bar for display
input barWeight = 1;
rec barOffset = if !IsNaN(close) then strikeSpacing / 10.0 else barOffset[1];
rec extBar = if IsNaN(close[displayOffset]) then extBar[1] + 1 else 0; # Number of bars of right space minus 5
input barLength = 45;

#call/put colors
DefineGlobalColor("Calls", Color.GREEN);
DefineGlobalColor("Puts", Color.RED);

#current option expiry label
#AddLabel(yes, Concat("Expiration: ", Concat(Concat(ExpYear - 2000,
        #if ExpMonth2 <= 9 then Concat("0", ExpMonth2)
            #else Concat("", ExpMonth2)),
        #if ExpDOM <= 9 then Concat("0", ExpDOM)
            #else Concat("", ExpDOM))), Color.WHITE);


AddLabel(yes, (Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM))))));
addLabel(yes, (Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike)))));


#options calculations **************

def c1_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing *0 ))));
def c2_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 1))));
def c3_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 2))));
def c4_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 3))));
def c5_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing))));
def c6_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 2))));
def c7_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 3))));

def c8_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 4))));
def c9_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 4))));
def c10_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 5))));
def c11_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 5))));
def c12_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 6))));
def c13_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 6))));
def c14_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 7))));
def c15_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 7))));
def c16_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 8))));
def c17_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 8))));
def c18_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 9))));
def c19_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 9))));
def c20_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 10))));
def c21_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 10))));
def c22_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 11))));
def c23_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 11))));
def c24_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 12))));
def c25_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 12))));
def c26_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 13))));
def c27_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 13))));
def c28_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 14))));
def c29_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 14))));
def c30_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 15))));
def c31_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 15))));
def c32_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 16))));
def c33_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 16))));
def c34_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 17))));
def c35_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 17))));
def c36_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 18))));
def c37_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 18))));
def c38_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 19))));
def c39_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 19))));

#puts
def p1_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike))));
def p2_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing))));
def p3_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 2))));
def p4_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 3))));

def p5_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing))));
def p6_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 2))));
def p7_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 3))));

def p8_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 4))));
def p9_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 4))));
def p10_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 5))));
def p11_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 5))));
def p12_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 6))));
def p13_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 6))));
def p14_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 7))));
def p15_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 7))));
def p16_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 8))));
def p17_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 8))));
def p18_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 9))));
def p19_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 9))));
def p20_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 10))));
def p21_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 10))));
def p22_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 11))));
def p23_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 11))));
def p24_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 12))));
def p25_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 12))));
def p26_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 13))));
def p27_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 13))));
def p28_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 14))));
def p29_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 14))));
def p30_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 15))));
def p31_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 15))));
def p32_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 16))));
def p33_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 16))));
def p34_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 17))));
def p35_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 17))));
def p36_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 18))));
def p37_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 18))));
def p38_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 19))));
def p39_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 19))));

def c1_V = if !IsNaN(c1_V_d) then c1_V_d else 0;
def c2_V = if !IsNaN(c2_V_d) then c2_V_d else 0;
def c3_V = if !IsNaN(c3_V_d) then c3_V_d else 0;
def c4_V = if !IsNaN(c4_V_d) then c4_V_d else 0;
def c5_V = if !IsNaN(c5_V_d) then c5_V_d else 0;
def c6_V = if !IsNaN(c6_V_d) then c6_V_d else 0;
def c7_V = if !IsNaN(c7_V_d) then c7_V_d else 0;
def c8_V = if !IsNaN(c8_V_d) then c8_V_d else 0;
def c9_V = if !IsNaN(c9_V_d) then c9_V_d else 0;
def c10_V = if !IsNaN(c10_V_d) then c10_V_d else 0;
def c11_V = if !IsNaN(c11_V_d) then c11_V_d else 0;

def c12_V = if !IsNaN(c12_V_d) then c12_V_d else 0;
def c13_V = if !IsNaN(c13_V_d) then c13_V_d else 0;
def c14_V = if !IsNaN(c14_V_d) then c14_V_d else 0;
def c15_V = if !IsNaN(c15_V_d) then c15_V_d else 0;
def c16_V = if !IsNaN(c16_V_d) then c16_V_d else 0;
def c17_V = if !IsNaN(c17_V_d) then c17_V_d else 0;
def c18_V = if !IsNaN(c18_V_d) then c18_V_d else 0;
def c19_V = if !IsNaN(c19_V_d) then c19_V_d else 0;
def c20_V = if !IsNaN(c20_V_d) then c20_V_d else 0;
def c21_V = if !IsNaN(c21_V_d) then c21_V_d else 0;
def c22_V = if !IsNaN(c22_V_d) then c22_V_d else 0;
def c23_V = if !IsNaN(c23_V_d) then c23_V_d else 0;
def c24_V = if !IsNaN(c24_V_d) then c24_V_d else 0;
def c25_V = if !IsNaN(c25_V_d) then c25_V_d else 0;
def c26_V = if !IsNaN(c26_V_d) then c26_V_d else 0;
def c27_V = if !IsNaN(c27_V_d) then c27_V_d else 0;
def c28_V = if !IsNaN(c28_V_d) then c28_V_d else 0;
def c29_V = if !IsNaN(c29_V_d) then c29_V_d else 0;
def c30_V = if !IsNaN(c30_V_d) then c30_V_d else 0;

def c31_V = if !IsNaN(c31_V_d) then c31_V_d else 0;
def c32_V = if !IsNaN(c32_V_d) then c32_V_d else 0;
def c33_V = if !IsNaN(c33_V_d) then c33_V_d else 0;
def c34_V = if !IsNaN(c34_V_d) then c34_V_d else 0;
def c35_V = if !IsNaN(c35_V_d) then c35_V_d else 0;
def c36_V = if !IsNaN(c36_V_d) then c36_V_d else 0;
def c37_V = if !IsNaN(c37_V_d) then c37_V_d else 0;
def c38_V = if !IsNaN(c38_V_d) then c38_V_d else 0;

def p1_V = if !IsNaN(p1_V_d) then p1_V_d else 0;
def p2_V = if !IsNaN(p2_V_d) then p2_V_d else 0;
def p3_V = if !IsNaN(p3_V_d) then p3_V_d else 0;
def p4_V = if !IsNaN(p4_V_d) then p4_V_d else 0;
def p5_V = if !IsNaN(p5_V_d) then p5_V_d else 0;
def p6_V = if !IsNaN(p6_V_d) then p6_V_d else 0;
def p7_V = if !IsNaN(p7_V_d) then p7_V_d else 0;
def p8_V = if !IsNaN(p8_V_d) then p8_V_d else 0;
def p9_V = if !IsNaN(p9_V_d) then p9_V_d else 0;
def p10_V = if !IsNaN(p10_V_d) then p10_V_d else 0;
def p11_V = if !IsNaN(p11_V_d) then p11_V_d else 0;

def p12_V = if !IsNaN(p12_V_d) then p12_V_d else 0;
def p13_V = if !IsNaN(p13_V_d) then p13_V_d else 0;
def p14_V = if !IsNaN(p14_V_d) then p14_V_d else 0;
def p15_V = if !IsNaN(p15_V_d) then p15_V_d else 0;
def p16_V = if !IsNaN(p16_V_d) then p16_V_d else 0;
def p17_V = if !IsNaN(p17_V_d) then p17_V_d else 0;
def p18_V = if !IsNaN(p18_V_d) then p18_V_d else 0;
def p19_V = if !IsNaN(p19_V_d) then p19_V_d else 0;
def p20_V = if !IsNaN(p20_V_d) then p20_V_d else 0;
def p21_V = if !IsNaN(p21_V_d) then p21_V_d else 0;
def p22_V = if !IsNaN(p22_V_d) then p22_V_d else 0;
def p23_V = if !IsNaN(p23_V_d) then p23_V_d else 0;
def p24_V = if !IsNaN(p24_V_d) then p24_V_d else 0;
def p25_V = if !IsNaN(p25_V_d) then p25_V_d else 0;
def p26_V = if !IsNaN(p26_V_d) then p26_V_d else 0;
def p27_V = if !IsNaN(p27_V_d) then p27_V_d else 0;
def p28_V = if !IsNaN(p28_V_d) then p28_V_d else 0;
def p29_V = if !IsNaN(p29_V_d) then p29_V_d else 0;
def p30_V = if !IsNaN(p30_V_d) then p30_V_d else 0;

def p31_V = if !IsNaN(p31_V_d) then p31_V_d else 0;
def p32_V = if !IsNaN(p32_V_d) then p32_V_d else 0;
def p33_V = if !IsNaN(p33_V_d) then p33_V_d else 0;
def p34_V = if !IsNaN(p34_V_d) then p34_V_d else 0;
def p35_V = if !IsNaN(p35_V_d) then p35_V_d else 0;
def p36_V = if !IsNaN(p36_V_d) then p36_V_d else 0;
def p37_V = if !IsNaN(p37_V_d) then p37_V_d else 0;
def p38_V = if !IsNaN(p38_V_d) then p38_V_d else 0;


def c1t = Max(Max(Max(Max(c1_V, c2_V), c3_V), c4_V), c5_V);
def c2t = Max(Max(Max(Max(Max(c6_V, c7_V), c8_V), c9_V), c10_V), c11_V);

def c3t = Max(Max(Max(Max(Max(Max(Max(c12_V, c13_V), c14_V), c15_V), c16_V), c17_V),c18_V),c19_V);
def c4t = Max(Max(Max(Max(Max(c20_V, c21_V),c22_V),c23_V),c24_V),c25_V);
def c5t = Max(Max(Max(Max(Max(Max(c26_V,c27_V),c28_v),c29_v),c30_V),c31_v),c32_v);
def c6t = Max(Max(Max(Max(Max(c33_V,c34_V),c35_v),c36_v),c37_V),c38_v);

def p1t = Max(Max(Max(Max(p1_V, p2_V), p3_V), p4_V), p5_V);
def p2t = Max(Max(Max(Max(Max(p6_V, p7_V), p8_V), p9_V), p10_V), p11_V);

def p3t = Max(Max(Max(Max(Max(Max(Max(p12_V, p13_V), p14_V), p15_V), p16_V), p17_V),p18_V),p19_V);
def p4t = Max(Max(Max(Max(Max(p20_V, p21_V),p22_V),p23_V),p24_V),p25_V);
def p5t = Max(Max(Max(Max(Max(Max(p26_V,p27_V),p28_v),p29_v),p30_V),p31_v),p32_v);
def p6t = Max(Max(Max(Max(Max(p33_V,p34_V),p35_v),p36_v),p37_V),p38_v);



def c_V_max = Max(Max(Max(Max(Max(c1t, c2t), c3t), c4t),c5t),c6t);
def p_V_max = Max(Max(Max(Max(Max(p1t, p2t), p3t), p4t),p5t),p6t);
def OI_max = Max(c_V_max, p_V_max);

def cVT = c1_V + c2_V + c3_V + c4_V + c5_V + c6_V + c7_V + c8_V + c9_V + c10_V + c11_V + c12_V + c13_V + c14_V + c15_V + c16_V + c17_V + c18_V + c19_V + c20_V + c21_V + c22_V + c23_V + c24_V + c25_V + c26_V + c27_V + c28_V + c29_V + c30_V + c31_V + c32_V + c33_V + c34_V + c35_V + c36_V + c37_V + c38_V;

def pVT = p1_V + p2_V + p3_V + p4_V + p5_V + p6_V + p7_V + p8_V + p9_V + p10_V + p11_V + p12_V + p13_V + p14_V + p15_V + p16_V + p17_V + p18_V + p19_V + p20_V + p21_V + p22_V + p23_V + p24_V + p25_V + p26_V + p27_V + p28_V + p29_V + p30_V + p31_V + p32_V + p33_V + p34_V + p35_V + p36_V + p37_V + p38_V;

AddLabel(yes, Concat("Call OI: ", cVT), GlobalColor("Calls"));
AddLabel(yes, Concat("Put OI: ", pVT), GlobalColor("Puts"));


#strike spacing
def strikespac = if mode == mode.AUTO then strikeSpacing else 1; #MK - auto pricerange option
AddLabel(show_label, Concat("Strike Spacing: ", strikespac), Color.WHITE);

rec c1_D = if IsNaN(close) then c1_D[1] else Ceil((c1_V / OI_max) * barLength);
plot C1 = if c1_D >= extBar and extBar != 0 then centerStrike + barOffset else Double.NaN;
C1.SetDefaultColor(GlobalColor("Calls") );
C1.SetLineWeight(barWeight);

rec c2_D = if IsNaN(close) then c2_D[1] else Ceil((c2_V / OI_max) * barLength);
plot C2 = if c2_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac else Double.NaN;
C2.SetDefaultColor(GlobalColor("Calls"));
C2.SetLineWeight(barWeight);

rec c3_D = if IsNaN(close) then c3_D[1] else Ceil((c3_V / OI_max) * barLength);
plot C3 = if c3_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 2 else Double.NaN;
C3.SetDefaultColor(GlobalColor("Calls"));
C3.SetLineWeight(barWeight);

rec c4_D = if IsNaN(close) then c4_D[1] else Ceil((c4_V / OI_max) * barLength);
plot C4 = if c4_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 3 else Double.NaN;
C4.SetDefaultColor(GlobalColor("Calls"));
C4.SetLineWeight(barWeight);

rec c5_D = if IsNaN(close) then c5_D[1] else Ceil((c5_V / OI_max) * barLength);
plot C5 = if c5_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac else Double.NaN;
C5.SetDefaultColor(GlobalColor("Calls"));
C5.SetLineWeight(barWeight);

rec c6_D = if IsNaN(close) then c6_D[1] else Ceil((c6_V / OI_max) * barLength);
plot C6 = if c6_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 2 else Double.NaN;
C6.SetDefaultColor(GlobalColor("Calls"));
C6.SetLineWeight(barWeight);

rec c7_D = if IsNaN(close) then c7_D[1] else Ceil((c7_V / OI_max) * barLength);
plot C7 = if c7_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 3 else Double.NaN;
C7.SetDefaultColor(GlobalColor("Calls"));
C7.SetLineWeight(barWeight);

rec c8_D = if IsNaN(close) then c8_D[1] else Ceil((c8_V / OI_max) * barLength);
plot C8 = if c8_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 4 else Double.NaN;
C8.SetDefaultColor(GlobalColor("Calls"));
C8.SetLineWeight(barWeight);

rec c9_D = if IsNaN(close) then c9_D[1] else Ceil((c9_V / OI_max) * barLength);
plot C9 = if c9_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 4 else Double.NaN;
C9.SetDefaultColor(GlobalColor("Calls"));
C9.SetLineWeight(barWeight);

rec c10_D = if IsNaN(close) then c10_D[1] else Ceil((c10_V / OI_max) * barLength);
plot C10 = if c10_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 5 else Double.NaN;
C10.SetDefaultColor(GlobalColor("Calls"));
C10.SetLineWeight(barWeight);

rec c11_D = if IsNaN(close) then c11_D[1] else Ceil((c11_V / OI_max) * barLength);
plot C11 = if c11_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 5 else Double.NaN;
C11.SetDefaultColor(GlobalColor("Calls"));
C11.SetLineWeight(barWeight);

rec c12_D = if IsNaN(close) then c12_D[1] else Ceil((c12_V / OI_max) * barLength);
plot C12 = if c12_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 6 else Double.NaN;
C12.SetDefaultColor(GlobalColor("Calls"));
C12.SetLineWeight(barWeight);

rec c13_D = if IsNaN(close) then c13_D[1] else Ceil((c13_V / OI_max) * barLength);
plot C13 = if c13_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 6 else Double.NaN;
C13.SetDefaultColor(GlobalColor("Calls"));
C13.SetLineWeight(barWeight);

rec c14_D = if IsNaN(close) then c14_D[1] else Ceil((c14_V / OI_max) * barLength);
plot C14 = if c14_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 7 else Double.NaN;
C14.SetDefaultColor(GlobalColor("Calls"));
C14.SetLineWeight(barWeight);

rec c15_D = if IsNaN(close) then c15_D[1] else Ceil((c15_V / OI_max) * barLength);
plot C15 = if c15_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 7 else Double.NaN;
C15.SetDefaultColor(GlobalColor("Calls"));
C15.SetLineWeight(barWeight);

rec c16_D = if IsNaN(close) then c16_D[1] else Ceil((c16_V / OI_max) * barLength);
plot C16 = if c16_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 8 else Double.NaN;
C16.SetDefaultColor(GlobalColor("Calls"));
C16.SetLineWeight(barWeight);

rec c17_D = if IsNaN(close) then c17_D[1] else Ceil((c17_V / OI_max) * barLength);
plot C17 = if c17_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 8 else Double.NaN;
C17.SetDefaultColor(GlobalColor("Calls"));
C17.SetLineWeight(barWeight);

rec c18_D = if IsNaN(close) then c18_D[1] else Ceil((c18_V / OI_max) * barLength);
plot C18 = if c18_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 9 else Double.NaN;
C18.SetDefaultColor(GlobalColor("Calls"));
C18.SetLineWeight(barWeight);

rec c19_D = if IsNaN(close) then c19_D[1] else Ceil((c19_V / OI_max) * barLength);
plot C19 = if c19_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 9 else Double.NaN;
C19.SetDefaultColor(GlobalColor("Calls"));
C19.SetLineWeight(barWeight);

rec c20_D = if IsNaN(close) then c20_D[1] else Ceil((c20_V / OI_max) * barLength);
plot C20 = if c20_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 10 else Double.NaN;
C20.SetDefaultColor(GlobalColor("Calls"));
C20.SetLineWeight(barWeight);

rec c21_D = if IsNaN(close) then c21_D[1] else Ceil((c21_V / OI_max) * barLength);
plot C21 = if c21_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 10 else Double.NaN;
C21.SetDefaultColor(GlobalColor("Calls"));
C21.SetLineWeight(barWeight);

rec c22_D = if IsNaN(close) then c22_D[1] else Ceil((c22_V / OI_max) * barLength);
plot C22 = if c22_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 11 else Double.NaN;
C22.SetDefaultColor(GlobalColor("Calls"));
C22.SetLineWeight(barWeight);

rec c23_D = if IsNaN(close) then c23_D[1] else Ceil((c23_V / OI_max) * barLength);
plot C23 = if c23_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 11 else Double.NaN;
C23.SetDefaultColor(GlobalColor("Calls"));
C23.SetLineWeight(barWeight);

rec c24_D = if IsNaN(close) then c24_D[1] else Ceil((c24_V / OI_max) * barLength);
plot C24 = if c24_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 12 else Double.NaN;
C24.SetDefaultColor(GlobalColor("Calls"));
C24.SetLineWeight(barWeight);

rec c25_D = if IsNaN(close) then c25_D[1] else Ceil((c25_V / OI_max) * barLength);
plot C25 = if c25_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 12 else Double.NaN;
C25.SetDefaultColor(GlobalColor("Calls"));
C25.SetLineWeight(barWeight);

rec c26_D = if IsNaN(close) then c26_D[1] else Ceil((c26_V / OI_max) * barLength);
plot C26 = if c26_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 13 else Double.NaN;
C26.SetDefaultColor(GlobalColor("Calls"));
C26.SetLineWeight(barWeight);

rec c27_D = if IsNaN(close) then c27_D[1] else Ceil((c27_V / OI_max) * barLength);
plot C27 = if c27_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 13 else Double.NaN;
C27.SetDefaultColor(GlobalColor("Calls"));
C27.SetLineWeight(barWeight);

rec c28_D = if IsNaN(close) then c28_D[1] else Ceil((c28_V / OI_max) * barLength);
plot C28 = if c28_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 14 else Double.NaN;
C28.SetDefaultColor(GlobalColor("Calls"));
C28.SetLineWeight(barWeight);

rec c29_D = if IsNaN(close) then c29_D[1] else Ceil((c29_V / OI_max) * barLength);
plot C29 = if c29_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 14 else Double.NaN;
C29.SetDefaultColor(GlobalColor("Calls"));
C29.SetLineWeight(barWeight);

rec c30_D = if IsNaN(close) then c30_D[1] else Ceil((c30_V / OI_max) * barLength);
plot C30 = if c30_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 15 else Double.NaN;
C30.SetDefaultColor(GlobalColor("Calls"));
C30.SetLineWeight(barWeight);

rec c31_D = if IsNaN(close) then c31_D[1] else Ceil((c31_V / OI_max) * barLength);
plot C31 = if c31_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 15 else Double.NaN;
C31.SetDefaultColor(GlobalColor("Calls"));
C31.SetLineWeight(barWeight);

rec c32_D = if IsNaN(close) then c32_D[1] else Ceil((c32_V / OI_max) * barLength);
plot C32 = if c32_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 16 else Double.NaN;
C32.SetDefaultColor(GlobalColor("Calls"));
C32.SetLineWeight(barWeight);

rec c33_D = if IsNaN(close) then c33_D[1] else Ceil((c33_V / OI_max) * barLength);
plot C33 = if c33_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 16 else Double.NaN;
C33.SetDefaultColor(GlobalColor("Calls"));
C33.SetLineWeight(barWeight);

rec c34_D = if IsNaN(close) then c34_D[1] else Ceil((c34_V / OI_max) * barLength);
plot C34 = if c34_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 17 else Double.NaN;
C34.SetDefaultColor(GlobalColor("Calls"));
C34.SetLineWeight(barWeight);

rec c35_D = if IsNaN(close) then c35_D[1] else Ceil((c35_V / OI_max) * barLength);
plot C35 = if c35_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 17 else Double.NaN;
C35.SetDefaultColor(GlobalColor("Calls"));
C35.SetLineWeight(barWeight);

rec c36_D = if IsNaN(close) then c36_D[1] else Ceil((c36_V / OI_max) * barLength);
plot C36 = if c36_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 18 else Double.NaN;
C36.SetDefaultColor(GlobalColor("Calls"));
C36.SetLineWeight(barWeight);

rec c37_D = if IsNaN(close) then c37_D[1] else Ceil((c37_V / OI_max) * barLength);
plot C37 = if c37_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 18 else Double.NaN;
C37.SetDefaultColor(GlobalColor("Calls"));
C37.SetLineWeight(barWeight);

rec c38_D = if IsNaN(close) then c38_D[1] else Ceil((c38_V / OI_max) * barLength);
plot C38 = if c38_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 19 else Double.NaN;
C38.SetDefaultColor(GlobalColor("Calls"));
C38.SetLineWeight(barWeight);


rec p1_D = if IsNaN(close) then p1_D[1] else Ceil((p1_V / OI_max) * barLength);
plot P1 = if p1_D >= extBar and extBar != 0 then centerStrike - barOffset else Double.NaN;
P1.SetDefaultColor(GlobalColor("Puts") );
P1.SetLineWeight(barWeight);

rec p2_D = if IsNaN(close) then p2_D[1] else Ceil((p2_V / OI_max) * barLength);
plot P2 = if p2_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac else Double.NaN;
P2.SetDefaultColor(GlobalColor("Puts"));
P2.SetLineWeight(barWeight);

rec p3_D = if IsNaN(close) then p3_D[1] else Ceil((p3_V / OI_max) * barLength);
plot P3 = if p3_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 2 else Double.NaN;
P3.SetDefaultColor(GlobalColor("Puts"));
P3.SetLineWeight(barWeight);

rec p4_D = if IsNaN(close) then p4_D[1] else Ceil((p4_V / OI_max) * barLength);
plot P4 = if p4_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 3 else Double.NaN;
P4.SetDefaultColor(GlobalColor("Puts"));
P4.SetLineWeight(barWeight);

rec p5_D = if IsNaN(close) then p5_D[1] else Ceil((p5_V / OI_max) * barLength);
plot P5 = if p5_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac else Double.NaN;
P5.SetDefaultColor(GlobalColor("Puts"));
P5.SetLineWeight(barWeight);

rec p6_D = if IsNaN(close) then p6_D[1] else Ceil((p6_V / OI_max) * barLength);
plot P6 = if p6_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 2 else Double.NaN;
P6.SetDefaultColor(GlobalColor("Puts"));
P6.SetLineWeight(barWeight);

rec p7_D = if IsNaN(close) then p7_D[1] else Ceil((p7_V / OI_max) * barLength);
plot P7 = if p7_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 3 else Double.NaN;
P7.SetDefaultColor(GlobalColor("Puts"));
P7.SetLineWeight(barWeight);

rec p8_D = if IsNaN(close) then p8_D[1] else Ceil((p8_V / OI_max) * barLength);
plot P8 = if p8_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 4 else Double.NaN;
P8.SetDefaultColor(GlobalColor("Puts"));
P8.SetLineWeight(barWeight);

rec p9_D = if IsNaN(close) then p9_D[1] else Ceil((p9_V / OI_max) * barLength);
plot P9 = if p9_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 4 else Double.NaN;
P9.SetDefaultColor(GlobalColor("Puts"));
P9.SetLineWeight(barWeight);

rec p10_D = if IsNaN(close) then p10_D[1] else Ceil((p10_V / OI_max) * barLength);
plot P10 = if p10_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 5 else Double.NaN;
P10.SetDefaultColor(GlobalColor("Puts"));
P10.SetLineWeight(barWeight);

rec p11_D = if IsNaN(close) then p11_D[1] else Ceil((p11_V / OI_max) * barLength);
plot P11 = if p11_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 5 else Double.NaN;
P11.SetDefaultColor(GlobalColor("Puts"));
P11.SetLineWeight(barWeight);

rec p12_D = if IsNaN(close) then p12_D[1] else Ceil((p12_V / OI_max) * barLength);
plot P12 = if p12_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 6 else Double.NaN;
P12.SetDefaultColor(GlobalColor("Puts"));
P12.SetLineWeight(barWeight);

rec p13_D = if IsNaN(close) then p13_D[1] else Ceil((p13_V / OI_max) * barLength);
plot P13 = if p13_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 6 else Double.NaN;
P13.SetDefaultColor(GlobalColor("Puts"));
P13.SetLineWeight(barWeight);

rec p14_D = if IsNaN(close) then p14_D[1] else Ceil((p14_V / OI_max) * barLength);
plot P14 = if p14_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 7 else Double.NaN;
P14.SetDefaultColor(GlobalColor("Puts"));
P14.SetLineWeight(barWeight);

rec p15_D = if IsNaN(close) then p15_D[1] else Ceil((p15_V / OI_max) * barLength);
plot P15 = if p15_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 7 else Double.NaN;
P15.SetDefaultColor(GlobalColor("Puts"));
P15.SetLineWeight(barWeight);

rec p16_D = if IsNaN(close) then p16_D[1] else Ceil((p16_V / OI_max) * barLength);
plot P16 = if p16_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 8 else Double.NaN;
P16.SetDefaultColor(GlobalColor("Puts"));
P16.SetLineWeight(barWeight);

rec p17_D = if IsNaN(close) then p17_D[1] else Ceil((p17_V / OI_max) * barLength);
plot P17 = if p17_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 8 else Double.NaN;
P17.SetDefaultColor(GlobalColor("Puts"));
P17.SetLineWeight(barWeight);

rec p18_D = if IsNaN(close) then p18_D[1] else Ceil((p18_V / OI_max) * barLength);
plot P18 = if p18_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 9 else Double.NaN;
P18.SetDefaultColor(GlobalColor("Puts"));
P18.SetLineWeight(barWeight);

rec p19_D = if IsNaN(close) then p19_D[1] else Ceil((p19_V / OI_max) * barLength);
plot P19 = if p19_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 9 else Double.NaN;
P19.SetDefaultColor(GlobalColor("Puts"));
P19.SetLineWeight(barWeight);

rec p20_D = if IsNaN(close) then p20_D[1] else Ceil((p20_V / OI_max) * barLength);
plot p20 = if p20_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 10 else Double.NaN;
P20.SetDefaultColor(GlobalColor("Puts"));
P20.SetLineWeight(barWeight);

rec p21_D = if IsNaN(close) then p21_D[1] else Ceil((P21_V / OI_max) * barLength);
plot P21 = if p21_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 10 else Double.NaN;
P21.SetDefaultColor(GlobalColor("Puts"));
P21.SetLineWeight(barWeight);

rec p22_D = if IsNaN(close) then p22_D[1] else Ceil((p22_V / OI_max) * barLength);
plot P22 = if p22_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 11 else Double.NaN;
P22.SetDefaultColor(GlobalColor("Puts"));
P22.SetLineWeight(barWeight);

rec p23_D = if IsNaN(close) then p23_D[1] else Ceil((p23_V / OI_max) * barLength);
plot P23 = if p23_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 11 else Double.NaN;
P23.SetDefaultColor(GlobalColor("Puts"));
P23.SetLineWeight(barWeight);

rec p24_D = if IsNaN(close) then p24_D[1] else Ceil((p24_V / OI_max) * barLength);
plot P24 = if p24_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 12 else Double.NaN;
P24.SetDefaultColor(GlobalColor("Puts"));
P24.SetLineWeight(barWeight);

rec p25_D = if IsNaN(close) then p25_D[1] else Ceil((p25_V / OI_max) * barLength);
plot P25 = if p25_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 12 else Double.NaN;
P25.SetDefaultColor(GlobalColor("Puts"));
P25.SetLineWeight(barWeight);

rec p26_D = if IsNaN(close) then p26_D[1] else Ceil((p26_V / OI_max) * barLength);
plot P26 = if p26_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 13 else Double.NaN;
P26.SetDefaultColor(GlobalColor("Puts"));
P26.SetLineWeight(barWeight);

rec p27_D = if IsNaN(close) then p27_D[1] else Ceil((p27_V / OI_max) * barLength);
plot P27 = if p27_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 13 else Double.NaN;
P27.SetDefaultColor(GlobalColor("Puts"));
P27.SetLineWeight(barWeight);

rec p28_D = if IsNaN(close) then p28_D[1] else Ceil((p28_V / OI_max) * barLength);
plot P28 = if p28_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 14 else Double.NaN;
P28.SetDefaultColor(GlobalColor("Puts"));
P28.SetLineWeight(barWeight);

rec p29_D = if IsNaN(close) then p29_D[1] else Ceil((p29_V / OI_max) * barLength);
plot P29 = if p29_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 14 else Double.NaN;
P29.SetDefaultColor(GlobalColor("Puts"));
P29.SetLineWeight(barWeight);

rec p30_D = if IsNaN(close) then p30_D[1] else Ceil((p30_V / OI_max) * barLength);
plot P30 = if p30_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 15 else Double.NaN;
P30.SetDefaultColor(GlobalColor("Puts"));
P30.SetLineWeight(barWeight);

rec p31_D = if IsNaN(close) then p31_D[1] else Ceil((p31_V / OI_max) * barLength);
plot P31 = if p31_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 15 else Double.NaN;
P31.SetDefaultColor(GlobalColor("Puts"));
P31.SetLineWeight(barWeight);

rec p32_D = if IsNaN(close) then p32_D[1] else Ceil((p32_V / OI_max) * barLength);
plot P32 = if p32_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 16 else Double.NaN;
P32.SetDefaultColor(GlobalColor("Puts"));
P32.SetLineWeight(barWeight);

rec p33_D = if IsNaN(close) then p33_D[1] else Ceil((p33_V / OI_max) * barLength);
plot P33 = if p33_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 16 else Double.NaN;
P33.SetDefaultColor(GlobalColor("Puts"));
P33.SetLineWeight(barWeight);

rec p34_D = if IsNaN(close) then p34_D[1] else Ceil((p34_V / OI_max) * barLength);
plot P34 = if p34_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 17 else Double.NaN;
P34.SetDefaultColor(GlobalColor("Puts"));
P34.SetLineWeight(barWeight);

rec p35_D = if IsNaN(close) then p35_D[1] else Ceil((p35_V / OI_max) * barLength);
plot P35 = if p35_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 17 else Double.NaN;
P35.SetDefaultColor(GlobalColor("Puts"));
P35.SetLineWeight(barWeight);

rec p36_D = if IsNaN(close) then p36_D[1] else Ceil((p36_V / OI_max) * barLength);
plot P36 = if p36_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 18 else Double.NaN;
P36.SetDefaultColor(GlobalColor("Puts"));
P36.SetLineWeight(barWeight);

rec p37_D = if IsNaN(close) then p37_D[1] else Ceil((p37_V / OI_max) * barLength);
plot P37 = if p37_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 18 else Double.NaN;
P37.SetDefaultColor(GlobalColor("Puts"));
P37.SetLineWeight(barWeight);

rec p38_D = if IsNaN(close) then p38_D[1] else Ceil((p38_V / OI_max) * barLength);
plot P38 = if p38_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 19 else Double.NaN;
P38.SetDefaultColor(GlobalColor("Puts"));
P38.SetLineWeight(barWeight);


C1.SetPaintingStrategy(PaintingStrategy.DASHES);
C2.SetPaintingStrategy(PaintingStrategy.DASHES);
C3.SetPaintingStrategy(PaintingStrategy.DASHES);
C4.SetPaintingStrategy(PaintingStrategy.DASHES);
C5.SetPaintingStrategy(PaintingStrategy.DASHES);
C6.SetPaintingStrategy(PaintingStrategy.DASHES);
C7.SetPaintingStrategy(PaintingStrategy.DASHES);
C8.SetPaintingStrategy(PaintingStrategy.DASHES);
C9.SetPaintingStrategy(PaintingStrategy.DASHES);
C10.SetPaintingStrategy(PaintingStrategy.DASHES);
C11.SetPaintingStrategy(PaintingStrategy.DASHES);

C12.SetPaintingStrategy(PaintingStrategy.DASHES);
C13.SetPaintingStrategy(PaintingStrategy.DASHES);
C14.SetPaintingStrategy(PaintingStrategy.DASHES);
C15.SetPaintingStrategy(PaintingStrategy.DASHES);
C16.SetPaintingStrategy(PaintingStrategy.DASHES);
C17.SetPaintingStrategy(PaintingStrategy.DASHES);
C18.SetPaintingStrategy(PaintingStrategy.DASHES);
C19.SetPaintingStrategy(PaintingStrategy.DASHES);
C20.SetPaintingStrategy(PaintingStrategy.DASHES);
C21.SetPaintingStrategy(PaintingStrategy.DASHES);
C22.SetPaintingStrategy(PaintingStrategy.DASHES);
C23.SetPaintingStrategy(PaintingStrategy.DASHES);
C24.SetPaintingStrategy(PaintingStrategy.DASHES);
C25.SetPaintingStrategy(PaintingStrategy.DASHES);
C26.SetPaintingStrategy(PaintingStrategy.DASHES);
C27.SetPaintingStrategy(PaintingStrategy.DASHES);
C28.SetPaintingStrategy(PaintingStrategy.DASHES);
C29.SetPaintingStrategy(PaintingStrategy.DASHES);
C30.SetPaintingStrategy(PaintingStrategy.DASHES);

C31.SetPaintingStrategy(PaintingStrategy.DASHES);
C32.SetPaintingStrategy(PaintingStrategy.DASHES);
C33.SetPaintingStrategy(PaintingStrategy.DASHES);
C34.SetPaintingStrategy(PaintingStrategy.DASHES);
C35.SetPaintingStrategy(PaintingStrategy.DASHES);
C36.SetPaintingStrategy(PaintingStrategy.DASHES);
C37.SetPaintingStrategy(PaintingStrategy.DASHES);
C38.SetPaintingStrategy(PaintingStrategy.DASHES);


P1.SetPaintingStrategy(PaintingStrategy.DASHES);
P2.SetPaintingStrategy(PaintingStrategy.DASHES);
P3.SetPaintingStrategy(PaintingStrategy.DASHES);
P4.SetPaintingStrategy(PaintingStrategy.DASHES);
P5.SetPaintingStrategy(PaintingStrategy.DASHES);
P6.SetPaintingStrategy(PaintingStrategy.DASHES);
P7.SetPaintingStrategy(PaintingStrategy.DASHES);
P8.SetPaintingStrategy(PaintingStrategy.DASHES);
P9.SetPaintingStrategy(PaintingStrategy.DASHES);
P10.SetPaintingStrategy(PaintingStrategy.DASHES);
P11.SetPaintingStrategy(PaintingStrategy.DASHES);

P12.SetPaintingStrategy(PaintingStrategy.DASHES);
P13.SetPaintingStrategy(PaintingStrategy.DASHES);
P14.SetPaintingStrategy(PaintingStrategy.DASHES);
P15.SetPaintingStrategy(PaintingStrategy.DASHES);
P16.SetPaintingStrategy(PaintingStrategy.DASHES);
P17.SetPaintingStrategy(PaintingStrategy.DASHES);
P18.SetPaintingStrategy(PaintingStrategy.DASHES);
P19.SetPaintingStrategy(PaintingStrategy.DASHES);
P20.SetPaintingStrategy(PaintingStrategy.DASHES);
P21.SetPaintingStrategy(PaintingStrategy.DASHES);
P22.SetPaintingStrategy(PaintingStrategy.DASHES);
P23.SetPaintingStrategy(PaintingStrategy.DASHES);
P24.SetPaintingStrategy(PaintingStrategy.DASHES);
P25.SetPaintingStrategy(PaintingStrategy.DASHES);
P26.SetPaintingStrategy(PaintingStrategy.DASHES);
P27.SetPaintingStrategy(PaintingStrategy.DASHES);
P28.SetPaintingStrategy(PaintingStrategy.DASHES);
P29.SetPaintingStrategy(PaintingStrategy.DASHES);
P30.SetPaintingStrategy(PaintingStrategy.DASHES);

P31.SetPaintingStrategy(PaintingStrategy.DASHES);
P32.SetPaintingStrategy(PaintingStrategy.DASHES);
P33.SetPaintingStrategy(PaintingStrategy.DASHES);
P34.SetPaintingStrategy(PaintingStrategy.DASHES);
P35.SetPaintingStrategy(PaintingStrategy.DASHES);
P36.SetPaintingStrategy(PaintingStrategy.DASHES);
P37.SetPaintingStrategy(PaintingStrategy.DASHES);
P38.SetPaintingStrategy(PaintingStrategy.DASHES);




rec c1_V_e = if IsNaN(close) and !IsNaN(close[1]) then c1_V[1] else c1_V_e[1];
rec c2_V_e = if IsNaN(close) and !IsNaN(close[1]) then c2_V[1] else c2_V_e[1];
rec c3_V_e = if IsNaN(close) and !IsNaN(close[1]) then c3_V[1] else c3_V_e[1];
rec c4_V_e = if IsNaN(close) and !IsNaN(close[1]) then c4_V[1] else c4_V_e[1];
rec c5_V_e = if IsNaN(close) and !IsNaN(close[1]) then c5_V[1] else c5_V_e[1];
rec c6_V_e = if IsNaN(close) and !IsNaN(close[1]) then c6_V[1] else c6_V_e[1];
rec c7_V_e = if IsNaN(close) and !IsNaN(close[1]) then c7_V[1] else c7_V_e[1];
rec c8_V_e = if IsNaN(close) and !IsNaN(close[1]) then c8_V[1] else c8_V_e[1];
rec c9_V_e = if IsNaN(close) and !IsNaN(close[1]) then c9_V[1] else c9_V_e[1];
rec c10_V_e = if IsNaN(close) and !IsNaN(close[1]) then c10_V[1] else c10_V_e[1];
rec c11_V_e = if IsNaN(close) and !IsNaN(close[1]) then c11_V[1] else c11_V_e[1];

rec c12_V_e = if IsNaN(close) and !IsNaN(close[1]) then c12_V[1] else c12_V_e[1];
rec c13_V_e = if IsNaN(close) and !IsNaN(close[1]) then c13_V[1] else c13_V_e[1];
rec c14_V_e = if IsNaN(close) and !IsNaN(close[1]) then c14_V[1] else c14_V_e[1];
rec c15_V_e = if IsNaN(close) and !IsNaN(close[1]) then c15_V[1] else c15_V_e[1];
rec c16_V_e = if IsNaN(close) and !IsNaN(close[1]) then c16_V[1] else c16_V_e[1];
rec c17_V_e = if IsNaN(close) and !IsNaN(close[1]) then c17_V[1] else c17_V_e[1];
rec c18_V_e = if IsNaN(close) and !IsNaN(close[1]) then c18_V[1] else c18_V_e[1];
rec c19_V_e = if IsNaN(close) and !IsNaN(close[1]) then c19_V[1] else c19_V_e[1];
rec c20_V_e = if IsNaN(close) and !IsNaN(close[1]) then c20_V[1] else c20_V_e[1];
rec c21_V_e = if IsNaN(close) and !IsNaN(close[1]) then c21_V[1] else c21_V_e[1];
rec c22_V_e = if IsNaN(close) and !IsNaN(close[1]) then c22_V[1] else c22_V_e[1];
rec c23_V_e = if IsNaN(close) and !IsNaN(close[1]) then c23_V[1] else c23_V_e[1];
rec c24_V_e = if IsNaN(close) and !IsNaN(close[1]) then c24_V[1] else c24_V_e[1];
rec c25_V_e = if IsNaN(close) and !IsNaN(close[1]) then c25_V[1] else c25_V_e[1];
rec c26_V_e = if IsNaN(close) and !IsNaN(close[1]) then c26_V[1] else c26_V_e[1];
rec c27_V_e = if IsNaN(close) and !IsNaN(close[1]) then c27_V[1] else c27_V_e[1];
rec c28_V_e = if IsNaN(close) and !IsNaN(close[1]) then c28_V[1] else c28_V_e[1];
rec c29_V_e = if IsNaN(close) and !IsNaN(close[1]) then c29_V[1] else c29_V_e[1];
rec c30_V_e = if IsNaN(close) and !IsNaN(close[1]) then c30_V[1] else c30_V_e[1];

rec c31_V_e = if IsNaN(close) and !IsNaN(close[1]) then c31_V[1] else c31_V_e[1];
rec c32_V_e = if IsNaN(close) and !IsNaN(close[1]) then c32_V[1] else c32_V_e[1];
rec c33_V_e = if IsNaN(close) and !IsNaN(close[1]) then c33_V[1] else c33_V_e[1];
rec c34_V_e = if IsNaN(close) and !IsNaN(close[1]) then c34_V[1] else c34_V_e[1];
rec c35_V_e = if IsNaN(close) and !IsNaN(close[1]) then c35_V[1] else c35_V_e[1];
rec c36_V_e = if IsNaN(close) and !IsNaN(close[1]) then c36_V[1] else c36_V_e[1];
rec c37_V_e = if IsNaN(close) and !IsNaN(close[1]) then c37_V[1] else c37_V_e[1];
rec c38_V_e = if IsNaN(close) and !IsNaN(close[1]) then c38_V[1] else c38_V_e[1];


rec p1_V_e = if IsNaN(close) and !IsNaN(close[1]) then p1_V[1] else p1_V_e[1];
rec p2_V_e = if IsNaN(close) and !IsNaN(close[1]) then p2_V[1] else p2_V_e[1];
rec p3_V_e = if IsNaN(close) and !IsNaN(close[1]) then p3_V[1] else p3_V_e[1];
rec p4_V_e = if IsNaN(close) and !IsNaN(close[1]) then p4_V[1] else p4_V_e[1];
rec p5_V_e = if IsNaN(close) and !IsNaN(close[1]) then p5_V[1] else p5_V_e[1];
rec p6_V_e = if IsNaN(close) and !IsNaN(close[1]) then p6_V[1] else p6_V_e[1];
rec p7_V_e = if IsNaN(close) and !IsNaN(close[1]) then p7_V[1] else p7_V_e[1];
rec p8_V_e = if IsNaN(close) and !IsNaN(close[1]) then p8_V[1] else p8_V_e[1];
rec p9_V_e = if IsNaN(close) and !IsNaN(close[1]) then p9_V[1] else p9_V_e[1];
rec p10_V_e = if IsNaN(close) and !IsNaN(close[1]) then p10_V[1] else p10_V_e[1];
rec p11_V_e = if IsNaN(close) and !IsNaN(close[1]) then p11_V[1] else p11_V_e[1];

rec p12_V_e = if IsNaN(close) and !IsNaN(close[1]) then p12_V[1] else p12_V_e[1];
rec p13_V_e = if IsNaN(close) and !IsNaN(close[1]) then p13_V[1] else p13_V_e[1];
rec p14_V_e = if IsNaN(close) and !IsNaN(close[1]) then p14_V[1] else p14_V_e[1];
rec p15_V_e = if IsNaN(close) and !IsNaN(close[1]) then p15_V[1] else p15_V_e[1];
rec p16_V_e = if IsNaN(close) and !IsNaN(close[1]) then p16_V[1] else p16_V_e[1];
rec p17_V_e = if IsNaN(close) and !IsNaN(close[1]) then p17_V[1] else p17_V_e[1];
rec p18_V_e = if IsNaN(close) and !IsNaN(close[1]) then p18_V[1] else p18_V_e[1];
rec p19_V_e = if IsNaN(close) and !IsNaN(close[1]) then p19_V[1] else p19_V_e[1];
rec p20_V_e = if IsNaN(close) and !IsNaN(close[1]) then p20_V[1] else p20_V_e[1];
rec p21_V_e = if IsNaN(close) and !IsNaN(close[1]) then p21_V[1] else p21_V_e[1];
rec p22_V_e = if IsNaN(close) and !IsNaN(close[1]) then p22_V[1] else p22_V_e[1];
rec p23_V_e = if IsNaN(close) and !IsNaN(close[1]) then p23_V[1] else p23_V_e[1];
rec p24_V_e = if IsNaN(close) and !IsNaN(close[1]) then p24_V[1] else p24_V_e[1];
rec p25_V_e = if IsNaN(close) and !IsNaN(close[1]) then p25_V[1] else p25_V_e[1];
rec p26_V_e = if IsNaN(close) and !IsNaN(close[1]) then p26_V[1] else p26_V_e[1];
rec p27_V_e = if IsNaN(close) and !IsNaN(close[1]) then p27_V[1] else p27_V_e[1];
rec p28_V_e = if IsNaN(close) and !IsNaN(close[1]) then p28_V[1] else p28_V_e[1];
rec p29_V_e = if IsNaN(close) and !IsNaN(close[1]) then p29_V[1] else p29_V_e[1];
rec p30_V_e = if IsNaN(close) and !IsNaN(close[1]) then p30_V[1] else p30_V_e[1];

rec p31_V_e = if IsNaN(close) and !IsNaN(close[1]) then p31_V[1] else p31_V_e[1];
rec p32_V_e = if IsNaN(close) and !IsNaN(close[1]) then p32_V[1] else p32_V_e[1];
rec p33_V_e = if IsNaN(close) and !IsNaN(close[1]) then p33_V[1] else p33_V_e[1];
rec p34_V_e = if IsNaN(close) and !IsNaN(close[1]) then p34_V[1] else p34_V_e[1];
rec p35_V_e = if IsNaN(close) and !IsNaN(close[1]) then p35_V[1] else p35_V_e[1];
rec p36_V_e = if IsNaN(close) and !IsNaN(close[1]) then p36_V[1] else p36_V_e[1];
rec p37_V_e = if IsNaN(close) and !IsNaN(close[1]) then p37_V[1] else p37_V_e[1];
rec p38_V_e = if IsNaN(close) and !IsNaN(close[1]) then p38_V[1] else p38_V_e[1];

AddChartBubble(c1_D == extBar, C1, concat("", c1_V_e), globalColor("Calls"), yes );

AddChartBubble(c2_D == extBar, C2, concat("", c2_V_e), globalColor("Calls"), yes );

AddChartBubble(c3_D == extBar, C3, concat("", c3_V_e), globalColor("Calls"), yes );

AddChartBubble(c4_D == extBar, C4, concat("", c4_V_e), globalColor("Calls"), yes );

AddChartBubble(c5_D == extBar, C5, concat("", c5_V_e), globalColor("Calls"), yes );

AddChartBubble(c6_D == extBar, C6, concat("", c6_V_e), globalColor("Calls"), yes );

AddChartBubble(c7_D == extBar, C7, concat("", c7_V_e), globalColor("Calls"), yes );

AddChartBubble(c8_D == extBar, C8, concat("", c8_V_e), globalColor("Calls"), yes );

AddChartBubble(c9_D == extBar, C9, concat("", c9_V_e), globalColor("Calls"), yes );

AddChartBubble(c10_D == extBar, C10, concat("", c10_V_e), globalColor("Calls"), yes );

AddChartBubble(c11_D == extBar, C11, concat("", c11_V_e), globalColor("Calls"), yes );



AddChartBubble(c12_D == extBar, C12, concat("", c12_V_e), globalColor("Calls"), yes );

AddChartBubble(c13_D == extBar, C13, concat("", c13_V_e), globalColor("Calls"), yes );

AddChartBubble(c14_D == extBar, C14, concat("", c14_V_e), globalColor("Calls"), yes );

AddChartBubble(c15_D == extBar, C15, concat("", c15_V_e), globalColor("Calls"), yes );

AddChartBubble(c16_D == extBar, C16, concat("", c16_V_e), globalColor("Calls"), yes );

AddChartBubble(c17_D == extBar, C17, concat("", c17_V_e), globalColor("Calls"), yes );

AddChartBubble(c18_D == extBar, C18, concat("", c18_V_e), globalColor("Calls"), yes );

AddChartBubble(c19_D == extBar, C19, concat("", c19_V_e), globalColor("Calls"), yes );

AddChartBubble(c20_D == extBar, C20, concat("", c20_V_e), globalColor("Calls"), yes );

AddChartBubble(c21_D == extBar, C21, concat("", c21_V_e), globalColor("Calls"), yes );

AddChartBubble(c22_D == extBar, C22, concat("", c22_V_e), globalColor("Calls"), yes );

AddChartBubble(c23_D == extBar, C23, concat("", c23_V_e), globalColor("Calls"), yes );

AddChartBubble(c24_D == extBar, C24, concat("", c24_V_e), globalColor("Calls"), yes );

AddChartBubble(c25_D == extBar, C25, concat("", c25_V_e), globalColor("Calls"), yes );

AddChartBubble(c26_D == extBar, C26, concat("", c26_V_e), globalColor("Calls"), yes );

AddChartBubble(c27_D == extBar, C27, concat("", c27_V_e), globalColor("Calls"), yes );

AddChartBubble(c28_D == extBar, C28, concat("", c28_V_e), globalColor("Calls"), yes );

AddChartBubble(c29_D == extBar, C29, concat("", c29_V_e), globalColor("Calls"), yes );

AddChartBubble(c30_D == extBar, C30, concat("", c30_V_e), globalColor("Calls"), yes );



AddChartBubble(c31_D == extBar, C31, concat("", c31_V_e), globalColor("Calls"), yes );

AddChartBubble(c32_D == extBar, C32, concat("", c32_V_e), globalColor("Calls"), yes );

AddChartBubble(c33_D == extBar, C33, concat("", c33_V_e), globalColor("Calls"), yes );

AddChartBubble(c34_D == extBar, C34, concat("", c34_V_e), globalColor("Calls"), yes );

AddChartBubble(c35_D == extBar, C35, concat("", c35_V_e), globalColor("Calls"), yes );

AddChartBubble(c36_D == extBar, C36, concat("", c36_V_e), globalColor("Calls"), yes );

AddChartBubble(c37_D == extBar, C37, concat("", c37_V_e), globalColor("Calls"), yes );

AddChartBubble(c38_D == extBar, C38, concat("", c38_V_e), globalColor("Calls"), yes );





AddChartBubble(p1_D == extBar, P1, concat("", p1_V_e), globalColor("Puts"), no );

AddChartBubble(p2_D == extBar, P2, concat("", p2_V_e), globalColor("Puts"), no );

AddChartBubble(p3_D == extBar, P3, concat("", p3_V_e), globalColor("Puts"), no );

AddChartBubble(p4_D == extBar, P4, concat("", p4_V_e), globalColor("Puts"), no );

AddChartBubble(p5_D == extBar, P5, concat("", p5_V_e), globalColor("Puts"), no );

AddChartBubble(p6_D == extBar, P6, concat("", p6_V_e), globalColor("Puts"), no );

AddChartBubble(p7_D == extBar, P7, concat("", p7_V_e), globalColor("Puts"), no );

AddChartBubble(p8_D == extBar, P8, concat("", p8_V_e), globalColor("Puts"), no );

AddChartBubble(p9_D == extBar, P9, concat("", p9_V_e), globalColor("Puts"), no );

AddChartBubble(p10_D == extBar, P10, concat("", p10_V_e), globalColor("Puts"), no );

AddChartBubble(p11_D == extBar, P11, concat("", p11_V_e), globalColor("Puts"), no );



AddChartBubble(p12_D == extBar, P12, concat("", p12_V_e), globalColor("Puts"), no );

AddChartBubble(p13_D == extBar, P13, concat("", p13_V_e), globalColor("Puts"), no );

AddChartBubble(p14_D == extBar, P14, concat("", p14_V_e), globalColor("Puts"), no );

AddChartBubble(p15_D == extBar, P15, concat("", p15_V_e), globalColor("Puts"), no );

AddChartBubble(p16_D == extBar, P16, concat("", p16_V_e), globalColor("Puts"), no );

AddChartBubble(p17_D == extBar, P17, concat("", p17_V_e), globalColor("Puts"), no );

AddChartBubble(p18_D == extBar, P18, concat("", p18_V_e), globalColor("Puts"), no );

AddChartBubble(p19_D == extBar, P19, concat("", p19_V_e), globalColor("Puts"), no );

AddChartBubble(p20_D == extBar, P20, concat("", P20_V_e), globalColor("Calls"), yes );

AddChartBubble(p21_D == extBar, P21, concat("", p21_V_e), globalColor("Calls"), yes );

AddChartBubble(p22_D == extBar, P22, concat("", p22_V_e), globalColor("Calls"), yes );

AddChartBubble(p23_D == extBar, P23, concat("", p23_V_e), globalColor("Calls"), yes );

AddChartBubble(p24_D == extBar, P24, concat("", p24_V_e), globalColor("Calls"), yes );

AddChartBubble(p25_D == extBar, P25, concat("", p25_V_e), globalColor("Calls"), yes );

AddChartBubble(p26_D == extBar, P26, concat("", p26_V_e), globalColor("Calls"), yes );

AddChartBubble(p27_D == extBar, P27, concat("", p27_V_e), globalColor("Calls"), yes );

AddChartBubble(p28_D == extBar, P28, concat("", p28_V_e), globalColor("Calls"), yes );

AddChartBubble(p29_D == extBar, P29, concat("", p29_V_e), globalColor("Calls"), yes );

AddChartBubble(p30_D == extBar, P30, concat("", p30_V_e), globalColor("Calls"), yes );



AddChartBubble(p31_D == extBar, P31, concat("", p31_V_e), globalColor("Calls"), yes );

AddChartBubble(p32_D == extBar, P32, concat("", p32_V_e), globalColor("Calls"), yes );

AddChartBubble(p33_D == extBar, P33, concat("", p33_V_e), globalColor("Calls"), yes );

AddChartBubble(p34_D == extBar, P34, concat("", p34_V_e), globalColor("Calls"), yes );

AddChartBubble(p35_D == extBar, P35, concat("", p35_V_e), globalColor("Calls"), yes );

AddChartBubble(p36_D == extBar, P36, concat("", p36_V_e), globalColor("Calls"), yes );

AddChartBubble(p37_D == extBar, P37, concat("", p37_V_e), globalColor("Calls"), yes );

AddChartBubble(p38_D == extBar, P38, concat("", p38_V_e), globalColor("Calls"), yes );




C1.HideBubble();
C2.HideBubble();
C3.HideBubble();
C4.HideBubble();
C5.HideBubble();
C6.HideBubble();
C7.HideBubble();
C8.HideBubble();
C9.HideBubble();
C10.HideBubble();
C11.HideBubble();

C12.HideBubble();
C13.HideBubble();
C14.HideBubble();
C15.HideBubble();
C16.HideBubble();
C17.HideBubble();
C18.HideBubble();
C19.HideBubble();
C20.HideBubble();
C21.HideBubble();
C22.HideBubble();
C23.HideBubble();
C24.HideBubble();
C25.HideBubble();
C26.HideBubble();
C27.HideBubble();
C28.HideBubble();
C29.HideBubble();
C30.HideBubble();

C31.HideBubble();
C32.HideBubble();
C33.HideBubble();
C34.HideBubble();
C35.HideBubble();
C36.HideBubble();
C37.HideBubble();
C38.HideBubble();

P1.HideBubble();
P2.HideBubble();
P3.HideBubble();
P4.HideBubble();
P5.HideBubble();
P6.HideBubble();
P7.HideBubble();
P8.HideBubble();
P9.HideBubble();
P10.HideBubble();
P11.HideBubble();

P12.HideBubble();
P13.HideBubble();
P14.HideBubble();
P15.HideBubble();
P16.HideBubble();
P17.HideBubble();
P18.HideBubble();
P19.HideBubble();
P20.HideBubble();
P21.HideBubble();
P22.HideBubble();
P23.HideBubble();
P24.HideBubble();
P25.HideBubble();
P26.HideBubble();
P27.HideBubble();
P28.HideBubble();
P29.HideBubble();
P30.HideBubble();

P31.HideBubble();
P32.HideBubble();
P33.HideBubble();
P34.HideBubble();
P35.HideBubble();
P36.HideBubble();
P37.HideBubble();
P38.HideBubble();

C1.HideTitle();
C2.HideTitle();
C3.HideTitle();
C4.HideTitle();
C5.HideTitle();
C6.HideTitle();
C7.HideTitle();
C8.HideTitle();
C9.HideTitle();
C10.HideTitle();
C11.HideTitle();

C12.HideTitle();
C13.HideTitle();
C14.HideTitle();
C15.HideTitle();
C16.HideTitle();
C17.HideTitle();
C18.HideTitle();
C19.HideTitle();
C20.HideTitle();
C21.HideTitle();
C22.HideTitle();
C23.HideTitle();
C24.HideTitle();
C25.HideTitle();
C26.HideTitle();
C27.HideTitle();
C28.HideTitle();
C29.HideTitle();
C30.HideTitle();

C31.HideTitle();
C32.HideTitle();
C33.HideTitle();
C34.HideTitle();
C35.HideTitle();
C36.HideTitle();
C37.HideTitle();
C38.HideTitle();

P1.HideTitle();
P2.HideTitle();
P3.HideTitle();
P4.HideTitle();
P5.HideTitle();
P6.HideTitle();
P7.HideTitle();
P8.HideTitle();
P9.HideTitle();
P10.HideTitle();
P11.HideTitle();

P12.HideTitle();
P13.HideTitle();
P14.HideTitle();
P15.HideTitle();
P16.HideTitle();
P17.HideTitle();
P18.HideTitle();
P19.HideTitle();
P20.HideTitle();
P21.HideTitle();
P22.HideTitle();
P23.HideTitle();
P24.HideTitle();
P25.HideTitle();
P26.HideTitle();
P27.HideTitle();
P28.HideTitle();
P29.HideTitle();
P30.HideTitle();

P31.HideTitle();
P32.HideTitle();
P33.HideTitle();
P34.HideTitle();
P35.HideTitle();
P36.HideTitle();
P37.HideTitle();
P38.HideTitle();
How do you turn off the bubbles? Thanks.
 
so im really interested in how to get put/call options strike oi to show up like volume profile and the lower heat map similar to this example from @melarue on twitter. I have no idea how to even get started on something like this. Any hints or expert coders out there willing to reverse engineer this?

Ideally, the heat map portion could be shown on the upper chart as well, able to be mapped to strikes on today and future expirations as a dynamic color grid for daily, weekly, monthly options. Options codes should auto-generate.

this could be tweaked to show gamma levels as well -- lots of potential.

anyone up to the challenge? :unsure:
I'd played with this, the best I can think of is use dataprofile and pass the Volume off the options into the dataset. Won't work on SPX though but SPY or /ES should be fine.
 
How do you turn off the bubbles? Thanks.
A fantastic script, thank you.

Having a few issues as well:

  • the bubbles do not turn off. Is there a magic setting or is this a current error in the script?
  • what is the best way to only show the 5 highest OI lines being displayed? Turning off the higher number plots?

Thanks,
Fitz.
 
Last edited:
Awesome work in putting this script together, thank you for sharing (y)

However it is extremely memory intensive and takes time to load to a point where sometimes it simply won't work or thinkorswim becomes very slow (RAM is not an issue as I got more than enough).

Is there a better way so we can limit how many data points it looks (e.g. top 3 put call based on OI & volume on both sides ITM/OTM, or immediate next 3 strikes in either direction, etc) or come up with optimize parameters so it works relatively quickly without slowing down the platform!

Following up to the above, would be a big value add to help with resources and lag when running during the trading day.
 
still trying to figure that one out, my guess would be more blue = bullish, more red= bearish.
As it stands, this last year I discovered bullish vs. bearish depends on whether the contracts are purchased in-the-money or out-the-money.
Foward volatilit is measured off the ATM puts/calls.

If itm Call + otm Put then volatilty increases on the Market Maker's surface and they adjust price down. If otm Call + itm Put lowers volatility and MM adjust price up.

0DTE is the most potent for intraday trading, period.
But I can't find any code like these indicators that also include 0DTE and/or include whether said volume is itm or otm. IT's important. And yet nobody does this in Thinkorswim. I am looking for some collaborators.
 
As it stands, this last year I discovered bullish vs. bearish depends on whether the contracts are purchased in-the-money or out-the-money.
Foward volatilit is measured off the ATM puts/calls.

If itm Call + otm Put then volatilty increases on the Market Maker's surface and they adjust price down. If otm Call + itm Put lowers volatility and MM adjust price up.

0DTE is the most potent for intraday trading, period.
But I can't find any code like these indicators that also include 0DTE and/or include whether said volume is itm or otm. IT's important. And yet nobody does this in Thinkorswim. I am looking for some collaborators.
Please explain this :
Foward volatilit is measured off the ATM puts/calls.

If itm Call + otm Put then volatilty increases on the Market Maker's surface and they adjust price down. If otm Call + itm Put lowers volatility and MM adjust price up.

0DTE is the most potent for intraday trading, period.

I might be able to give it a try
 
I got an idea from the bulletin board here and succeeded in plotting Spxw's option volume on the "/ES" chart during the rth session. If I make the code public here, talented people will know how to display it in the night market after the market closes, which I could not solve, and how to use "Nq". It would be nice to figure out how to display the QQQ option on the chart, and finally how to display Odte, 1dte.2dte on the right side of the chart according to dte expiration.
Code:
# spx 5min chart

input show_Label = yes;
input optionSeriesPrefix = ".SPXW24";
input MMDD = "0118";

AddLabel(show_Label, Concat(optionSeriesPrefix+mmdd, ""), Color.Yellow);
#AddLabel(show_Label, Concat("Strike Spacing: ", strikeSpacing), Color.WHITE);

DefineGlobalColor("ItmCall", Color.LIGHT_GREEN);
DefineGlobalColor("ItmPut", Color.LIGHT_ORANGE);
DefineGlobalColor("OtmCall", Color.Gray);
DefineGlobalColor("OtmPut", Color.Gray);
DefineGlobalColor("OI", Color.Gray);
DefineGlobalColor("Calls", Color.LIGHT_GREEN);
def strikeSpacing = 5;
def barWeight = 3;

# Number of bars to right of current bar for display
# Should be a positiveVolumeIndex number

input displayOffset = 60;
input agg = AggregationPeriod.DAY ;

# Number of bars of right space minus 5
input barLength = 120;

# /ES와SPX가격차이
def Es_SPX_Diff = close("/ES",period = agg) - close("SPX",period = agg);

#def Es_SPX_Diff = 32;
#def Es_SPX_Diff;
#if SecondsFromTime(1600) == 0 then {
#    Es_SPX_Diff = close("/ES") - close("SPX");
#} else {
#    Es_SPX_Diff = Es_SPX_Diff[1];
#}
AddLabel(yes, "ES-SPX Diff: " + Es_SPX_Diff,color.white);
#------------------
#def SPXP =  close("SPX",period = agg);
#AddLabel(yes, "SPX : "+ SPXP,color.white);
#------------------------------

#spx의 strikeprice
def strikeprice = round( (close("/ES",period = agg)-Es_SPX_Diff) / 5, 0) * 5;
AddLabel(show_Label, "strike : "+ strikeprice, Color.WHITE);

#---------------------------------------------------------------------------------------------------------------

#----------------------------------------------------------------------------------------------------------------
def AtmCall_Vol = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice( strikeprice ),agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice( strikeprice ),agg) else 0;
def AtmCall_OI = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice( strikeprice ),agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice( strikeprice ),agg) else 0;
def AtmPut_Vol = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice( strikeprice ),agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice( strikeprice ),agg) else 0;
def AtmPut_OI = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice( strikeprice ),agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice( strikeprice ),agg) else 0;

AddLabel(show_Label, Concat("AtmCallVol : ", AtmCall_Vol), Color.LIGHT_GREEN);
AddLabel(show_Label, Concat("AtmPutlVol : ", AtmPut_Vol), Color.LIGHT_ORANGE);
#----------------------------------------------------------------------------------------------------------------
#def ItmCall_Vol
def ItmCall_Vol01 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 1), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 1), agg) else 0;
def ItmCall_Vol02 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 2), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 2), agg) else 0;
def ItmCall_Vol03 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 3), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 3), agg) else 0;
def ItmCall_Vol04 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 4), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 4), agg) else 0;
def ItmCall_Vol05 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 5), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 5), agg) else 0;
def ItmCall_Vol06 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 6), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 6), agg) else 0;
def ItmCall_Vol07 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 7), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 7), agg) else 0;
def ItmCall_Vol08 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 8), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 8), agg) else 0;
def ItmCall_Vol09 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 9), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 9), agg) else 0;
def ItmCall_Vol10 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 10), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 10), agg) else 0;

def ItmCall_OI01 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 1), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 1), agg) else 0;
def ItmCall_OI02 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 2), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 2), agg) else 0;
def ItmCall_OI03 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 3), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 3), agg) else 0;
def ItmCall_OI04 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 4), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 4), agg) else 0;
def ItmCall_OI05 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 5), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 5), agg) else 0;
def ItmCall_OI06 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 6), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 6), agg) else 0;
def ItmCall_OI07 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 7), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 7), agg) else 0;
def ItmCall_OI08 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 8), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 8), agg) else 0;
def ItmCall_OI09 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 9), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 9), agg) else 0;
def ItmCall_OI10 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 10), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 10), agg) else 0;



#AddLabel(yes, "ItmCall_Vol01: " + ItmCall_Vol01);
#AddLabel(yes, "ItmCall_Vol02: " + ItmCall_Vol02);
#AddLabel(yes, "ItmCall_Vol03: " + ItmCall_Vol03);
#AddLabel(yes, "ItmCall_Vol04: " + ItmCall_Vol04);
#AddLabel(yes, "ItmCall_Vol05: " + ItmCall_Vol05);
#AddLabel(yes, "ItmCall_Vol06: " + ItmCall_Vol06);
#AddLabel(yes, "ItmCall_Vol07: " + ItmCall_Vol07);
#AddLabel(yes, "ItmCall_Vol08: " + ItmCall_Vol08);
#AddLabel(yes, "ItmCall_Vol09: " + ItmCall_Vol09);
#AddLabel(yes, "ItmCall_Vol10: " + ItmCall_Vol10);

#----------------------------------------------------------------------------------------------------------------------------------------

def OtmPut_Vol01 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 1), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 1), agg) else 0;
def OtmPut_Vol02 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 2), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 2), agg) else 0;
def OtmPut_Vol03 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 3), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 3), agg) else 0;
def OtmPut_Vol04 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 4), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 4), agg) else 0;
def OtmPut_Vol05 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 5), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 5), agg) else 0;
def OtmPut_Vol06 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 6), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 6), agg) else 0;
def OtmPut_Vol07 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 7), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 7), agg) else 0;
def OtmPut_Vol08 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 8), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 8), agg) else 0;
def OtmPut_Vol09 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 9), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 9), agg) else 0;
def OtmPut_Vol10 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 10), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 10), agg) else 0;

def OtmPut_OI01 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 1), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 1), agg) else 0;
def OtmPut_OI02 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 2), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 2), agg) else 0;
def OtmPut_OI03 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 3), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 3), agg) else 0;
def OtmPut_OI04 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 4), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 4), agg) else 0;
def OtmPut_OI05 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 5), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 5), agg) else 0;
def OtmPut_OI06 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 6), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 6), agg) else 0;
def OtmPut_OI07 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 7), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 7), agg) else 0;
def OtmPut_OI08 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 8), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 8), agg) else 0;
def OtmPut_OI09 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 9), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 9), agg) else 0;
def OtmPut_OI10 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 10), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 10), agg) else 0;

#-------------------------------------------------------------------------------------------------------------------------------------------
def OtmCall_Vol01 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 1), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 1), agg) else 0;
def OtmCall_Vol02 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 2), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 2), agg) else 0;
def OtmCall_Vol03 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 3), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 3), agg) else 0;
def OtmCall_Vol04 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 4), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 4), agg) else 0;
def OtmCall_Vol05 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 5), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 5), agg) else 0;
def OtmCall_Vol06 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 6), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 6), agg) else 0;
def OtmCall_Vol07 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 7), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 7), agg) else 0;
def OtmCall_Vol08 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 8), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 8), agg) else 0;
def OtmCall_Vol09 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 9), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 9), agg) else 0;
def OtmCall_Vol10 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 10), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 10), agg) else 0;

def OtmCall_OI01 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 1), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 1), agg) else 0;
def OtmCall_OI02 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 2), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 2), agg) else 0;
def OtmCall_OI03 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 3), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 3), agg) else 0;
def OtmCall_OI04 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 4), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 4), agg) else 0;
def OtmCall_OI05 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 5), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 5), agg) else 0;
def OtmCall_OI06 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 6), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 6), agg) else 0;
def OtmCall_OI07 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 7), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 7), agg) else 0;
def OtmCall_OI08 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 8), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 8), agg) else 0;
def OtmCall_OI09 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 9), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 9), agg) else 0;
def OtmCall_OI10 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 10), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 10), agg) else 0;

#--------------------------------------------------------------------------------------------------------------------------------------------------


def ItmPut_Vol01 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 1), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 1), agg) else 0;
def ItmPut_Vol02 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 2), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 2), agg) else 0;
def ItmPut_Vol03 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 3), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 3), agg) else 0;
def ItmPut_Vol04 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 4), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 4), agg) else 0;
def ItmPut_Vol05 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 5), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 5), agg) else 0;
def ItmPut_Vol06 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 6), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 6), agg) else 0;
def ItmPut_Vol07 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 7), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 7), agg) else 0;
def ItmPut_Vol08 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 8), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 8), agg) else 0;
def ItmPut_Vol09 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 9), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 9), agg) else 0;
def ItmPut_Vol10 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 10), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 10), agg) else 0;

def ItmPut_OI01 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 1), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 1), agg) else 0;
def ItmPut_OI02 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 2), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 2), agg) else 0;
def ItmPut_OI03 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 3), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 3), agg) else 0;
def ItmPut_OI04 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 4), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 4), agg) else 0;
def ItmPut_OI05 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 5), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 5), agg) else 0;
def ItmPut_OI06 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 6), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 6), agg) else 0;
def ItmPut_OI07 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 7), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 7), agg) else 0;
def ItmPut_OI08 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 8), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 8), agg) else 0;
def ItmPut_OI09 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 9), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 9), agg) else 0;
def ItmPut_OI10 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 10), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 10), agg) else 0;

#-----------------------------------------------------------------------------------------------------------------------------------------------------

def ItmCall_MaxVol = Max(AtmCall_Vol, Max(ItmCall_Vol01, Max(ItmCall_Vol02, Max(ItmCall_Vol03, Max(ItmCall_Vol04, Max(ItmCall_Vol05, Max(ItmCall_Vol06, Max(ItmCall_Vol07, Max(ItmCall_Vol08, Max(ItmCall_Vol09, ItmCall_Vol10))))))))));

def ItmCall_MaxOI = Max(AtmCall_OI, Max(ItmCall_OI01, Max(ItmCall_OI02, Max(ItmCall_OI03, Max(ItmCall_OI04, Max(ItmCall_OI05, Max(ItmCall_OI06, Max(ItmCall_OI07, Max(ItmCall_OI08, Max(ItmCall_OI09, ItmCall_OI10))))))))));

def ItmPut_MaxVol = Max(AtmPut_Vol, Max(ItmPut_Vol01, Max(ItmPut_Vol02, Max(ItmPut_Vol03, Max(ItmPut_Vol04, Max(ItmPut_Vol05, Max(ItmPut_Vol06, Max(ItmPut_Vol07, Max(ItmPut_Vol08, Max(ItmPut_Vol09, ItmPut_Vol10))))))))));

def ItmPut_MaxOI = Max(AtmPut_OI, Max(ItmPut_OI01, Max(ItmPut_OI02, Max(ItmPut_OI03, Max(ItmPut_OI04, Max(ItmPut_OI05, Max(ItmPut_OI06, Max(ItmPut_OI07, Max(ItmPut_OI08, Max(ItmPut_OI09, ItmPut_OI10))))))))));

def OtmCall_MaxVol =  Max(OtmCall_Vol01, Max(OtmCall_Vol02, Max(OtmCall_Vol03, Max(OtmCall_Vol04, Max(OtmCall_Vol05, Max(OtmCall_Vol06, Max(OtmCall_Vol07, Max(OtmCall_Vol08, Max(OtmCall_Vol09, OtmCall_Vol10)))))))));

def OtmCall_MaxOI = Max(OtmCall_OI01, Max(OtmCall_OI02, Max(OtmCall_OI03, Max(OtmCall_OI04, Max(OtmCall_OI05, Max(OtmCall_OI06, Max(OtmCall_OI07, Max(OtmCall_OI08, Max(OtmCall_OI09, OtmCall_OI10)))))))));

def OtmPut_MaxVol = Max(OtmPut_Vol01, Max(OtmPut_Vol02, Max(OtmPut_Vol03, Max(OtmPut_Vol04, Max(OtmPut_Vol05, Max(OtmPut_Vol06, Max(OtmPut_Vol07, Max(OtmPut_Vol08, Max(OtmPut_Vol09, OtmPut_Vol10)))))))));

def OtmPut_MaxOI =  Max(OtmPut_OI01, Max(OtmPut_OI02, Max(OtmPut_OI03, Max(OtmPut_OI04, Max(OtmPut_OI05, Max(OtmPut_OI06, Max(OtmPut_OI07, Max(OtmPut_OI08, Max(OtmPut_OI09, OtmPut_OI10)))))))));

def MaxVol = Max(ItmCall_MaxVol,Max(ItmCall_MaxOI,Max(ItmPut_MaxVol,Max(ItmPut_MaxOI,Max(OtmCall_MaxVol,Max(OtmCall_MaxOI,Max(OtmPut_MaxVol,OtmPut_MaxOI)))))));
AddLabel(yes, "MaxVol :" + MaxVol);


#----------------------------------------------------------------------------------------------------------------

#--------------------------------------------------------------------------------------------------------------------------------------------------

def barOffset = if !IsNaN(close) then strikeSpacing / 10.0 else barOffset[1];          #rec -- def
def c_extBar = if IsNaN(close[displayOffset+barLength/2]) then c_extBar[1] + 1 else 0;
rec extBar = if IsNaN(close[displayOffset]) then extBar[1] + 1 else 0;

#-----------------------------------------------------------------------------------------------------------------------------------------------------------

#----------------------------------------------------------------------------------------------------------------
rec AtmCall_Volrec = if IsNaN(close) then AtmCall_Volrec[1] else Ceil((AtmCall_Vol / MaxVol) * barLength/2);    # barLength --- barLength/2
plot AtmCall_VolP = if AtmCall_Volrec >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset else Double.NaN;
AtmCall_VolP.SetDefaultColor(Color.white );
AtmCall_VolP.SetLineWeight(barWeight);
AtmCall_VolP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#AtmCall_VOlP.HideBubble();

rec AtmPut_Volrec = if IsNaN(close) then AtmPut_Volrec[1] else Ceil((AtmPut_Vol / MaxVol) * barLength/2);    # barLength --- barLength/2
plot AtmPut_VolP = if AtmPut_Volrec >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff - barOffset else Double.NaN;
AtmPut_VolP.SetDefaultColor(Color.white );
AtmPut_VolP.SetLineWeight(barWeight);
AtmPut_VolP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
AtmPut_VOlP.HideBubble();
#-----------------------------------------------------------------------------------------------------------------------
# ItmCall---------------------------------------------------------------------------------------------------------------

rec ItmCall_VOlrec01 = if IsNaN(close) then ItmCall_VOlrec01[1] else Ceil((ItmCall_VOl01 / MaxVol) * barLength/2);
plot ItmCall_VOlP01 = if ItmCall_VOlrec01 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*01 else Double.NaN;
ItmCall_VOlP01.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP01.SetLineWeight(barWeight);
ItmCall_VOlP01.HideBubble();
# 2
rec ItmCall_VOlrec02 = if IsNaN(close) then ItmCall_VOlrec02[1] else Ceil((ItmCall_VOl02 / MaxVol) * barLength/2);
plot ItmCall_VOlP02 = if ItmCall_VOlrec02 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*02 else Double.NaN;
ItmCall_VOlP02.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP02.SetLineWeight(barWeight);
ItmCall_VOlP02.HideBubble();
# 3
rec ItmCall_VOlrec03 = if IsNaN(close) then ItmCall_VOlrec03[1] else Ceil((ItmCall_VOl03 / MaxVol) * barLength/2);
plot ItmCall_VOlP03 = if ItmCall_VOlrec03 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*03 else Double.NaN;
ItmCall_VOlP03.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP03.SetLineWeight(barWeight);
ItmCall_VOlP03.HideBubble();

# 4
rec ItmCall_VOlrec04 = if IsNaN(close) then ItmCall_VOlrec04[1] else Ceil((ItmCall_VOl04 / MaxVol) * barLength/2);
plot ItmCall_VOlP04 = if ItmCall_VOlrec04 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*04 else Double.NaN;
ItmCall_VOlP04.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP04.SetLineWeight(barWeight);
ItmCall_VOlP04.HideBubble();

# 5
rec ItmCall_VOlrec05 = if IsNaN(close) then ItmCall_VOlrec05[1] else Ceil((ItmCall_VOl05 / MaxVol) * barLength/2);
plot ItmCall_VOlP05 = if ItmCall_VOlrec05 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*05 else Double.NaN;
ItmCall_VOlP05.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP05.SetLineWeight(barWeight);
ItmCall_VOlP05.HideBubble();

# 6
rec ItmCall_VOlrec06 = if IsNaN(close) then ItmCall_VOlrec06[1] else Ceil((ItmCall_VOl06 / MaxVol) * barLength/2);
plot ItmCall_VOlP06 = if ItmCall_VOlrec06 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*06 else Double.NaN;
ItmCall_VOlP06.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP06.SetLineWeight(barWeight);
ItmCall_VOlP06.HideBubble();

# 7
rec ItmCall_VOlrec07 = if IsNaN(close) then ItmCall_VOlrec07[1] else Ceil((ItmCall_VOl07 / MaxVol) * barLength/2);
plot ItmCall_VOlP07 = if ItmCall_VOlrec07 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*07 else Double.NaN;
ItmCall_VOlP07.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP07.SetLineWeight(barWeight);
ItmCall_VOlP07.HideBubble();
# 8번
rec ItmCall_VOlrec08 = if IsNaN(close) then ItmCall_VOlrec08[1] else Ceil((ItmCall_VOl08 / MaxVol) * barLength/2);
plot ItmCall_VOlP08 = if ItmCall_VOlrec08 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*08 else Double.NaN;
ItmCall_VOlP08.SetDefaultColor(GlobalColor("Calls"));
ItmCall_VOlP08.SetLineWeight(barWeight);
ItmCall_VOlP08.HideBubble();

# 9
rec ItmCall_VOlrec09 = if IsNaN(close) then ItmCall_VOlrec09[1] else Ceil((ItmCall_VOl09 / MaxVol) * barLength/2);
plot ItmCall_VOlP09 = if ItmCall_VOlrec09 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*09 else Double.NaN;
ItmCall_VOlP09.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP09.SetLineWeight(barWeight);
ItmCall_VOlP09.HideBubble();

# 10
rec ItmCall_VOlrec10 = if IsNaN(close) then ItmCall_VOlrec10[1] else Ceil((ItmCall_VOl10 / MaxVol) * barLength/2);
plot ItmCall_VOlP10 = if ItmCall_VOlrec10 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*10 else Double.NaN;
ItmCall_VOlP10.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP10.SetLineWeight(barWeight);
ItmCall_VOlP10.HideBubble();

#OtmCall   ------------------------------------------------------------------------------------------------------------------------------------------------
# 1
rec OtmCall_VOlrec01 = if IsNaN(close) then OtmCall_VOlrec01[1] else Ceil((OtmCall_VOl01 / MaxVol) * barLength/2);
plot OtmCall_VOlP01 = if OtmCall_VOlrec01 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*01 else Double.NaN;
OtmCall_VOlP01.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP01.SetLineWeight(barWeight);
OtmCall_VOlP01.HideBubble();
# 2
rec OtmCall_VOlrec02 = if IsNaN(close) then OtmCall_VOlrec02[1] else Ceil((OtmCall_VOl02 / MaxVol) * barLength/2);
plot OtmCall_VOlP02 = if OtmCall_VOlrec02 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*02 else Double.NaN;
OtmCall_VOlP02.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP02.SetLineWeight(barWeight);
OtmCall_VOlP02.HideBubble();
# 3
rec OtmCall_VOlrec03 = if IsNaN(close) then OtmCall_VOlrec03[1] else Ceil((OtmCall_VOl03 / MaxVol) * barLength/2);
plot OtmCall_VOlP03 = if OtmCall_VOlrec03 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*03 else Double.NaN;
OtmCall_VOlP03.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP03.SetLineWeight(barWeight);
OtmCall_VOlP03.HideBubble();

# 4
rec OtmCall_VOlrec04 = if IsNaN(close) then OtmCall_VOlrec04[1] else Ceil((OtmCall_VOl04 / MaxVol) * barLength/2);
plot OtmCall_VOlP04 = if OtmCall_VOlrec04 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*04 else Double.NaN;
OtmCall_VOlP04.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP04.SetLineWeight(barWeight);
OtmCall_VOlP04.HideBubble();
# 5
rec OtmCall_VOlrec05 = if IsNaN(close) then OtmCall_VOlrec05[1] else Ceil((OtmCall_VOl05 / MaxVol) * barLength/2);
plot OtmCall_VOlP05 = if OtmCall_VOlrec05 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*05 else Double.NaN;
OtmCall_VOlP05.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP05.SetLineWeight(barWeight);
OtmCall_VOlP05.HideBubble();
# 6
rec OtmCall_VOlrec06 = if IsNaN(close) then OtmCall_VOlrec06[1] else Ceil((OtmCall_VOl06 / MaxVol) * barLength/2);
plot OtmCall_VOlP06 = if OtmCall_VOlrec06 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*06 else Double.NaN;
OtmCall_VOlP06.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP06.SetLineWeight(barWeight);
OtmCall_VOlP06.HideBubble();
# 7
rec OtmCall_VOlrec07 = if IsNaN(close) then OtmCall_VOlrec07[1] else Ceil((OtmCall_VOl07 / MaxVol) * barLength/2);
plot OtmCall_VOlP07 = if OtmCall_VOlrec07 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*07 else Double.NaN;
OtmCall_VOlP07.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP07.SetLineWeight(barWeight);
OtmCall_VOlP07.HideBubble();
# 8
rec OtmCall_VOlrec08 = if IsNaN(close) then OtmCall_VOlrec08[1] else Ceil((OtmCall_VOl08 / MaxVol) * barLength/2);
plot OtmCall_VOlP08 = if OtmCall_VOlrec08 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*08 else Double.NaN;
OtmCall_VOlP08.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP08.SetLineWeight(barWeight);
OtmCall_VOlP08.HideBubble();
# 9
rec OtmCall_VOlrec09 = if IsNaN(close) then OtmCall_VOlrec09[1] else Ceil((OtmCall_VOl09 / MaxVol) * barLength/2);
plot OtmCall_VOlP09 = if OtmCall_VOlrec09 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*09 else Double.NaN;
OtmCall_VOlP09.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP09.SetLineWeight(barWeight);
OtmCall_VOlP09.HideBubble();
# 10
rec OtmCall_VOlrec10 = if IsNaN(close) then OtmCall_VOlrec10[1] else Ceil((OtmCall_VOl10 / MaxVol) * barLength/2);
plot OtmCall_VOlP10 = if OtmCall_VOlrec10 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*10 else Double.NaN;
OtmCall_VOlP10.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP10.SetLineWeight(barWeight);
OtmCall_VOlP10.HideBubble();

#OtmPut---------------------------------------------------------------------------------------------------------------------------------

rec OtmPut_VOlrec01 = if IsNaN(close) then OtmPut_VOlrec01[1] else Ceil((OtmPut_VOl01 / MaxVol) * barLength/2);
plot OtmPut_VOlP01 = if OtmPut_VOlrec01 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*01 else Double.NaN;
OtmPut_VOlP01.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP01.SetLineWeight(barWeight);
OtmPut_VOlP01.HideBubble();

# 2
rec OtmPut_VOlrec02 = if IsNaN(close) then OtmPut_VOlrec02[1] else Ceil((OtmPut_VOl02 / MaxVol) * barLength/2);
plot OtmPut_VOlP02 = if OtmPut_VOlrec02 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*02 else Double.NaN;
OtmPut_VOlP02.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP02.SetLineWeight(barWeight);
OtmPut_VOlP02.HideBubble();
# 3
rec OtmPut_VOlrec03 = if IsNaN(close) then OtmPut_VOlrec03[1] else Ceil((OtmPut_VOl03 / MaxVol) * barLength/2);
plot OtmPut_VOlP03 = if OtmPut_VOlrec03 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*03 else Double.NaN;
OtmPut_VOlP03.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP03.SetLineWeight(barWeight);
OtmPut_VOlP03.HideBubble();

# 4
rec OtmPut_VOlrec04 = if IsNaN(close) then OtmPut_VOlrec04[1] else Ceil((OtmPut_VOl04 / MaxVol) * barLength/2);
plot OtmPut_VOlP04 = if OtmPut_VOlrec04 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*04 else Double.NaN;
OtmPut_VOlP04.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP04.SetLineWeight(barWeight);
OtmPut_VOlP04.HideBubble();
# 5
rec OtmPut_VOlrec05 = if IsNaN(close) then OtmPut_VOlrec05[1] else Ceil((OtmPut_VOl05 / MaxVol) * barLength/2);
plot OtmPut_VOlP05 = if OtmPut_VOlrec05 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*05 else Double.NaN;
OtmPut_VOlP05.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP05.SetLineWeight(barWeight);
OtmPut_VOlP05.HideBubble();
# 6
rec OtmPut_VOlrec06 = if IsNaN(close) then OtmPut_VOlrec06[1] else Ceil((OtmPut_VOl06 / MaxVol) * barLength/2);
plot OtmPut_VOlP06 = if OtmPut_VOlrec06 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*06 else Double.NaN;
OtmPut_VOlP06.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP06.SetLineWeight(barWeight);
OtmPut_VOlP06.HideBubble();
# 7
rec OtmPut_VOlrec07 = if IsNaN(close) then OtmPut_VOlrec07[1] else Ceil((OtmPut_VOl07 / MaxVol) * barLength/2);
plot OtmPut_VOlP07 = if OtmPut_VOlrec07 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*07 else Double.NaN;
OtmPut_VOlP07.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP07.SetLineWeight(barWeight);
OtmPut_VOlP07.HideBubble();
# 8
rec OtmPut_VOlrec08 = if IsNaN(close) then OtmPut_VOlrec08[1] else Ceil((OtmPut_VOl08 / MaxVol) * barLength/2);
plot OtmPut_VOlP08 = if OtmPut_VOlrec08 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*08 else Double.NaN;
OtmPut_VOlP08.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP08.SetLineWeight(barWeight);
OtmPut_VOlP08.HideBubble();
# 9
rec OtmPut_VOlrec09 = if IsNaN(close) then OtmPut_VOlrec09[1] else Ceil((OtmPut_VOl09 / MaxVol) * barLength/2);
plot OtmPut_VOlP09 = if OtmPut_VOlrec09 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*09 else Double.NaN;
OtmPut_VOlP09.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP09.SetLineWeight(barWeight);
OtmPut_VOlP09.HideBubble();
# 10
rec OtmPut_VOlrec10 = if IsNaN(close) then OtmPut_VOlrec10[1] else Ceil((OtmPut_VOl10 / MaxVol) * barLength/2);
plot OtmPut_VOlP10 = if OtmPut_VOlrec10 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*10 else Double.NaN;
OtmPut_VOlP10.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP10.SetLineWeight(barWeight);
OtmPut_VOlP10.HideBubble();



#----------------------------------------------------------------------------------------------------------------
# 1
rec ItmPut_VOlrec01 = if IsNaN(close) then ItmPut_VOlrec01[1] else Ceil((ItmPut_VOl01 / MaxVol) * barLength/2);
plot ItmPut_VOlP01 = if ItmPut_VOlrec01 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*01 else Double.NaN;
ItmPut_VOlP01.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP01.SetLineWeight(barWeight);
ItmPut_VOlP01.HideBubble();
# 2
rec ItmPut_VOlrec02 = if IsNaN(close) then ItmPut_VOlrec02[1] else Ceil((ItmPut_VOl02 / MaxVol) * barLength/2);
plot ItmPut_VOlP02 = if ItmPut_VOlrec02 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*02 else Double.NaN;
ItmPut_VOlP02.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP02.SetLineWeight(barWeight);
ItmPut_VOlP02.HideBubble();
# 3
rec ItmPut_VOlrec03 = if IsNaN(close) then ItmPut_VOlrec03[1] else Ceil((ItmPut_VOl03 / MaxVol) * barLength/2);
plot ItmPut_VOlP03 = if ItmPut_VOlrec03 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*03 else Double.NaN;
ItmPut_VOlP03.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP03.SetLineWeight(barWeight);
ItmPut_VOlP03.HideBubble();

# 4
rec ItmPut_VOlrec04 = if IsNaN(close) then ItmPut_VOlrec04[1] else Ceil((ItmPut_VOl04 / MaxVol) * barLength/2);
plot ItmPut_VOlP04 = if ItmPut_VOlrec04 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*04 else Double.NaN;
ItmPut_VOlP04.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP04.SetLineWeight(barWeight);
ItmPut_VOlP04.HideBubble();
# 5
rec ItmPut_VOlrec05 = if IsNaN(close) then ItmPut_VOlrec05[1] else Ceil((ItmPut_VOl05 / MaxVol) * barLength/2);
plot ItmPut_VOlP05 = if ItmPut_VOlrec05 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*05 else Double.NaN;
ItmPut_VOlP05.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP05.SetLineWeight(barWeight);
ItmPut_VOlP05.HideBubble();
# 6
rec ItmPut_VOlrec06 = if IsNaN(close) then ItmPut_VOlrec06[1] else Ceil((ItmPut_VOl06 / MaxVol) * barLength/2);
plot ItmPut_VOlP06 = if ItmPut_VOlrec06 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*06 else Double.NaN;
ItmPut_VOlP06.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP06.SetLineWeight(barWeight);
ItmPut_VOlP06.HideBubble();
# 7
rec ItmPut_VOlrec07 = if IsNaN(close) then ItmPut_VOlrec07[1] else Ceil((ItmPut_VOl07 / MaxVol) * barLength/2);
plot ItmPut_VOlP07 = if ItmPut_VOlrec07 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*07 else Double.NaN;
ItmPut_VOlP07.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP07.SetLineWeight(barWeight);
ItmPut_VOlP07.HideBubble();
# 8
rec ItmPut_VOlrec08 = if IsNaN(close) then ItmPut_VOlrec08[1] else Ceil((ItmPut_VOl08 / MaxVol) * barLength/2);
plot ItmPut_VOlP08 = if ItmPut_VOlrec08 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*08 else Double.NaN;
ItmPut_VOlP08.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP08.SetLineWeight(barWeight);
ItmPut_VOlP08.HideBubble();
# 9
rec ItmPut_VOlrec09 = if IsNaN(close) then ItmPut_VOlrec09[1] else Ceil((ItmPut_VOl09 / MaxVol) * barLength/2);
plot ItmPut_VOlP09 = if ItmPut_VOlrec09 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*09 else Double.NaN;
ItmPut_VOlP09.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP09.SetLineWeight(barWeight);
ItmPut_VOlP09.HideBubble();
# 10
rec ItmPut_VOlrec10 = if IsNaN(close) then ItmPut_VOlrec10[1] else Ceil((ItmPut_VOl10 / MaxVol) * barLength/2);
plot ItmPut_VOlP10 = if ItmPut_VOlrec10 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*10 else Double.NaN;
ItmPut_VOlP10.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP10.SetLineWeight(barWeight);
ItmPut_VOlP10.HideBubble();


#-------------------------------------------------------------------------------------------------------------------------------------------------------
#rec c1_V_e = if IsNaN(close) and !IsNaN(close[1]) then c1_V0[1] else c1_V_e[1];
#rec c2_V_e = if IsNaN(close) and !IsNaN(close[1]) then c1_V1[1] else c2_V_e[1];

#rec p1_V_e = if IsNaN(close) and !IsNaN(close[1]) then p1_V1[1] else p1_V_e[1];
#rec p2_V_e = if IsNaN(close) and !IsNaN(close[1]) then p1_V1[1] else p2_V_e[1];
 

Attachments

  • 2024-01-19-ESXCME_-_Charts_-_238981867TDA_Main@thinkorswim_[b{10}222.png
    2024-01-19-ESXCME_-_Charts_-_238981867TDA_Main@thinkorswim_[b{10}222.png
    128.6 KB · Views: 433
I got an idea from the bulletin board here and succeeded in plotting Spxw's option volume on the "/ES" chart during the rth session. If I make the code public here, talented people will know how to display it in the night market after the market closes, which I could not solve, and how to use "Nq". It would be nice to figure out how to display the QQQ option on the chart, and finally how to display Odte, 1dte.2dte on the right side of the chart according to dte expiration.
Code:
# spx 5min chart

input show_Label = yes;
input optionSeriesPrefix = ".SPXW24";
input MMDD = "0118";

AddLabel(show_Label, Concat(optionSeriesPrefix+mmdd, ""), Color.Yellow);
#AddLabel(show_Label, Concat("Strike Spacing: ", strikeSpacing), Color.WHITE);

DefineGlobalColor("ItmCall", Color.LIGHT_GREEN);
DefineGlobalColor("ItmPut", Color.LIGHT_ORANGE);
DefineGlobalColor("OtmCall", Color.Gray);
DefineGlobalColor("OtmPut", Color.Gray);
DefineGlobalColor("OI", Color.Gray);
DefineGlobalColor("Calls", Color.LIGHT_GREEN);
def strikeSpacing = 5;
def barWeight = 3;

# Number of bars to right of current bar for display
# Should be a positiveVolumeIndex number

input displayOffset = 60;
input agg = AggregationPeriod.DAY ;

# Number of bars of right space minus 5
input barLength = 120;

# /ES와SPX가격차이
def Es_SPX_Diff = close("/ES",period = agg) - close("SPX",period = agg);

#def Es_SPX_Diff = 32;
#def Es_SPX_Diff;
#if SecondsFromTime(1600) == 0 then {
#    Es_SPX_Diff = close("/ES") - close("SPX");
#} else {
#    Es_SPX_Diff = Es_SPX_Diff[1];
#}
AddLabel(yes, "ES-SPX Diff: " + Es_SPX_Diff,color.white);
#------------------
#def SPXP =  close("SPX",period = agg);
#AddLabel(yes, "SPX : "+ SPXP,color.white);
#------------------------------

#spx의 strikeprice
def strikeprice = round( (close("/ES",period = agg)-Es_SPX_Diff) / 5, 0) * 5;
AddLabel(show_Label, "strike : "+ strikeprice, Color.WHITE);

#---------------------------------------------------------------------------------------------------------------

#----------------------------------------------------------------------------------------------------------------
def AtmCall_Vol = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice( strikeprice ),agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice( strikeprice ),agg) else 0;
def AtmCall_OI = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice( strikeprice ),agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice( strikeprice ),agg) else 0;
def AtmPut_Vol = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice( strikeprice ),agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice( strikeprice ),agg) else 0;
def AtmPut_OI = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice( strikeprice ),agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice( strikeprice ),agg) else 0;

AddLabel(show_Label, Concat("AtmCallVol : ", AtmCall_Vol), Color.LIGHT_GREEN);
AddLabel(show_Label, Concat("AtmPutlVol : ", AtmPut_Vol), Color.LIGHT_ORANGE);
#----------------------------------------------------------------------------------------------------------------
#def ItmCall_Vol
def ItmCall_Vol01 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 1), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 1), agg) else 0;
def ItmCall_Vol02 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 2), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 2), agg) else 0;
def ItmCall_Vol03 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 3), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 3), agg) else 0;
def ItmCall_Vol04 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 4), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 4), agg) else 0;
def ItmCall_Vol05 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 5), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 5), agg) else 0;
def ItmCall_Vol06 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 6), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 6), agg) else 0;
def ItmCall_Vol07 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 7), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 7), agg) else 0;
def ItmCall_Vol08 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 8), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 8), agg) else 0;
def ItmCall_Vol09 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 9), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 9), agg) else 0;
def ItmCall_Vol10 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 10), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 10), agg) else 0;

def ItmCall_OI01 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 1), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 1), agg) else 0;
def ItmCall_OI02 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 2), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 2), agg) else 0;
def ItmCall_OI03 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 3), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 3), agg) else 0;
def ItmCall_OI04 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 4), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 4), agg) else 0;
def ItmCall_OI05 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 5), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 5), agg) else 0;
def ItmCall_OI06 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 6), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 6), agg) else 0;
def ItmCall_OI07 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 7), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 7), agg) else 0;
def ItmCall_OI08 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 8), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 8), agg) else 0;
def ItmCall_OI09 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 9), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 9), agg) else 0;
def ItmCall_OI10 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 10), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice + strikeSpacing * 10), agg) else 0;



#AddLabel(yes, "ItmCall_Vol01: " + ItmCall_Vol01);
#AddLabel(yes, "ItmCall_Vol02: " + ItmCall_Vol02);
#AddLabel(yes, "ItmCall_Vol03: " + ItmCall_Vol03);
#AddLabel(yes, "ItmCall_Vol04: " + ItmCall_Vol04);
#AddLabel(yes, "ItmCall_Vol05: " + ItmCall_Vol05);
#AddLabel(yes, "ItmCall_Vol06: " + ItmCall_Vol06);
#AddLabel(yes, "ItmCall_Vol07: " + ItmCall_Vol07);
#AddLabel(yes, "ItmCall_Vol08: " + ItmCall_Vol08);
#AddLabel(yes, "ItmCall_Vol09: " + ItmCall_Vol09);
#AddLabel(yes, "ItmCall_Vol10: " + ItmCall_Vol10);

#----------------------------------------------------------------------------------------------------------------------------------------

def OtmPut_Vol01 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 1), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 1), agg) else 0;
def OtmPut_Vol02 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 2), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 2), agg) else 0;
def OtmPut_Vol03 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 3), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 3), agg) else 0;
def OtmPut_Vol04 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 4), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 4), agg) else 0;
def OtmPut_Vol05 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 5), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 5), agg) else 0;
def OtmPut_Vol06 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 6), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 6), agg) else 0;
def OtmPut_Vol07 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 7), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 7), agg) else 0;
def OtmPut_Vol08 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 8), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 8), agg) else 0;
def OtmPut_Vol09 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 9), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 9), agg) else 0;
def OtmPut_Vol10 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 10), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 10), agg) else 0;

def OtmPut_OI01 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 1), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 1), agg) else 0;
def OtmPut_OI02 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 2), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 2), agg) else 0;
def OtmPut_OI03 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 3), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 3), agg) else 0;
def OtmPut_OI04 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 4), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 4), agg) else 0;
def OtmPut_OI05 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 5), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 5), agg) else 0;
def OtmPut_OI06 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 6), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 6), agg) else 0;
def OtmPut_OI07 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 7), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 7), agg) else 0;
def OtmPut_OI08 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 8), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 8), agg) else 0;
def OtmPut_OI09 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 9), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 9), agg) else 0;
def OtmPut_OI10 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 10), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice + strikeSpacing * 10), agg) else 0;

#-------------------------------------------------------------------------------------------------------------------------------------------
def OtmCall_Vol01 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 1), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 1), agg) else 0;
def OtmCall_Vol02 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 2), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 2), agg) else 0;
def OtmCall_Vol03 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 3), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 3), agg) else 0;
def OtmCall_Vol04 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 4), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 4), agg) else 0;
def OtmCall_Vol05 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 5), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 5), agg) else 0;
def OtmCall_Vol06 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 6), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 6), agg) else 0;
def OtmCall_Vol07 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 7), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 7), agg) else 0;
def OtmCall_Vol08 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 8), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 8), agg) else 0;
def OtmCall_Vol09 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 9), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 9), agg) else 0;
def OtmCall_Vol10 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 10), agg)) then volume(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 10), agg) else 0;

def OtmCall_OI01 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 1), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 1), agg) else 0;
def OtmCall_OI02 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 2), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 2), agg) else 0;
def OtmCall_OI03 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 3), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 3), agg) else 0;
def OtmCall_OI04 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 4), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 4), agg) else 0;
def OtmCall_OI05 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 5), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 5), agg) else 0;
def OtmCall_OI06 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 6), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 6), agg) else 0;
def OtmCall_OI07 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 7), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 7), agg) else 0;
def OtmCall_OI08 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 8), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 8), agg) else 0;
def OtmCall_OI09 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 9), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 9), agg) else 0;
def OtmCall_OI10 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 10), agg)) then open_interest(optionSeriesPrefix + MMDD + "C" + AsPrice(strikeprice - strikeSpacing * 10), agg) else 0;

#--------------------------------------------------------------------------------------------------------------------------------------------------


def ItmPut_Vol01 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 1), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 1), agg) else 0;
def ItmPut_Vol02 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 2), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 2), agg) else 0;
def ItmPut_Vol03 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 3), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 3), agg) else 0;
def ItmPut_Vol04 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 4), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 4), agg) else 0;
def ItmPut_Vol05 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 5), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 5), agg) else 0;
def ItmPut_Vol06 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 6), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 6), agg) else 0;
def ItmPut_Vol07 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 7), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 7), agg) else 0;
def ItmPut_Vol08 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 8), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 8), agg) else 0;
def ItmPut_Vol09 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 9), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 9), agg) else 0;
def ItmPut_Vol10 = if !IsNaN(volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 10), agg)) then volume(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 10), agg) else 0;

def ItmPut_OI01 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 1), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 1), agg) else 0;
def ItmPut_OI02 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 2), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 2), agg) else 0;
def ItmPut_OI03 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 3), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 3), agg) else 0;
def ItmPut_OI04 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 4), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 4), agg) else 0;
def ItmPut_OI05 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 5), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 5), agg) else 0;
def ItmPut_OI06 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 6), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 6), agg) else 0;
def ItmPut_OI07 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 7), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 7), agg) else 0;
def ItmPut_OI08 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 8), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 8), agg) else 0;
def ItmPut_OI09 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 9), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 9), agg) else 0;
def ItmPut_OI10 = if !IsNaN(open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 10), agg)) then open_interest(optionSeriesPrefix + MMDD + "P" + AsPrice(strikeprice - strikeSpacing * 10), agg) else 0;

#-----------------------------------------------------------------------------------------------------------------------------------------------------

def ItmCall_MaxVol = Max(AtmCall_Vol, Max(ItmCall_Vol01, Max(ItmCall_Vol02, Max(ItmCall_Vol03, Max(ItmCall_Vol04, Max(ItmCall_Vol05, Max(ItmCall_Vol06, Max(ItmCall_Vol07, Max(ItmCall_Vol08, Max(ItmCall_Vol09, ItmCall_Vol10))))))))));

def ItmCall_MaxOI = Max(AtmCall_OI, Max(ItmCall_OI01, Max(ItmCall_OI02, Max(ItmCall_OI03, Max(ItmCall_OI04, Max(ItmCall_OI05, Max(ItmCall_OI06, Max(ItmCall_OI07, Max(ItmCall_OI08, Max(ItmCall_OI09, ItmCall_OI10))))))))));

def ItmPut_MaxVol = Max(AtmPut_Vol, Max(ItmPut_Vol01, Max(ItmPut_Vol02, Max(ItmPut_Vol03, Max(ItmPut_Vol04, Max(ItmPut_Vol05, Max(ItmPut_Vol06, Max(ItmPut_Vol07, Max(ItmPut_Vol08, Max(ItmPut_Vol09, ItmPut_Vol10))))))))));

def ItmPut_MaxOI = Max(AtmPut_OI, Max(ItmPut_OI01, Max(ItmPut_OI02, Max(ItmPut_OI03, Max(ItmPut_OI04, Max(ItmPut_OI05, Max(ItmPut_OI06, Max(ItmPut_OI07, Max(ItmPut_OI08, Max(ItmPut_OI09, ItmPut_OI10))))))))));

def OtmCall_MaxVol =  Max(OtmCall_Vol01, Max(OtmCall_Vol02, Max(OtmCall_Vol03, Max(OtmCall_Vol04, Max(OtmCall_Vol05, Max(OtmCall_Vol06, Max(OtmCall_Vol07, Max(OtmCall_Vol08, Max(OtmCall_Vol09, OtmCall_Vol10)))))))));

def OtmCall_MaxOI = Max(OtmCall_OI01, Max(OtmCall_OI02, Max(OtmCall_OI03, Max(OtmCall_OI04, Max(OtmCall_OI05, Max(OtmCall_OI06, Max(OtmCall_OI07, Max(OtmCall_OI08, Max(OtmCall_OI09, OtmCall_OI10)))))))));

def OtmPut_MaxVol = Max(OtmPut_Vol01, Max(OtmPut_Vol02, Max(OtmPut_Vol03, Max(OtmPut_Vol04, Max(OtmPut_Vol05, Max(OtmPut_Vol06, Max(OtmPut_Vol07, Max(OtmPut_Vol08, Max(OtmPut_Vol09, OtmPut_Vol10)))))))));

def OtmPut_MaxOI =  Max(OtmPut_OI01, Max(OtmPut_OI02, Max(OtmPut_OI03, Max(OtmPut_OI04, Max(OtmPut_OI05, Max(OtmPut_OI06, Max(OtmPut_OI07, Max(OtmPut_OI08, Max(OtmPut_OI09, OtmPut_OI10)))))))));

def MaxVol = Max(ItmCall_MaxVol,Max(ItmCall_MaxOI,Max(ItmPut_MaxVol,Max(ItmPut_MaxOI,Max(OtmCall_MaxVol,Max(OtmCall_MaxOI,Max(OtmPut_MaxVol,OtmPut_MaxOI)))))));
AddLabel(yes, "MaxVol :" + MaxVol);


#----------------------------------------------------------------------------------------------------------------

#--------------------------------------------------------------------------------------------------------------------------------------------------

def barOffset = if !IsNaN(close) then strikeSpacing / 10.0 else barOffset[1];          #rec -- def
def c_extBar = if IsNaN(close[displayOffset+barLength/2]) then c_extBar[1] + 1 else 0;
rec extBar = if IsNaN(close[displayOffset]) then extBar[1] + 1 else 0;

#-----------------------------------------------------------------------------------------------------------------------------------------------------------

#----------------------------------------------------------------------------------------------------------------
rec AtmCall_Volrec = if IsNaN(close) then AtmCall_Volrec[1] else Ceil((AtmCall_Vol / MaxVol) * barLength/2);    # barLength --- barLength/2
plot AtmCall_VolP = if AtmCall_Volrec >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset else Double.NaN;
AtmCall_VolP.SetDefaultColor(Color.white );
AtmCall_VolP.SetLineWeight(barWeight);
AtmCall_VolP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
#AtmCall_VOlP.HideBubble();

rec AtmPut_Volrec = if IsNaN(close) then AtmPut_Volrec[1] else Ceil((AtmPut_Vol / MaxVol) * barLength/2);    # barLength --- barLength/2
plot AtmPut_VolP = if AtmPut_Volrec >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff - barOffset else Double.NaN;
AtmPut_VolP.SetDefaultColor(Color.white );
AtmPut_VolP.SetLineWeight(barWeight);
AtmPut_VolP.SetPaintingStrategy(PaintingStrategy.HORIZONTAL);
AtmPut_VOlP.HideBubble();
#-----------------------------------------------------------------------------------------------------------------------
# ItmCall---------------------------------------------------------------------------------------------------------------

rec ItmCall_VOlrec01 = if IsNaN(close) then ItmCall_VOlrec01[1] else Ceil((ItmCall_VOl01 / MaxVol) * barLength/2);
plot ItmCall_VOlP01 = if ItmCall_VOlrec01 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*01 else Double.NaN;
ItmCall_VOlP01.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP01.SetLineWeight(barWeight);
ItmCall_VOlP01.HideBubble();
# 2
rec ItmCall_VOlrec02 = if IsNaN(close) then ItmCall_VOlrec02[1] else Ceil((ItmCall_VOl02 / MaxVol) * barLength/2);
plot ItmCall_VOlP02 = if ItmCall_VOlrec02 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*02 else Double.NaN;
ItmCall_VOlP02.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP02.SetLineWeight(barWeight);
ItmCall_VOlP02.HideBubble();
# 3
rec ItmCall_VOlrec03 = if IsNaN(close) then ItmCall_VOlrec03[1] else Ceil((ItmCall_VOl03 / MaxVol) * barLength/2);
plot ItmCall_VOlP03 = if ItmCall_VOlrec03 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*03 else Double.NaN;
ItmCall_VOlP03.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP03.SetLineWeight(barWeight);
ItmCall_VOlP03.HideBubble();

# 4
rec ItmCall_VOlrec04 = if IsNaN(close) then ItmCall_VOlrec04[1] else Ceil((ItmCall_VOl04 / MaxVol) * barLength/2);
plot ItmCall_VOlP04 = if ItmCall_VOlrec04 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*04 else Double.NaN;
ItmCall_VOlP04.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP04.SetLineWeight(barWeight);
ItmCall_VOlP04.HideBubble();

# 5
rec ItmCall_VOlrec05 = if IsNaN(close) then ItmCall_VOlrec05[1] else Ceil((ItmCall_VOl05 / MaxVol) * barLength/2);
plot ItmCall_VOlP05 = if ItmCall_VOlrec05 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*05 else Double.NaN;
ItmCall_VOlP05.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP05.SetLineWeight(barWeight);
ItmCall_VOlP05.HideBubble();

# 6
rec ItmCall_VOlrec06 = if IsNaN(close) then ItmCall_VOlrec06[1] else Ceil((ItmCall_VOl06 / MaxVol) * barLength/2);
plot ItmCall_VOlP06 = if ItmCall_VOlrec06 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*06 else Double.NaN;
ItmCall_VOlP06.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP06.SetLineWeight(barWeight);
ItmCall_VOlP06.HideBubble();

# 7
rec ItmCall_VOlrec07 = if IsNaN(close) then ItmCall_VOlrec07[1] else Ceil((ItmCall_VOl07 / MaxVol) * barLength/2);
plot ItmCall_VOlP07 = if ItmCall_VOlrec07 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*07 else Double.NaN;
ItmCall_VOlP07.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP07.SetLineWeight(barWeight);
ItmCall_VOlP07.HideBubble();
# 8번
rec ItmCall_VOlrec08 = if IsNaN(close) then ItmCall_VOlrec08[1] else Ceil((ItmCall_VOl08 / MaxVol) * barLength/2);
plot ItmCall_VOlP08 = if ItmCall_VOlrec08 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*08 else Double.NaN;
ItmCall_VOlP08.SetDefaultColor(GlobalColor("Calls"));
ItmCall_VOlP08.SetLineWeight(barWeight);
ItmCall_VOlP08.HideBubble();

# 9
rec ItmCall_VOlrec09 = if IsNaN(close) then ItmCall_VOlrec09[1] else Ceil((ItmCall_VOl09 / MaxVol) * barLength/2);
plot ItmCall_VOlP09 = if ItmCall_VOlrec09 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*09 else Double.NaN;
ItmCall_VOlP09.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP09.SetLineWeight(barWeight);
ItmCall_VOlP09.HideBubble();

# 10
rec ItmCall_VOlrec10 = if IsNaN(close) then ItmCall_VOlrec10[1] else Ceil((ItmCall_VOl10 / MaxVol) * barLength/2);
plot ItmCall_VOlP10 = if ItmCall_VOlrec10 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*10 else Double.NaN;
ItmCall_VOlP10.SetDefaultColor(GlobalColor("ItmCall"));
ItmCall_VOlP10.SetLineWeight(barWeight);
ItmCall_VOlP10.HideBubble();

#OtmCall   ------------------------------------------------------------------------------------------------------------------------------------------------
# 1
rec OtmCall_VOlrec01 = if IsNaN(close) then OtmCall_VOlrec01[1] else Ceil((OtmCall_VOl01 / MaxVol) * barLength/2);
plot OtmCall_VOlP01 = if OtmCall_VOlrec01 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*01 else Double.NaN;
OtmCall_VOlP01.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP01.SetLineWeight(barWeight);
OtmCall_VOlP01.HideBubble();
# 2
rec OtmCall_VOlrec02 = if IsNaN(close) then OtmCall_VOlrec02[1] else Ceil((OtmCall_VOl02 / MaxVol) * barLength/2);
plot OtmCall_VOlP02 = if OtmCall_VOlrec02 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*02 else Double.NaN;
OtmCall_VOlP02.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP02.SetLineWeight(barWeight);
OtmCall_VOlP02.HideBubble();
# 3
rec OtmCall_VOlrec03 = if IsNaN(close) then OtmCall_VOlrec03[1] else Ceil((OtmCall_VOl03 / MaxVol) * barLength/2);
plot OtmCall_VOlP03 = if OtmCall_VOlrec03 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*03 else Double.NaN;
OtmCall_VOlP03.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP03.SetLineWeight(barWeight);
OtmCall_VOlP03.HideBubble();

# 4
rec OtmCall_VOlrec04 = if IsNaN(close) then OtmCall_VOlrec04[1] else Ceil((OtmCall_VOl04 / MaxVol) * barLength/2);
plot OtmCall_VOlP04 = if OtmCall_VOlrec04 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*04 else Double.NaN;
OtmCall_VOlP04.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP04.SetLineWeight(barWeight);
OtmCall_VOlP04.HideBubble();
# 5
rec OtmCall_VOlrec05 = if IsNaN(close) then OtmCall_VOlrec05[1] else Ceil((OtmCall_VOl05 / MaxVol) * barLength/2);
plot OtmCall_VOlP05 = if OtmCall_VOlrec05 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*05 else Double.NaN;
OtmCall_VOlP05.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP05.SetLineWeight(barWeight);
OtmCall_VOlP05.HideBubble();
# 6
rec OtmCall_VOlrec06 = if IsNaN(close) then OtmCall_VOlrec06[1] else Ceil((OtmCall_VOl06 / MaxVol) * barLength/2);
plot OtmCall_VOlP06 = if OtmCall_VOlrec06 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*06 else Double.NaN;
OtmCall_VOlP06.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP06.SetLineWeight(barWeight);
OtmCall_VOlP06.HideBubble();
# 7
rec OtmCall_VOlrec07 = if IsNaN(close) then OtmCall_VOlrec07[1] else Ceil((OtmCall_VOl07 / MaxVol) * barLength/2);
plot OtmCall_VOlP07 = if OtmCall_VOlrec07 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*07 else Double.NaN;
OtmCall_VOlP07.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP07.SetLineWeight(barWeight);
OtmCall_VOlP07.HideBubble();
# 8
rec OtmCall_VOlrec08 = if IsNaN(close) then OtmCall_VOlrec08[1] else Ceil((OtmCall_VOl08 / MaxVol) * barLength/2);
plot OtmCall_VOlP08 = if OtmCall_VOlrec08 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*08 else Double.NaN;
OtmCall_VOlP08.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP08.SetLineWeight(barWeight);
OtmCall_VOlP08.HideBubble();
# 9
rec OtmCall_VOlrec09 = if IsNaN(close) then OtmCall_VOlrec09[1] else Ceil((OtmCall_VOl09 / MaxVol) * barLength/2);
plot OtmCall_VOlP09 = if OtmCall_VOlrec09 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*09 else Double.NaN;
OtmCall_VOlP09.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP09.SetLineWeight(barWeight);
OtmCall_VOlP09.HideBubble();
# 10
rec OtmCall_VOlrec10 = if IsNaN(close) then OtmCall_VOlrec10[1] else Ceil((OtmCall_VOl10 / MaxVol) * barLength/2);
plot OtmCall_VOlP10 = if OtmCall_VOlrec10 >= c_extBar and c_extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*10 else Double.NaN;
OtmCall_VOlP10.SetDefaultColor(GlobalColor("OtmCall"));
OtmCall_VOlP10.SetLineWeight(barWeight);
OtmCall_VOlP10.HideBubble();

#OtmPut---------------------------------------------------------------------------------------------------------------------------------

rec OtmPut_VOlrec01 = if IsNaN(close) then OtmPut_VOlrec01[1] else Ceil((OtmPut_VOl01 / MaxVol) * barLength/2);
plot OtmPut_VOlP01 = if OtmPut_VOlrec01 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*01 else Double.NaN;
OtmPut_VOlP01.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP01.SetLineWeight(barWeight);
OtmPut_VOlP01.HideBubble();

# 2
rec OtmPut_VOlrec02 = if IsNaN(close) then OtmPut_VOlrec02[1] else Ceil((OtmPut_VOl02 / MaxVol) * barLength/2);
plot OtmPut_VOlP02 = if OtmPut_VOlrec02 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*02 else Double.NaN;
OtmPut_VOlP02.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP02.SetLineWeight(barWeight);
OtmPut_VOlP02.HideBubble();
# 3
rec OtmPut_VOlrec03 = if IsNaN(close) then OtmPut_VOlrec03[1] else Ceil((OtmPut_VOl03 / MaxVol) * barLength/2);
plot OtmPut_VOlP03 = if OtmPut_VOlrec03 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*03 else Double.NaN;
OtmPut_VOlP03.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP03.SetLineWeight(barWeight);
OtmPut_VOlP03.HideBubble();

# 4
rec OtmPut_VOlrec04 = if IsNaN(close) then OtmPut_VOlrec04[1] else Ceil((OtmPut_VOl04 / MaxVol) * barLength/2);
plot OtmPut_VOlP04 = if OtmPut_VOlrec04 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*04 else Double.NaN;
OtmPut_VOlP04.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP04.SetLineWeight(barWeight);
OtmPut_VOlP04.HideBubble();
# 5
rec OtmPut_VOlrec05 = if IsNaN(close) then OtmPut_VOlrec05[1] else Ceil((OtmPut_VOl05 / MaxVol) * barLength/2);
plot OtmPut_VOlP05 = if OtmPut_VOlrec05 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*05 else Double.NaN;
OtmPut_VOlP05.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP05.SetLineWeight(barWeight);
OtmPut_VOlP05.HideBubble();
# 6
rec OtmPut_VOlrec06 = if IsNaN(close) then OtmPut_VOlrec06[1] else Ceil((OtmPut_VOl06 / MaxVol) * barLength/2);
plot OtmPut_VOlP06 = if OtmPut_VOlrec06 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*06 else Double.NaN;
OtmPut_VOlP06.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP06.SetLineWeight(barWeight);
OtmPut_VOlP06.HideBubble();
# 7
rec OtmPut_VOlrec07 = if IsNaN(close) then OtmPut_VOlrec07[1] else Ceil((OtmPut_VOl07 / MaxVol) * barLength/2);
plot OtmPut_VOlP07 = if OtmPut_VOlrec07 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*07 else Double.NaN;
OtmPut_VOlP07.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP07.SetLineWeight(barWeight);
OtmPut_VOlP07.HideBubble();
# 8
rec OtmPut_VOlrec08 = if IsNaN(close) then OtmPut_VOlrec08[1] else Ceil((OtmPut_VOl08 / MaxVol) * barLength/2);
plot OtmPut_VOlP08 = if OtmPut_VOlrec08 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*08 else Double.NaN;
OtmPut_VOlP08.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP08.SetLineWeight(barWeight);
OtmPut_VOlP08.HideBubble();
# 9
rec OtmPut_VOlrec09 = if IsNaN(close) then OtmPut_VOlrec09[1] else Ceil((OtmPut_VOl09 / MaxVol) * barLength/2);
plot OtmPut_VOlP09 = if OtmPut_VOlrec09 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*09 else Double.NaN;
OtmPut_VOlP09.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP09.SetLineWeight(barWeight);
OtmPut_VOlP09.HideBubble();
# 10
rec OtmPut_VOlrec10 = if IsNaN(close) then OtmPut_VOlrec10[1] else Ceil((OtmPut_VOl10 / MaxVol) * barLength/2);
plot OtmPut_VOlP10 = if OtmPut_VOlrec10 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset + strikeSpacing*10 else Double.NaN;
OtmPut_VOlP10.SetDefaultColor(GlobalColor("OtmPut"));
OtmPut_VOlP10.SetLineWeight(barWeight);
OtmPut_VOlP10.HideBubble();



#----------------------------------------------------------------------------------------------------------------
# 1
rec ItmPut_VOlrec01 = if IsNaN(close) then ItmPut_VOlrec01[1] else Ceil((ItmPut_VOl01 / MaxVol) * barLength/2);
plot ItmPut_VOlP01 = if ItmPut_VOlrec01 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*01 else Double.NaN;
ItmPut_VOlP01.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP01.SetLineWeight(barWeight);
ItmPut_VOlP01.HideBubble();
# 2
rec ItmPut_VOlrec02 = if IsNaN(close) then ItmPut_VOlrec02[1] else Ceil((ItmPut_VOl02 / MaxVol) * barLength/2);
plot ItmPut_VOlP02 = if ItmPut_VOlrec02 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*02 else Double.NaN;
ItmPut_VOlP02.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP02.SetLineWeight(barWeight);
ItmPut_VOlP02.HideBubble();
# 3
rec ItmPut_VOlrec03 = if IsNaN(close) then ItmPut_VOlrec03[1] else Ceil((ItmPut_VOl03 / MaxVol) * barLength/2);
plot ItmPut_VOlP03 = if ItmPut_VOlrec03 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*03 else Double.NaN;
ItmPut_VOlP03.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP03.SetLineWeight(barWeight);
ItmPut_VOlP03.HideBubble();

# 4
rec ItmPut_VOlrec04 = if IsNaN(close) then ItmPut_VOlrec04[1] else Ceil((ItmPut_VOl04 / MaxVol) * barLength/2);
plot ItmPut_VOlP04 = if ItmPut_VOlrec04 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*04 else Double.NaN;
ItmPut_VOlP04.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP04.SetLineWeight(barWeight);
ItmPut_VOlP04.HideBubble();
# 5
rec ItmPut_VOlrec05 = if IsNaN(close) then ItmPut_VOlrec05[1] else Ceil((ItmPut_VOl05 / MaxVol) * barLength/2);
plot ItmPut_VOlP05 = if ItmPut_VOlrec05 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*05 else Double.NaN;
ItmPut_VOlP05.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP05.SetLineWeight(barWeight);
ItmPut_VOlP05.HideBubble();
# 6
rec ItmPut_VOlrec06 = if IsNaN(close) then ItmPut_VOlrec06[1] else Ceil((ItmPut_VOl06 / MaxVol) * barLength/2);
plot ItmPut_VOlP06 = if ItmPut_VOlrec06 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*06 else Double.NaN;
ItmPut_VOlP06.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP06.SetLineWeight(barWeight);
ItmPut_VOlP06.HideBubble();
# 7
rec ItmPut_VOlrec07 = if IsNaN(close) then ItmPut_VOlrec07[1] else Ceil((ItmPut_VOl07 / MaxVol) * barLength/2);
plot ItmPut_VOlP07 = if ItmPut_VOlrec07 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*07 else Double.NaN;
ItmPut_VOlP07.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP07.SetLineWeight(barWeight);
ItmPut_VOlP07.HideBubble();
# 8
rec ItmPut_VOlrec08 = if IsNaN(close) then ItmPut_VOlrec08[1] else Ceil((ItmPut_VOl08 / MaxVol) * barLength/2);
plot ItmPut_VOlP08 = if ItmPut_VOlrec08 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*08 else Double.NaN;
ItmPut_VOlP08.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP08.SetLineWeight(barWeight);
ItmPut_VOlP08.HideBubble();
# 9
rec ItmPut_VOlrec09 = if IsNaN(close) then ItmPut_VOlrec09[1] else Ceil((ItmPut_VOl09 / MaxVol) * barLength/2);
plot ItmPut_VOlP09 = if ItmPut_VOlrec09 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*09 else Double.NaN;
ItmPut_VOlP09.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP09.SetLineWeight(barWeight);
ItmPut_VOlP09.HideBubble();
# 10
rec ItmPut_VOlrec10 = if IsNaN(close) then ItmPut_VOlrec10[1] else Ceil((ItmPut_VOl10 / MaxVol) * barLength/2);
plot ItmPut_VOlP10 = if ItmPut_VOlrec10 >= extBar and extBar != 0 then  strikeprice +Es_SPX_Diff+ barOffset - strikeSpacing*10 else Double.NaN;
ItmPut_VOlP10.SetDefaultColor(GlobalColor("ItmPut"));
ItmPut_VOlP10.SetLineWeight(barWeight);
ItmPut_VOlP10.HideBubble();


#-------------------------------------------------------------------------------------------------------------------------------------------------------
#rec c1_V_e = if IsNaN(close) and !IsNaN(close[1]) then c1_V0[1] else c1_V_e[1];
#rec c2_V_e = if IsNaN(close) and !IsNaN(close[1]) then c1_V1[1] else c2_V_e[1];

#rec p1_V_e = if IsNaN(close) and !IsNaN(close[1]) then p1_V1[1] else p1_V_e[1];
#rec p2_V_e = if IsNaN(close) and !IsNaN(close[1]) then p1_V1[1] else p2_V_e[1];
I'm no coder but I love where you going with that question and how configured this script. it's amazing bro. did you have any updates on this current script? thank you.
 
# volume_vertical_axis_manual_spx
# Twitter @2187Nick
declare upper;
declare once_per_bar;
input OptionSeries_YYMMDD = "221216";
input symbol = "SPXW";
input strikeSpacing = 5.0;
input roundup = no;
input openintline = 100;
input shift_line_right = 10;# negative numbers plot in candle area, positive in expansion
input division = 100; # divides the open interest by this number. Gives user option to reduce size of bar plots.
input space = .5; # the vertical space between the put open interest bar and call open interest bar.

DefineGlobalColor("CallColor", Color.GREEN);
DefineGlobalColor("PutColor", Color.RED);
AddLabel(yes, OptionSeries_YYMMDD + "C", GlobalColor("CallColor"));
AddLabel(yes, OptionSeries_YYMMDD + "P", GlobalColor("PutColor"));
def agg = AggregationPeriod.DAY;
def openlevel = close(period = agg);
def floor_or_ceiling = if roundup then Ceil(openlevel / 10) * 10 else Floor(openlevel / 10) * 10;
def PutStrike = floor_or_ceiling;
def CallStrike = floor_or_ceiling;


### Put Option Volume
def putOptionVolume = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 0), period = agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 0), period = agg);
def putOptionVolume1 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 1), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 1), agg);
def putOptionVolume2 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 2), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 2), agg);
def putOptionVolume3 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 3), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 3), agg);
def putOptionVolume4 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 4), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 4), agg);
def putOptionVolume5 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 5), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 5), agg);
def putOptionVolume6 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 6), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 6), agg);
def putOptionVolume7 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 7), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 7), agg);
def putOptionVolume8 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 8), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 8), agg);
def putOptionVolume9 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 9), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 9), agg);
def putOptionVolume10 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 10), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 10), agg);
def putOptionVolume11 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 11), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 11), agg);
def putOptionVolume13 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 12), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 12), agg);
def putOptionVolume12 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 13), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 13), agg);
def putOptionVolume14 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 14), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 14), agg);
def putOptionVolume15 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 15), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 15), agg);
def putOptionVolume16 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 16), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 16), agg);
def putOptionVolume17 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 17), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 17), agg);
def putOptionVolume18 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 18), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 18), agg);
def putOptionVolume19 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 19), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 19), agg);
def putOptionVolume20 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 20), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 20), agg);

def putOptionVolumea = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 0), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 0), agg);
def putOptionVolume1a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 1), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 1), agg);
def putOptionVolume2a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 2), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 2), agg);
def putOptionVolume3a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 3), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 3), agg);
def putOptionVolume4a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 4), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 4), agg);
def putOptionVolume5a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 5), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 5), agg);
def putOptionVolume6a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 6), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 6), agg);
def putOptionVolume7a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 7), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 7), agg);
def putOptionVolume8a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 8), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 8), agg);
def putOptionVolume9a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 9), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 9), agg);
def putOptionVolume10a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 10), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 10), agg);
def putOptionVolume11a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 11), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 11), agg);
def putOptionVolume13a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 12), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 12), agg);
def putOptionVolume12a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 13), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 13), agg);
def putOptionVolume14a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 14), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 14), agg);
def putOptionVolume15a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 15), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 15), agg);
def putOptionVolume16a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 16), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 16), agg);
def putOptionVolume17a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 17), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 17), agg);
def putOptionVolume18a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 18), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 18), agg);
def putOptionVolume19a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 19), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 19), agg);
def putOptionVolume20a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 20), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 20), agg);

# Calculate total Put volume and display as label
def totalPutsVol = Sum(putOptionVolume + putOptionVolume1 + putOptionVolume2 + putOptionVolume3 + putOptionVolume4 + putOptionVolume5 + putOptionVolume6 + putOptionVolume7 + putOptionVolume8 + putOptionVolume9 + putOptionVolume10 + putOptionVolume11 + putOptionVolume12 + putOptionVolume13 + putOptionVolume14 + putOptionVolume15 + putOptionVolume16 + putOptionVolume17 + putOptionVolume18 + putOptionVolume19 + putOptionVolume20 + putOptionVolumea + putOptionVolume1a + putOptionVolume2a + putOptionVolume3a + putOptionVolume4a + putOptionVolume5a + putOptionVolume6a + putOptionVolume7a + putOptionVolume8a + putOptionVolume9a + putOptionVolume10a + putOptionVolume11a + putOptionVolume12a + putOptionVolume13a + putOptionVolume14a + putOptionVolume15a + putOptionVolume16a + putOptionVolume17a + putOptionVolume18a + putOptionVolume19a + putOptionVolume20a);
AddLabel(yes, "Total Puts Volume: " + totalPutsVol, Color.RED);




###Call Option Volume
def callOptionVolume = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 0), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 0), agg);

def callOptionVolume1 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 1), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 1), agg);
def callOptionVolume2 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 2), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 2), agg);
def callOptionVolume3 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 3), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 3), agg);
def callOptionVolume4 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 4), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 4), agg);
def callOptionVolume5 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 5), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 5), agg);
def callOptionVolume6 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 6), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 6), agg);
def callOptionVolume7 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 7), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 7), agg);
def callOptionVolume8 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 8), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 8), agg);
def callOptionVolume9 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 9), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 9), agg);
def callOptionVolume10 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 10), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 10), agg);
def callOptionVolume11 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 11), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 11), agg);
def callOptionVolume12 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 12), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 12), agg);
def callOptionVolume13 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 13), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 13), agg);
def callOptionVolume14 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 14), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 14), agg);
def callOptionVolume15 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 15), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 15), agg);
def callOptionVolume16 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 16), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 16), agg);
def callOptionVolume17 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 17), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 17), agg);
def callOptionVolume18 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 18), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 18), agg);
def callOptionVolume19 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 19), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 19), agg);
def callOptionVolume20 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 20), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 20), agg);

def callOptionVolumea = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 0), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 0), agg);
def callOptionVolume1a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 1), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 1), agg);
def callOptionVolume2a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 2), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 2), agg);
def callOptionVolume3a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 3), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 3), agg);
def callOptionVolume4a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 4), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 4), agg);
def callOptionVolume5a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 5), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 5), agg);
def callOptionVolume6a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 6), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 6), agg);
def callOptionVolume7a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 7), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 7), agg);
def callOptionVolume8a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 8), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 8), agg);
def callOptionVolume9a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 9), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 9), agg);
def callOptionVolume10a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 10), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 10), agg);
def callOptionVolume11a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 11), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 11), agg);
def callOptionVolume13a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 12), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 12), agg);
def callOptionVolume12a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 13), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 13), agg);
def callOptionVolume14a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 14), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 14), agg);
def callOptionVolume15a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 15), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 15), agg);
def callOptionVolume16a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 16), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 16), agg);
def callOptionVolume17a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 17), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 17), agg);
def callOptionVolume18a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 18), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 18), agg);
def callOptionVolume19a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 19), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 19), agg);
def callOptionVolume20a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 20), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 20), agg);


# Calculate total call volume and display as label
def totalCallVol = Sum(CallOptionVolume + CallOptionVolume1 + CallOptionVolume2 + CallOptionVolume3 + CallOptionVolume4 + CallOptionVolume5 + CallOptionVolume6 + CallOptionVolume7 + CallOptionVolume8 + CallOptionVolume9 + CallOptionVolume10 + CallOptionVolume11 + CallOptionVolume12 + CallOptionVolume13 + CallOptionVolume14 + CallOptionVolume15 + CallOptionVolume16 + CallOptionVolume17 + CallOptionVolume18 + CallOptionVolume19 + CallOptionVolume20 + CallOptionVolumea + CallOptionVolume1a + CallOptionVolume2a + CallOptionVolume3a + CallOptionVolume4a + CallOptionVolume5a + CallOptionVolume6a + CallOptionVolume7a + CallOptionVolume8a + CallOptionVolume9a + CallOptionVolume10a + CallOptionVolume11a + CallOptionVolume12a + CallOptionVolume13a + CallOptionVolume14a + CallOptionVolume15a + CallOptionVolume16a + CallOptionVolume17a + CallOptionVolume18a + CallOptionVolume19a + CallOptionVolume20a);
AddLabel(yes, "Total Call Volume: " + totalCallVol, Color.GREEN);




#####################################

def lastbar = if IsNaN(close[-1]) and !IsNaN(close)
then BarNumber()
else lastbar[1];

AddVerticalLine(BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right), "Live Volume",color.white,Curve.LONG_DASH);





def atmcallstrike = CallStrike;
plot atmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume / division, 0)) then atmcallstrike else Double.NaN;

input display_bubbles = { default "Hide", "Display" }; #


AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume / division, 0)) then yes else no, atmcallstrike, callOptionvolume, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume / division, 0)) then yes else no, atmcallstrike-space, putOptionvolume, Color.red, no);

def otmcallstrike1 = CallStrike + strikeSpacing;
plot otmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1 / division, 0)) then otmcallstrike1 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume1 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1 / division, 0)) then yes else no, otmcallstrike1, callOptionvolume1, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume1a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1a / division, 0)) then yes else no, otmcallstrike1-space, putOptionvolume1a, Color.red, no);

def otmcallstrike2 = CallStrike + strikeSpacing * 2;
plot otmcall1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2 / division, 0)) then otmcallstrike2 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume2 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2 / division, 0)) then yes else no, otmcallstrike2, callOptionvolume2, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume2a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2a / division, 0)) then yes else no, otmcallstrike2-space, putOptionvolume2a, Color.red, no);

def otmcallstrike3 = CallStrike + strikeSpacing * 3;
plot otmcall2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3 / division, 0)) then otmcallstrike3 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume3 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3 / division, 0)) then yes else no, otmcallstrike3, callOptionvolume3, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume3a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3a / division, 0)) then yes else no, otmcallstrike3-space, putOptionvolume3a, Color.red, no);

def otmcallstrike4 = CallStrike + strikeSpacing * 4;
plot otmcall3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4 / division, 0)) then otmcallstrike4 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume4 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4 / division, 0)) then yes else no, otmcallstrike4, callOptionvolume4, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume4a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4a / division, 0)) then yes else no, otmcallstrike4-space, putOptionvolume4a, Color.red, no);

def otmcallstrike5 = CallStrike + strikeSpacing * 5;
plot otmcall4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5 / division, 0)) then otmcallstrike5 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume5 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5 / division, 0)) then yes else no, otmcallstrike5, callOptionvolume5, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume5a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5a / division, 0)) then yes else no, otmcallstrike5-space, putOptionvolume5a, Color.red, no);

def otmcallstrike6 = CallStrike + strikeSpacing * 6;
plot otmcall5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6 / division, 0)) then otmcallstrike6 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume6 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6 / division, 0)) then yes else no, otmcallstrike6, callOptionvolume6, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume6a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6a / division, 0)) then yes else no, otmcallstrike6-space, putOptionvolume6a, Color.red, no);

def otmcallstrike7 = CallStrike + strikeSpacing * 7;
plot otmcall6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7 / division, 0)) then otmcallstrike7 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume7 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7 / division, 0)) then yes else no, otmcallstrike7, callOptionvolume7, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume7a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7a / division, 0)) then yes else no, otmcallstrike7-space, putOptionvolume7a, Color.red, no);

def otmcallstrike8 = CallStrike + strikeSpacing * 8;
plot otmcall7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8 / division, 0)) then otmcallstrike8 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume8 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8 / division, 0)) then yes else no, otmcallstrike8, callOptionvolume8, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume8a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8a / division, 0)) then yes else no, otmcallstrike8-space, putOptionvolume8a, Color.red, no);

def otmcallstrike9 = CallStrike + strikeSpacing * 9;
plot otmcall8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9 / division, 0)) then otmcallstrike9 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume9 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9 / division, 0)) then yes else no, otmcallstrike9, callOptionvolume9, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume9a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9a / division, 0)) then yes else no, otmcallstrike9-space, putOptionvolume9a, Color.red, no);

def otmcallstrike10 = CallStrike + strikeSpacing * 10;
plot otmcall9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10 / division, 0)) then otmcallstrike10 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume10 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10 / division, 0)) then yes else no, otmcallstrike10, callOptionvolume10, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume10a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10a / division, 0)) then yes else no, otmcallstrike10-space, putOptionvolume10a, Color.red, no);

def otmcallstrike11 = CallStrike + strikeSpacing * 11;
plot otmcall10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11 / division, 0)) then otmcallstrike11 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume11 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11 / division, 0)) then yes else no, otmcallstrike11, callOptionvolume11, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume11a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11a / division, 0)) then yes else no, otmcallstrike11-space, putOptionvolume11a, Color.red, no);

def otmcallstrike12 = CallStrike + strikeSpacing * 12;
plot otmcall11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12 / division, 0)) then otmcallstrike12 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume12 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12 / division, 0)) then yes else no, otmcallstrike12, callOptionvolume12, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume12a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12a / division, 0)) then yes else no, otmcallstrike12-space, putOptionvolume12a, Color.red, no);

def otmcallstrike13 = CallStrike + strikeSpacing * 13;
plot otmcall12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13 / division, 0)) then otmcallstrike13 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume13 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13 / division, 0)) then yes else no, otmcallstrike13, callOptionvolume13, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume13a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13a / division, 0)) then yes else no, otmcallstrike13-space, putOptionvolume13a, Color.red, no);

def otmcallstrike14 = CallStrike + strikeSpacing * 14;
plot otmcall13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14 / division, 0)) then otmcallstrike14 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume14 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14 / division, 0)) then yes else no, otmcallstrike14,
callOptionvolume14, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume14a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14a / division, 0)) then yes else no, otmcallstrike14-space, putOptionvolume14a, Color.red, no);

def otmcallstrike15 = CallStrike + strikeSpacing * 15;
plot otmcall14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15 / division, 0)) then otmcallstrike15 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume15 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15 / division, 0)) then yes else no, otmcallstrike15, callOptionvolume15, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume15a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15a / division, 0)) then yes else no, otmcallstrike15-space, putOptionvolume15a, Color.red, no);

def otmcallstrike16 = CallStrike + strikeSpacing * 16;
plot otmcall15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16 / division, 0)) then otmcallstrike16 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume16 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16 / division, 0)) then yes else no, otmcallstrike16, callOptionvolume16, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume16a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16a / division, 0)) then yes else no, otmcallstrike16-space, putOptionvolume16a, Color.red, no);

def otmcallstrike17 = CallStrike + strikeSpacing * 17;
plot otmcall16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17 / division, 0)) then otmcallstrike17 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume17 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17 / division, 0)) then yes else no, otmcallstrike17, callOptionvolume17, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume17a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17a / division, 0)) then yes else no, otmcallstrike17-space, putOptionvolume17a, Color.red, no);

def otmcallstrike18 = CallStrike + strikeSpacing * 18;
plot otmcall17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18 / division, 0)) then otmcallstrike18 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume18 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18 / division, 0)) then yes else no, otmcallstrike18, callOptionvolume18, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume18a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18a / division, 0)) then yes else no, otmcallstrike18-space, putOptionvolume18a, Color.red, no);

def otmcallstrike19 = CallStrike + strikeSpacing * 19;
plot otmcall18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19 / division, 0)) then otmcallstrike19 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume19 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19 / division, 0)) then yes else no, otmcallstrike19, callOptionvolume19, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume19a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19a / division, 0)) then yes else no, otmcallstrike19-space, putOptionvolume19a, Color.red, no);

def otmcallstrike20 = CallStrike + strikeSpacing * 20;
plot otmcall19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20 / division, 0)) then otmcallstrike20 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume20 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20 / division, 0)) then yes else no, otmcallstrike20, callOptionvolume20, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume20a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20a / division, 0)) then yes else no, otmcallstrike20-space, putOptionvolume20a, Color.red, no);


def itmcallstrike1 = CallStrike - strikeSpacing;
plot itmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolumea / division, 0)) then itmcallstrike1 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume1a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1a / division, 0)) then yes else no, itmcallstrike1, callOptionvolume1a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume1 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1 / division, 0)) then yes else no, itmcallstrike1-space, putOptionvolume1, Color.red, no);

def itmcallstrike2 = CallStrike - strikeSpacing * 2;
plot itmcall1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2a / division, 0)) then itmcallstrike2 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume2a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2a / division, 0)) then yes else no, itmcallstrike2, callOptionvolume2a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume2 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2 / division, 0)) then yes else no, itmcallstrike2-space, putOptionvolume2, Color.red, no);

def itmcallstrike3 = CallStrike - strikeSpacing * 3;
plot itmcall2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3a / division, 0)) then itmcallstrike3 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume3a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3a / division, 0)) then yes else no, itmcallstrike3, callOptionvolume3a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume3 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3 / division, 0)) then yes else no, itmcallstrike3-space, putOptionvolume3, Color.red, no);

def itmcallstrike4 = CallStrike - strikeSpacing * 4;
plot itmcall3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4a / division, 0)) then itmcallstrike4 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume4a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4a / division, 0)) then yes else no, itmcallstrike4, callOptionvolume4a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume4 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4 / division, 0)) then yes else no, itmcallstrike4-space, putOptionvolume4, Color.red, no);

def itmcallstrike5 = CallStrike - strikeSpacing * 5;
plot itmcall4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5a / division, 0)) then itmcallstrike5 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume5a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5a / division, 0)) then yes else no, itmcallstrike5, callOptionvolume5a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume5 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5 / division, 0)) then yes else no, itmcallstrike5-space, putOptionvolume5, Color.red, no);

def itmcallstrike6 = CallStrike - strikeSpacing * 6;
plot itmcall5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6a / division, 0)) then itmcallstrike6 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume6a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6a / division, 0)) then yes else no, itmcallstrike6, callOptionvolume6a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume6 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6 / division, 0)) then yes else no, itmcallstrike6-space, putOptionvolume6, Color.red, no);

def itmcallstrike7 = CallStrike - strikeSpacing * 7;
plot itmcall6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7a / division, 0)) then itmcallstrike7 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume7a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7a / division, 0)) then yes else no, itmcallstrike7, callOptionvolume7a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume7 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7 / division, 0)) then yes else no, itmcallstrike7-space, putOptionvolume7, Color.red, no);

def itmcallstrike8 = CallStrike - strikeSpacing * 8;
plot itmcall7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8a / division, 0)) then itmcallstrike8 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume8a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8a / division, 0)) then yes else no, itmcallstrike8, callOptionvolume8a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume8 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8 / division, 0)) then yes else no, itmcallstrike8-space, putOptionvolume8, Color.red, no);

def itmcallstrike9 = CallStrike - strikeSpacing * 9;
plot itmcall8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9a / division, 0)) then itmcallstrike9 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume9a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9a / division, 0)) then yes else no, itmcallstrike9, callOptionvolume9a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume9 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9 / division, 0)) then yes else no, itmcallstrike9-space, putOptionvolume9, Color.red, no);

def itmcallstrike10 = CallStrike - strikeSpacing * 10;
plot itmcall9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10a / division, 0)) then itmcallstrike10 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume10a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10a / division, 0)) then yes else no, itmcallstrike10, callOptionvolume10a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume10 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10 / division, 0)) then yes else no, itmcallstrike10-space, putOptionvolume10, Color.red, no);

def itmcallstrike11 = CallStrike - strikeSpacing * 11;
plot itmcall10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11a / division, 0)) then itmcallstrike11 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume11a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11a / division, 0)) then yes else no, itmcallstrike11, callOptionvolume11a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume11 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11 / division, 0)) then yes else no, itmcallstrike11-space, putOptionvolume11, Color.red, no);

def itmcallstrike12 = CallStrike - strikeSpacing * 12;
plot itmcall11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12a / division, 0)) then itmcallstrike12 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume12a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12a / division, 0)) then yes else no, itmcallstrike12, callOptionvolume12a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume12 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12 / division, 0)) then yes else no, itmcallstrike12-space, putOptionvolume12, Color.red, no);

def itmcallstrike13 = CallStrike - strikeSpacing * 13;
plot itmcall12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13a / division, 0)) then itmcallstrike13 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume13a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13a / division, 0)) then yes else no, itmcallstrike13, callOptionvolume13a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume13 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13 / division, 0)) then yes else no, itmcallstrike13-space, putOptionvolume13, Color.red, no);

def itmcallstrike14 = CallStrike - strikeSpacing * 14;
plot itmcall13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14a / division, 0)) then itmcallstrike14 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume14a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14a / division, 0)) then yes else no, itmcallstrike14, callOptionvolume14a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume14 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14 / division, 0)) then yes else no, itmcallstrike14-space, putOptionvolume14, Color.red, no);

def itmcallstrike15 = CallStrike - strikeSpacing * 15;
plot itmcall14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15a / division, 0)) then itmcallstrike15 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume15a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15a / division, 0)) then yes else no, itmcallstrike15, callOptionvolume15a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume15 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15 / division, 0)) then yes else no, itmcallstrike15-space, putOptionvolume15, Color.red, no);

def itmcallstrike16 = CallStrike - strikeSpacing * 16;
plot itmcall15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16a / division, 0)) then itmcallstrike16 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume16a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16a / division, 0)) then yes else no, itmcallstrike16, callOptionvolume16a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume16 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16 / division, 0)) then yes else no, itmcallstrike16-space, putOptionvolume16, Color.red, no);

def itmcallstrike17 = CallStrike - strikeSpacing * 17;
plot itmcall16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17a / division, 0)) then itmcallstrike17 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume17a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17a / division, 0)) then yes else no, itmcallstrike17, callOptionvolume17a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume17 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17 / division, 0)) then yes else no, itmcallstrike17-space, putOptionvolume17, Color.red, no);

def itmcallstrike18 = CallStrike - strikeSpacing * 18;
plot itmcall17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18a / division, 0)) then itmcallstrike18 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume18a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18a / division, 0)) then yes else no, itmcallstrike18, callOptionvolume18a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume18 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18 / division, 0)) then yes else no, itmcallstrike18-space, putOptionvolume18, Color.red, no);

def itmcallstrike19 = CallStrike - strikeSpacing * 19;
plot itmcall18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19a / division, 0)) then itmcallstrike19 else Double.NaN;
AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume19a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19a / division, 0)) then yes else no, itmcallstrike19, callOptionvolume19a, Color.green, yes);
AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume19 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19 / division, 0)) then yes else no, itmcallstrike19-space, putOptionvolume19, Color.red, no);
def itmcallstrike20 = CallStrike - strikeSpacing * 20;
plot itmcall19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20a / division, 0)) then itmcallstrike20 else Double.NaN;
AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume20a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20a / division, 0)) then yes else no, itmcallstrike20, callOptionvolume20a, Color.green, yes);
AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume20 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20 / division, 0)) then yes else no, itmcallstrike20-space, putOptionvolume20, Color.red, no);


####################
#PUTS
def atmputstrike = PutStrike - space;
plot atmput = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume / division, 0)) then atmputstrike else Double.NaN;
def itmputstrike1 = PutStrike + strikeSpacing - space;
plot itmput = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume1a / division, 0)) then itmputstrike1 else Double.NaN;
def itmPutStrike2 = PutStrike + strikeSpacing * 2 - space;
plot itmput1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume2a / division, 0)) then itmPutStrike2 else Double.NaN;
def itmPutStrike3 = PutStrike + strikeSpacing * 3 - space;
plot itmput2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume3a / division, 0)) then itmPutStrike3 else Double.NaN;
def itmPutStrike4 = PutStrike + strikeSpacing * 4 - space;
plot itmput3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume4a / division, 0)) then itmPutStrike4 else Double.NaN;
def itmPutStrike5 = PutStrike + strikeSpacing * 5 - space;
plot itmput4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume5a / division, 0)) then itmPutStrike5 else Double.NaN;
def itmPutStrike6 = PutStrike + strikeSpacing * 6 - space;
plot itmput5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume6a / division, 0)) then itmPutStrike6 else Double.NaN;
def itmPutStrike7 = PutStrike + strikeSpacing * 7 - space;
plot itmput6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume7a / division, 0)) then itmPutStrike7 else Double.NaN;
def itmPutStrike8 = PutStrike + strikeSpacing * 8 - space;
plot itmput7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume8a / division, 0)) then itmPutStrike8 else Double.NaN;
def itmPutStrike9 = PutStrike + strikeSpacing * 9 - space;
plot itmput8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume9a / division, 0)) then itmPutStrike9 else Double.NaN;
def itmPutStrike10 = PutStrike + strikeSpacing * 10 - space;
plot itmput9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume10a / division, 0)) then itmPutStrike10 else Double.NaN;
def itmPutStrike11 = PutStrike + strikeSpacing * 11 - space;
plot itmput10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume11a / division, 0)) then itmPutStrike11 else Double.NaN;
def itmPutStrike12 = PutStrike + strikeSpacing * 12 - space;
plot itmput11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume12a / division, 0)) then itmPutStrike12 else Double.NaN;
def itmPutStrike13 = PutStrike + strikeSpacing * 13 - space;
plot itmput12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume13a / division, 0)) then itmPutStrike13 else Double.NaN;
def itmPutStrike14 = PutStrike + strikeSpacing * 14 - space;
plot itmput13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume14a / division, 0)) then itmPutStrike14 else Double.NaN;
def itmPutStrike15 = PutStrike + strikeSpacing * 15 - space;
plot itmput14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume15a / division, 0)) then itmPutStrike15 else Double.NaN;
def itmPutStrike16 = PutStrike + strikeSpacing * 16 - space;
plot itmput15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume16a / division, 0)) then itmPutStrike16 else Double.NaN;
def itmPutStrike17 = PutStrike + strikeSpacing * 17 - space;
plot itmput16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume17a / division, 0)) then itmPutStrike17 else Double.NaN;
def itmPutStrike18 = PutStrike + strikeSpacing * 18 - space;
plot itmput17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume18a / division, 0)) then itmPutStrike18 else Double.NaN;
def itmPutStrike19 = PutStrike + strikeSpacing * 19 - space;
plot itmput18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume19a / division, 0)) then itmPutStrike19 else Double.NaN;
def itmPutStrike20 = PutStrike + strikeSpacing * 20 - space;
plot itmput19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume20a / division, 0)) then itmPutStrike20 else Double.NaN;

def otmputstrike1 = PutStrike - strikeSpacing - space;
plot otmput = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume1 / division, 0)) then otmputstrike1 else Double.NaN;
def otmputStrike2 = PutStrike - strikeSpacing * 2 - space;
plot otmput1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume2 / division, 0)) then otmputStrike2 else Double.NaN;
def otmputStrike3 = PutStrike - strikeSpacing * 3 - space;
plot otmput2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume3 / division, 0)) then otmputStrike3 else Double.NaN;
def otmputStrike4 = PutStrike - strikeSpacing * 4 - space;
plot otmput3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume4 / division, 0)) then otmputStrike4 else Double.NaN;
def otmputStrike5 = PutStrike - strikeSpacing * 5 - space;
plot otmput4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume5 / division, 0)) then otmputStrike5 else Double.NaN;
def otmputStrike6 = PutStrike - strikeSpacing * 6 - space;
plot otmput5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume6 / division, 0)) then otmputStrike6 else Double.NaN;
def otmputStrike7 = PutStrike - strikeSpacing * 7 - space;
plot otmput6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume7 / division, 0)) then otmputStrike7 else Double.NaN;
def otmputStrike8 = PutStrike - strikeSpacing * 8 - space;
plot otmput7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume8 / division, 0)) then otmputStrike8 else Double.NaN;
def otmputStrike9 = PutStrike - strikeSpacing * 9 - space;
plot otmput8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume9 / division, 0)) then otmputStrike9 else Double.NaN;
def otmputStrike10 = PutStrike - strikeSpacing * 10 - space;
plot otmput9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume10 / division, 0)) then otmputStrike10 else Double.NaN;
def otmputStrike11 = PutStrike - strikeSpacing * 11 - space;
plot otmput10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume11 / division, 0)) then otmputStrike11 else Double.NaN;
def otmputStrike12 = PutStrike - strikeSpacing * 12 - space;
plot otmput11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume12 / division, 0)) then otmputStrike12 else Double.NaN;
def otmputStrike13 = PutStrike - strikeSpacing * 13 - space;
plot otmput12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume13 / division, 0)) then otmputStrike13 else Double.NaN;
def otmputStrike14 = PutStrike - strikeSpacing * 14 - space;
plot otmput13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume14 / division, 0)) then otmputStrike14 else Double.NaN;
def otmputStrike15 = PutStrike - strikeSpacing * 15 - space;
plot otmput14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume15 / division, 0)) then otmputStrike15 else Double.NaN;
def otmputStrike16 = PutStrike - strikeSpacing * 16 - space;
plot otmput15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume16 / division, 0)) then otmputStrike16 else Double.NaN;
def otmputStrike17 = PutStrike - strikeSpacing * 17 - space;
plot otmput16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume17 / division, 0)) then otmputStrike17 else Double.NaN;
def otmputStrike18 = PutStrike - strikeSpacing * 18 - space;
plot otmput17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume18 / division, 0)) then otmputStrike18 else Double.NaN;
def otmputStrike19 = PutStrike - strikeSpacing * 19 - space;
plot otmput18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume19 / division, 0)) then otmputStrike19 else Double.NaN;
def otmputStrike20 = PutStrike - strikeSpacing * 20 - space;
plot otmput19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume20 / division, 0)) then otmputStrike20 else Double.NaN;

atmcall.SetPaintingStrategy(PaintingStrategy.LINE);
atmcall.SetLineWeight(5);
atmcall.SetDefaultColor(GlobalColor("CallColor"));
otmcall.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall.SetLineWeight(5);
otmcall.SetDefaultColor(GlobalColor("CallColor"));
otmcall1.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall1.SetLineWeight(5);
otmcall1.SetDefaultColor(GlobalColor("CallColor"));
otmcall2.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall2.SetLineWeight(5);
otmcall2.SetDefaultColor(GlobalColor("CallColor"));
otmcall3.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall3.SetLineWeight(5);
otmcall3.SetDefaultColor(GlobalColor("CallColor"));
otmcall4.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall4.SetLineWeight(5);
otmcall4.SetDefaultColor(GlobalColor("CallColor"));
otmcall5.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall5.SetLineWeight(5);
otmcall5.SetDefaultColor(GlobalColor("CallColor"));
otmcall6.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall6.SetLineWeight(5);
otmcall6.SetDefaultColor(GlobalColor("CallColor"));
otmcall7.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall7.SetLineWeight(5);
otmcall7.SetDefaultColor(GlobalColor("CallColor"));
otmcall8.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall8.SetLineWeight(5);
otmcall8.SetDefaultColor(GlobalColor("CallColor"));
otmcall9.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall9.SetLineWeight(5);
otmcall9.SetDefaultColor(GlobalColor("CallColor"));
otmcall10.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall10.SetLineWeight(5);
otmcall10.SetDefaultColor(GlobalColor("CallColor"));
otmcall11.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall11.SetLineWeight(5);
otmcall11.SetDefaultColor(GlobalColor("CallColor"));
otmcall12.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall12.SetLineWeight(5);
otmcall12.SetDefaultColor(GlobalColor("CallColor"));
otmcall13.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall13.SetLineWeight(5);
otmcall13.SetDefaultColor(GlobalColor("CallColor"));
otmcall14.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall14.SetLineWeight(5);
otmcall14.SetDefaultColor(GlobalColor("CallColor"));
otmcall15.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall15.SetLineWeight(5);
otmcall15.SetDefaultColor(GlobalColor("CallColor"));
otmcall16.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall16.SetLineWeight(5);
otmcall16.SetDefaultColor(GlobalColor("CallColor"));
otmcall17.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall17.SetLineWeight(5);
otmcall17.SetDefaultColor(GlobalColor("CallColor"));
otmcall18.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall18.SetLineWeight(5);
otmcall18.SetDefaultColor(GlobalColor("CallColor"));
otmcall19.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall19.SetLineWeight(5);
otmcall19.SetDefaultColor(GlobalColor("CallColor"));

itmcall.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall.SetLineWeight(5);
itmcall.SetDefaultColor(GlobalColor("CallColor"));
itmcall1.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall1.SetLineWeight(5);
itmcall1.SetDefaultColor(GlobalColor("CallColor"));
itmcall2.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall2.SetLineWeight(5);
itmcall2.SetDefaultColor(GlobalColor("CallColor"));
itmcall3.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall3.SetLineWeight(5);
itmcall3.SetDefaultColor(GlobalColor("CallColor"));
itmcall4.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall4.SetLineWeight(5);
itmcall4.SetDefaultColor(GlobalColor("CallColor"));
itmcall5.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall5.SetLineWeight(5);
itmcall5.SetDefaultColor(GlobalColor("CallColor"));
itmcall6.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall6.SetLineWeight(5);
itmcall6.SetDefaultColor(GlobalColor("CallColor"));
itmcall7.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall7.SetLineWeight(5);
itmcall7.SetDefaultColor(GlobalColor("CallColor"));
itmcall8.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall8.SetLineWeight(5);
itmcall8.SetDefaultColor(GlobalColor("CallColor"));
itmcall9.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall9.SetLineWeight(5);
itmcall9.SetDefaultColor(GlobalColor("CallColor"));
itmcall10.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall10.SetLineWeight(5);
itmcall10.SetDefaultColor(GlobalColor("CallColor"));
itmcall11.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall11.SetLineWeight(5);
itmcall11.SetDefaultColor(GlobalColor("CallColor"));
itmcall12.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall12.SetLineWeight(5);
itmcall12.SetDefaultColor(GlobalColor("CallColor"));
itmcall13.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall13.SetLineWeight(5);
itmcall13.SetDefaultColor(GlobalColor("CallColor"));
itmcall14.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall14.SetLineWeight(5);
itmcall14.SetDefaultColor(GlobalColor("CallColor"));
itmcall15.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall15.SetLineWeight(5);
itmcall15.SetDefaultColor(GlobalColor("CallColor"));
itmcall16.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall16.SetLineWeight(5);
itmcall16.SetDefaultColor(GlobalColor("CallColor"));
itmcall17.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall17.SetLineWeight(5);
itmcall17.SetDefaultColor(GlobalColor("CallColor"));
itmcall18.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall18.SetLineWeight(5);
itmcall18.SetDefaultColor(GlobalColor("CallColor"));
itmcall19.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall19.SetLineWeight(5);
itmcall19.SetDefaultColor(GlobalColor("CallColor"));

atmput.SetPaintingStrategy(PaintingStrategy.LINE);
atmput.SetLineWeight(5);
atmput.SetDefaultColor(GlobalColor("PutColor"));
itmput.SetPaintingStrategy(PaintingStrategy.LINE);
itmput.SetLineWeight(5);
itmput.SetDefaultColor(GlobalColor("PutColor"));
itmput1.SetPaintingStrategy(PaintingStrategy.LINE);
itmput1.SetLineWeight(5);
itmput1.SetDefaultColor(GlobalColor("PutColor"));
itmput2.SetPaintingStrategy(PaintingStrategy.LINE);
itmput2.SetLineWeight(5);
itmput2.SetDefaultColor(GlobalColor("PutColor"));
itmput3.SetPaintingStrategy(PaintingStrategy.LINE);
itmput3.SetLineWeight(5);
itmput3.SetDefaultColor(GlobalColor("PutColor"));
itmput4.SetPaintingStrategy(PaintingStrategy.LINE);
itmput4.SetLineWeight(5);
itmput4.SetDefaultColor(GlobalColor("PutColor"));
itmput5.SetPaintingStrategy(PaintingStrategy.LINE);
itmput5.SetLineWeight(5);
itmput5.SetDefaultColor(GlobalColor("PutColor"));
itmput6.SetPaintingStrategy(PaintingStrategy.LINE);
itmput6.SetLineWeight(5);
itmput6.SetDefaultColor(GlobalColor("PutColor"));
itmput7.SetPaintingStrategy(PaintingStrategy.LINE);
itmput7.SetLineWeight(5);
itmput7.SetDefaultColor(GlobalColor("PutColor"));
itmput8.SetPaintingStrategy(PaintingStrategy.LINE);
itmput8.SetLineWeight(5);
itmput8.SetDefaultColor(GlobalColor("PutColor"));
itmput9.SetPaintingStrategy(PaintingStrategy.LINE);
itmput9.SetLineWeight(5);
itmput9.SetDefaultColor(GlobalColor("PutColor"));
itmput10.SetPaintingStrategy(PaintingStrategy.LINE);
itmput10.SetLineWeight(5);
itmput10.SetDefaultColor(GlobalColor("PutColor"));
itmput11.SetPaintingStrategy(PaintingStrategy.LINE);
itmput11.SetLineWeight(5);
itmput11.SetDefaultColor(GlobalColor("PutColor"));
itmput12.SetPaintingStrategy(PaintingStrategy.LINE);
itmput12.SetLineWeight(5);
itmput12.SetDefaultColor(GlobalColor("PutColor"));
itmput13.SetPaintingStrategy(PaintingStrategy.LINE);
itmput13.SetLineWeight(5);
itmput13.SetDefaultColor(GlobalColor("PutColor"));
itmput14.SetPaintingStrategy(PaintingStrategy.LINE);
itmput14.SetLineWeight(5);
itmput14.SetDefaultColor(GlobalColor("PutColor"));
itmput15.SetPaintingStrategy(PaintingStrategy.LINE);
itmput15.SetLineWeight(5);
itmput15.SetDefaultColor(GlobalColor("PutColor"));
itmput16.SetPaintingStrategy(PaintingStrategy.LINE);
itmput16.SetLineWeight(5);
itmput16.SetDefaultColor(GlobalColor("PutColor"));
itmput17.SetPaintingStrategy(PaintingStrategy.LINE);
itmput17.SetLineWeight(5);
itmput17.SetDefaultColor(GlobalColor("PutColor"));
itmput18.SetPaintingStrategy(PaintingStrategy.LINE);
itmput18.SetLineWeight(5);
itmput18.SetDefaultColor(GlobalColor("PutColor"));
itmput19.SetPaintingStrategy(PaintingStrategy.LINE);
itmput19.SetLineWeight(5);
itmput19.SetDefaultColor(GlobalColor("PutColor"));





otmput.SetPaintingStrategy(PaintingStrategy.LINE);
otmput.SetLineWeight(5);
otmput.SetDefaultColor(GlobalColor("PutColor"));
otmput1.SetPaintingStrategy(PaintingStrategy.LINE);
otmput1.SetLineWeight(5);
otmput1.SetDefaultColor(GlobalColor("PutColor"));
otmput2.SetPaintingStrategy(PaintingStrategy.LINE);
otmput2.SetLineWeight(5);
otmput2.SetDefaultColor(GlobalColor("PutColor"));
otmput3.SetPaintingStrategy(PaintingStrategy.LINE);
otmput3.SetLineWeight(5);
otmput3.SetDefaultColor(GlobalColor("PutColor"));
otmput4.SetPaintingStrategy(PaintingStrategy.LINE);
otmput4.SetLineWeight(5);
otmput4.SetDefaultColor(GlobalColor("PutColor"));
otmput5.SetPaintingStrategy(PaintingStrategy.LINE);
otmput5.SetLineWeight(5);
otmput5.SetDefaultColor(GlobalColor("PutColor"));
otmput6.SetPaintingStrategy(PaintingStrategy.LINE);
otmput6.SetLineWeight(5);
otmput6.SetDefaultColor(GlobalColor("PutColor"));
otmput7.SetPaintingStrategy(PaintingStrategy.LINE);
otmput7.SetLineWeight(5);
otmput7.SetDefaultColor(GlobalColor("PutColor"));
otmput8.SetPaintingStrategy(PaintingStrategy.LINE);
otmput8.SetLineWeight(5);
otmput8.SetDefaultColor(GlobalColor("PutColor"));
otmput9.SetPaintingStrategy(PaintingStrategy.LINE);
otmput9.SetLineWeight(5);
otmput9.SetDefaultColor(GlobalColor("PutColor"));
otmput10.SetPaintingStrategy(PaintingStrategy.LINE);
otmput10.SetLineWeight(5);
otmput10.SetDefaultColor(GlobalColor("PutColor"));
otmput11.SetPaintingStrategy(PaintingStrategy.LINE);
otmput11.SetLineWeight(5);
otmput11.SetDefaultColor(GlobalColor("PutColor"));
otmput12.SetPaintingStrategy(PaintingStrategy.LINE);
otmput12.SetLineWeight(5);
otmput12.SetDefaultColor(GlobalColor("PutColor"));
otmput13.SetPaintingStrategy(PaintingStrategy.LINE);
otmput13.SetLineWeight(5);
otmput13.SetDefaultColor(GlobalColor("PutColor"));
otmput14.SetPaintingStrategy(PaintingStrategy.LINE);
otmput14.SetLineWeight(5);
otmput14.SetDefaultColor(GlobalColor("PutColor"));
otmput15.SetPaintingStrategy(PaintingStrategy.LINE);
otmput15.SetLineWeight(5);
otmput15.SetDefaultColor(GlobalColor("PutColor"));
otmput16.SetPaintingStrategy(PaintingStrategy.LINE);
otmput16.SetLineWeight(5);
otmput16.SetDefaultColor(GlobalColor("PutColor"));
otmput17.SetPaintingStrategy(PaintingStrategy.LINE);
otmput17.SetLineWeight(5);
otmput17.SetDefaultColor(GlobalColor("PutColor"));
otmput18.SetPaintingStrategy(PaintingStrategy.LINE);
otmput18.SetLineWeight(5);
otmput18.SetDefaultColor(GlobalColor("PutColor"));
otmput19.SetPaintingStrategy(PaintingStrategy.LINE);
otmput19.SetLineWeight(5);
otmput19.SetDefaultColor(GlobalColor("PutColor"));
 

Attachments

  • Screenshot (76).png
    Screenshot (76).png
    244.6 KB · Views: 416
# volume_vertical_axis_manual_spx
# Twitter @2187Nick
declare upper;
declare once_per_bar;
input OptionSeries_YYMMDD = "221216";
input symbol = "SPXW";
input strikeSpacing = 5.0;
input roundup = no;
input openintline = 100;
input shift_line_right = 10;# negative numbers plot in candle area, positive in expansion
input division = 100; # divides the open interest by this number. Gives user option to reduce size of bar plots.
input space = .5; # the vertical space between the put open interest bar and call open interest bar.

DefineGlobalColor("CallColor", Color.GREEN);
DefineGlobalColor("PutColor", Color.RED);
AddLabel(yes, OptionSeries_YYMMDD + "C", GlobalColor("CallColor"));
AddLabel(yes, OptionSeries_YYMMDD + "P", GlobalColor("PutColor"));
def agg = AggregationPeriod.DAY;
def openlevel = close(period = agg);
def floor_or_ceiling = if roundup then Ceil(openlevel / 10) * 10 else Floor(openlevel / 10) * 10;
def PutStrike = floor_or_ceiling;
def CallStrike = floor_or_ceiling;


### Put Option Volume
def putOptionVolume = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 0), period = agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 0), period = agg);
def putOptionVolume1 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 1), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 1), agg);
def putOptionVolume2 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 2), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 2), agg);
def putOptionVolume3 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 3), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 3), agg);
def putOptionVolume4 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 4), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 4), agg);
def putOptionVolume5 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 5), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 5), agg);
def putOptionVolume6 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 6), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 6), agg);
def putOptionVolume7 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 7), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 7), agg);
def putOptionVolume8 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 8), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 8), agg);
def putOptionVolume9 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 9), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 9), agg);
def putOptionVolume10 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 10), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 10), agg);
def putOptionVolume11 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 11), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 11), agg);
def putOptionVolume13 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 12), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 12), agg);
def putOptionVolume12 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 13), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 13), agg);
def putOptionVolume14 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 14), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 14), agg);
def putOptionVolume15 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 15), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 15), agg);
def putOptionVolume16 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 16), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 16), agg);
def putOptionVolume17 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 17), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 17), agg);
def putOptionVolume18 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 18), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 18), agg);
def putOptionVolume19 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 19), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 19), agg);
def putOptionVolume20 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 20), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike - strikeSpacing * 20), agg);

def putOptionVolumea = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 0), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 0), agg);
def putOptionVolume1a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 1), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 1), agg);
def putOptionVolume2a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 2), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 2), agg);
def putOptionVolume3a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 3), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 3), agg);
def putOptionVolume4a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 4), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 4), agg);
def putOptionVolume5a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 5), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 5), agg);
def putOptionVolume6a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 6), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 6), agg);
def putOptionVolume7a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 7), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 7), agg);
def putOptionVolume8a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 8), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 8), agg);
def putOptionVolume9a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 9), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 9), agg);
def putOptionVolume10a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 10), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 10), agg);
def putOptionVolume11a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 11), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 11), agg);
def putOptionVolume13a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 12), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 12), agg);
def putOptionVolume12a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 13), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 13), agg);
def putOptionVolume14a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 14), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 14), agg);
def putOptionVolume15a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 15), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 15), agg);
def putOptionVolume16a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 16), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 16), agg);
def putOptionVolume17a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 17), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 17), agg);
def putOptionVolume18a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 18), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 18), agg);
def putOptionVolume19a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 19), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 19), agg);
def putOptionVolume20a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 20), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "P" + AsPrice(PutStrike + strikeSpacing * 20), agg);

# Calculate total Put volume and display as label
def totalPutsVol = Sum(putOptionVolume + putOptionVolume1 + putOptionVolume2 + putOptionVolume3 + putOptionVolume4 + putOptionVolume5 + putOptionVolume6 + putOptionVolume7 + putOptionVolume8 + putOptionVolume9 + putOptionVolume10 + putOptionVolume11 + putOptionVolume12 + putOptionVolume13 + putOptionVolume14 + putOptionVolume15 + putOptionVolume16 + putOptionVolume17 + putOptionVolume18 + putOptionVolume19 + putOptionVolume20 + putOptionVolumea + putOptionVolume1a + putOptionVolume2a + putOptionVolume3a + putOptionVolume4a + putOptionVolume5a + putOptionVolume6a + putOptionVolume7a + putOptionVolume8a + putOptionVolume9a + putOptionVolume10a + putOptionVolume11a + putOptionVolume12a + putOptionVolume13a + putOptionVolume14a + putOptionVolume15a + putOptionVolume16a + putOptionVolume17a + putOptionVolume18a + putOptionVolume19a + putOptionVolume20a);
AddLabel(yes, "Total Puts Volume: " + totalPutsVol, Color.RED);




###Call Option Volume
def callOptionVolume = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 0), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 0), agg);

def callOptionVolume1 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 1), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 1), agg);
def callOptionVolume2 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 2), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 2), agg);
def callOptionVolume3 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 3), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 3), agg);
def callOptionVolume4 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 4), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 4), agg);
def callOptionVolume5 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 5), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 5), agg);
def callOptionVolume6 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 6), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 6), agg);
def callOptionVolume7 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 7), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 7), agg);
def callOptionVolume8 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 8), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 8), agg);
def callOptionVolume9 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 9), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 9), agg);
def callOptionVolume10 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 10), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 10), agg);
def callOptionVolume11 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 11), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 11), agg);
def callOptionVolume12 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 12), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 12), agg);
def callOptionVolume13 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 13), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 13), agg);
def callOptionVolume14 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 14), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 14), agg);
def callOptionVolume15 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 15), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 15), agg);
def callOptionVolume16 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 16), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 16), agg);
def callOptionVolume17 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 17), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 17), agg);
def callOptionVolume18 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 18), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 18), agg);
def callOptionVolume19 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 19), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 19), agg);
def callOptionVolume20 = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 20), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike + strikeSpacing * 20), agg);

def callOptionVolumea = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 0), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 0), agg);
def callOptionVolume1a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 1), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 1), agg);
def callOptionVolume2a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 2), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 2), agg);
def callOptionVolume3a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 3), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 3), agg);
def callOptionVolume4a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 4), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 4), agg);
def callOptionVolume5a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 5), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 5), agg);
def callOptionVolume6a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 6), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 6), agg);
def callOptionVolume7a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 7), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 7), agg);
def callOptionVolume8a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 8), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 8), agg);
def callOptionVolume9a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 9), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 9), agg);
def callOptionVolume10a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 10), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 10), agg);
def callOptionVolume11a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 11), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 11), agg);
def callOptionVolume13a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 12), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 12), agg);
def callOptionVolume12a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 13), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 13), agg);
def callOptionVolume14a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 14), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 14), agg);
def callOptionVolume15a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 15), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 15), agg);
def callOptionVolume16a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 16), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 16), agg);
def callOptionVolume17a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 17), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 17), agg);
def callOptionVolume18a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 18), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 18), agg);
def callOptionVolume19a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 19), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 19), agg);
def callOptionVolume20a = if IsNaN(volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 20), agg)) then 0 else volume("." + symbol + OptionSeries_YYMMDD + "C" + AsPrice(CallStrike - strikeSpacing * 20), agg);


# Calculate total call volume and display as label
def totalCallVol = Sum(CallOptionVolume + CallOptionVolume1 + CallOptionVolume2 + CallOptionVolume3 + CallOptionVolume4 + CallOptionVolume5 + CallOptionVolume6 + CallOptionVolume7 + CallOptionVolume8 + CallOptionVolume9 + CallOptionVolume10 + CallOptionVolume11 + CallOptionVolume12 + CallOptionVolume13 + CallOptionVolume14 + CallOptionVolume15 + CallOptionVolume16 + CallOptionVolume17 + CallOptionVolume18 + CallOptionVolume19 + CallOptionVolume20 + CallOptionVolumea + CallOptionVolume1a + CallOptionVolume2a + CallOptionVolume3a + CallOptionVolume4a + CallOptionVolume5a + CallOptionVolume6a + CallOptionVolume7a + CallOptionVolume8a + CallOptionVolume9a + CallOptionVolume10a + CallOptionVolume11a + CallOptionVolume12a + CallOptionVolume13a + CallOptionVolume14a + CallOptionVolume15a + CallOptionVolume16a + CallOptionVolume17a + CallOptionVolume18a + CallOptionVolume19a + CallOptionVolume20a);
AddLabel(yes, "Total Call Volume: " + totalCallVol, Color.GREEN);




#####################################

def lastbar = if IsNaN(close[-1]) and !IsNaN(close)
then BarNumber()
else lastbar[1];

AddVerticalLine(BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right), "Live Volume",color.white,Curve.LONG_DASH);





def atmcallstrike = CallStrike;
plot atmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume / division, 0)) then atmcallstrike else Double.NaN;

input display_bubbles = { default "Hide", "Display" }; #


AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume / division, 0)) then yes else no, atmcallstrike, callOptionvolume, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume / division, 0)) then yes else no, atmcallstrike-space, putOptionvolume, Color.red, no);

def otmcallstrike1 = CallStrike + strikeSpacing;
plot otmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1 / division, 0)) then otmcallstrike1 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume1 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1 / division, 0)) then yes else no, otmcallstrike1, callOptionvolume1, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume1a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1a / division, 0)) then yes else no, otmcallstrike1-space, putOptionvolume1a, Color.red, no);

def otmcallstrike2 = CallStrike + strikeSpacing * 2;
plot otmcall1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2 / division, 0)) then otmcallstrike2 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume2 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2 / division, 0)) then yes else no, otmcallstrike2, callOptionvolume2, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume2a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2a / division, 0)) then yes else no, otmcallstrike2-space, putOptionvolume2a, Color.red, no);

def otmcallstrike3 = CallStrike + strikeSpacing * 3;
plot otmcall2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3 / division, 0)) then otmcallstrike3 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume3 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3 / division, 0)) then yes else no, otmcallstrike3, callOptionvolume3, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume3a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3a / division, 0)) then yes else no, otmcallstrike3-space, putOptionvolume3a, Color.red, no);

def otmcallstrike4 = CallStrike + strikeSpacing * 4;
plot otmcall3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4 / division, 0)) then otmcallstrike4 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume4 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4 / division, 0)) then yes else no, otmcallstrike4, callOptionvolume4, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume4a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4a / division, 0)) then yes else no, otmcallstrike4-space, putOptionvolume4a, Color.red, no);

def otmcallstrike5 = CallStrike + strikeSpacing * 5;
plot otmcall4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5 / division, 0)) then otmcallstrike5 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume5 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5 / division, 0)) then yes else no, otmcallstrike5, callOptionvolume5, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume5a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5a / division, 0)) then yes else no, otmcallstrike5-space, putOptionvolume5a, Color.red, no);

def otmcallstrike6 = CallStrike + strikeSpacing * 6;
plot otmcall5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6 / division, 0)) then otmcallstrike6 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume6 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6 / division, 0)) then yes else no, otmcallstrike6, callOptionvolume6, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume6a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6a / division, 0)) then yes else no, otmcallstrike6-space, putOptionvolume6a, Color.red, no);

def otmcallstrike7 = CallStrike + strikeSpacing * 7;
plot otmcall6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7 / division, 0)) then otmcallstrike7 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume7 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7 / division, 0)) then yes else no, otmcallstrike7, callOptionvolume7, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume7a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7a / division, 0)) then yes else no, otmcallstrike7-space, putOptionvolume7a, Color.red, no);

def otmcallstrike8 = CallStrike + strikeSpacing * 8;
plot otmcall7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8 / division, 0)) then otmcallstrike8 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume8 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8 / division, 0)) then yes else no, otmcallstrike8, callOptionvolume8, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume8a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8a / division, 0)) then yes else no, otmcallstrike8-space, putOptionvolume8a, Color.red, no);

def otmcallstrike9 = CallStrike + strikeSpacing * 9;
plot otmcall8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9 / division, 0)) then otmcallstrike9 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume9 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9 / division, 0)) then yes else no, otmcallstrike9, callOptionvolume9, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume9a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9a / division, 0)) then yes else no, otmcallstrike9-space, putOptionvolume9a, Color.red, no);

def otmcallstrike10 = CallStrike + strikeSpacing * 10;
plot otmcall9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10 / division, 0)) then otmcallstrike10 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume10 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10 / division, 0)) then yes else no, otmcallstrike10, callOptionvolume10, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume10a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10a / division, 0)) then yes else no, otmcallstrike10-space, putOptionvolume10a, Color.red, no);

def otmcallstrike11 = CallStrike + strikeSpacing * 11;
plot otmcall10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11 / division, 0)) then otmcallstrike11 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume11 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11 / division, 0)) then yes else no, otmcallstrike11, callOptionvolume11, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume11a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11a / division, 0)) then yes else no, otmcallstrike11-space, putOptionvolume11a, Color.red, no);

def otmcallstrike12 = CallStrike + strikeSpacing * 12;
plot otmcall11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12 / division, 0)) then otmcallstrike12 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume12 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12 / division, 0)) then yes else no, otmcallstrike12, callOptionvolume12, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume12a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12a / division, 0)) then yes else no, otmcallstrike12-space, putOptionvolume12a, Color.red, no);

def otmcallstrike13 = CallStrike + strikeSpacing * 13;
plot otmcall12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13 / division, 0)) then otmcallstrike13 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume13 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13 / division, 0)) then yes else no, otmcallstrike13, callOptionvolume13, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume13a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13a / division, 0)) then yes else no, otmcallstrike13-space, putOptionvolume13a, Color.red, no);

def otmcallstrike14 = CallStrike + strikeSpacing * 14;
plot otmcall13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14 / division, 0)) then otmcallstrike14 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume14 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14 / division, 0)) then yes else no, otmcallstrike14,
callOptionvolume14, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume14a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14a / division, 0)) then yes else no, otmcallstrike14-space, putOptionvolume14a, Color.red, no);

def otmcallstrike15 = CallStrike + strikeSpacing * 15;
plot otmcall14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15 / division, 0)) then otmcallstrike15 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume15 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15 / division, 0)) then yes else no, otmcallstrike15, callOptionvolume15, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume15a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15a / division, 0)) then yes else no, otmcallstrike15-space, putOptionvolume15a, Color.red, no);

def otmcallstrike16 = CallStrike + strikeSpacing * 16;
plot otmcall15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16 / division, 0)) then otmcallstrike16 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume16 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16 / division, 0)) then yes else no, otmcallstrike16, callOptionvolume16, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume16a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16a / division, 0)) then yes else no, otmcallstrike16-space, putOptionvolume16a, Color.red, no);

def otmcallstrike17 = CallStrike + strikeSpacing * 17;
plot otmcall16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17 / division, 0)) then otmcallstrike17 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume17 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17 / division, 0)) then yes else no, otmcallstrike17, callOptionvolume17, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume17a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17a / division, 0)) then yes else no, otmcallstrike17-space, putOptionvolume17a, Color.red, no);

def otmcallstrike18 = CallStrike + strikeSpacing * 18;
plot otmcall17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18 / division, 0)) then otmcallstrike18 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume18 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18 / division, 0)) then yes else no, otmcallstrike18, callOptionvolume18, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume18a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18a / division, 0)) then yes else no, otmcallstrike18-space, putOptionvolume18a, Color.red, no);

def otmcallstrike19 = CallStrike + strikeSpacing * 19;
plot otmcall18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19 / division, 0)) then otmcallstrike19 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume19 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19 / division, 0)) then yes else no, otmcallstrike19, callOptionvolume19, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume19a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19a / division, 0)) then yes else no, otmcallstrike19-space, putOptionvolume19a, Color.red, no);

def otmcallstrike20 = CallStrike + strikeSpacing * 20;
plot otmcall19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20 / division, 0)) then otmcallstrike20 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume20 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20 / division, 0)) then yes else no, otmcallstrike20, callOptionvolume20, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume20a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20a / division, 0)) then yes else no, otmcallstrike20-space, putOptionvolume20a, Color.red, no);


def itmcallstrike1 = CallStrike - strikeSpacing;
plot itmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolumea / division, 0)) then itmcallstrike1 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume1a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1a / division, 0)) then yes else no, itmcallstrike1, callOptionvolume1a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume1 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1 / division, 0)) then yes else no, itmcallstrike1-space, putOptionvolume1, Color.red, no);

def itmcallstrike2 = CallStrike - strikeSpacing * 2;
plot itmcall1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2a / division, 0)) then itmcallstrike2 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume2a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2a / division, 0)) then yes else no, itmcallstrike2, callOptionvolume2a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume2 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2 / division, 0)) then yes else no, itmcallstrike2-space, putOptionvolume2, Color.red, no);

def itmcallstrike3 = CallStrike - strikeSpacing * 3;
plot itmcall2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3a / division, 0)) then itmcallstrike3 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume3a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3a / division, 0)) then yes else no, itmcallstrike3, callOptionvolume3a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume3 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3 / division, 0)) then yes else no, itmcallstrike3-space, putOptionvolume3, Color.red, no);

def itmcallstrike4 = CallStrike - strikeSpacing * 4;
plot itmcall3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4a / division, 0)) then itmcallstrike4 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume4a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4a / division, 0)) then yes else no, itmcallstrike4, callOptionvolume4a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume4 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4 / division, 0)) then yes else no, itmcallstrike4-space, putOptionvolume4, Color.red, no);

def itmcallstrike5 = CallStrike - strikeSpacing * 5;
plot itmcall4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5a / division, 0)) then itmcallstrike5 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume5a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5a / division, 0)) then yes else no, itmcallstrike5, callOptionvolume5a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume5 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5 / division, 0)) then yes else no, itmcallstrike5-space, putOptionvolume5, Color.red, no);

def itmcallstrike6 = CallStrike - strikeSpacing * 6;
plot itmcall5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6a / division, 0)) then itmcallstrike6 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume6a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6a / division, 0)) then yes else no, itmcallstrike6, callOptionvolume6a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume6 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6 / division, 0)) then yes else no, itmcallstrike6-space, putOptionvolume6, Color.red, no);

def itmcallstrike7 = CallStrike - strikeSpacing * 7;
plot itmcall6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7a / division, 0)) then itmcallstrike7 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume7a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7a / division, 0)) then yes else no, itmcallstrike7, callOptionvolume7a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume7 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7 / division, 0)) then yes else no, itmcallstrike7-space, putOptionvolume7, Color.red, no);

def itmcallstrike8 = CallStrike - strikeSpacing * 8;
plot itmcall7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8a / division, 0)) then itmcallstrike8 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume8a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8a / division, 0)) then yes else no, itmcallstrike8, callOptionvolume8a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume8 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8 / division, 0)) then yes else no, itmcallstrike8-space, putOptionvolume8, Color.red, no);

def itmcallstrike9 = CallStrike - strikeSpacing * 9;
plot itmcall8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9a / division, 0)) then itmcallstrike9 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume9a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9a / division, 0)) then yes else no, itmcallstrike9, callOptionvolume9a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume9 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9 / division, 0)) then yes else no, itmcallstrike9-space, putOptionvolume9, Color.red, no);

def itmcallstrike10 = CallStrike - strikeSpacing * 10;
plot itmcall9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10a / division, 0)) then itmcallstrike10 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume10a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10a / division, 0)) then yes else no, itmcallstrike10, callOptionvolume10a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume10 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10 / division, 0)) then yes else no, itmcallstrike10-space, putOptionvolume10, Color.red, no);

def itmcallstrike11 = CallStrike - strikeSpacing * 11;
plot itmcall10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11a / division, 0)) then itmcallstrike11 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume11a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11a / division, 0)) then yes else no, itmcallstrike11, callOptionvolume11a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume11 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11 / division, 0)) then yes else no, itmcallstrike11-space, putOptionvolume11, Color.red, no);

def itmcallstrike12 = CallStrike - strikeSpacing * 12;
plot itmcall11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12a / division, 0)) then itmcallstrike12 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume12a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12a / division, 0)) then yes else no, itmcallstrike12, callOptionvolume12a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume12 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12 / division, 0)) then yes else no, itmcallstrike12-space, putOptionvolume12, Color.red, no);

def itmcallstrike13 = CallStrike - strikeSpacing * 13;
plot itmcall12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13a / division, 0)) then itmcallstrike13 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume13a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13a / division, 0)) then yes else no, itmcallstrike13, callOptionvolume13a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume13 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13 / division, 0)) then yes else no, itmcallstrike13-space, putOptionvolume13, Color.red, no);

def itmcallstrike14 = CallStrike - strikeSpacing * 14;
plot itmcall13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14a / division, 0)) then itmcallstrike14 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume14a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14a / division, 0)) then yes else no, itmcallstrike14, callOptionvolume14a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume14 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14 / division, 0)) then yes else no, itmcallstrike14-space, putOptionvolume14, Color.red, no);

def itmcallstrike15 = CallStrike - strikeSpacing * 15;
plot itmcall14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15a / division, 0)) then itmcallstrike15 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume15a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15a / division, 0)) then yes else no, itmcallstrike15, callOptionvolume15a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume15 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15 / division, 0)) then yes else no, itmcallstrike15-space, putOptionvolume15, Color.red, no);

def itmcallstrike16 = CallStrike - strikeSpacing * 16;
plot itmcall15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16a / division, 0)) then itmcallstrike16 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume16a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16a / division, 0)) then yes else no, itmcallstrike16, callOptionvolume16a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume16 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16 / division, 0)) then yes else no, itmcallstrike16-space, putOptionvolume16, Color.red, no);

def itmcallstrike17 = CallStrike - strikeSpacing * 17;
plot itmcall16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17a / division, 0)) then itmcallstrike17 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume17a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17a / division, 0)) then yes else no, itmcallstrike17, callOptionvolume17a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume17 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17 / division, 0)) then yes else no, itmcallstrike17-space, putOptionvolume17, Color.red, no);

def itmcallstrike18 = CallStrike - strikeSpacing * 18;
plot itmcall17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18a / division, 0)) then itmcallstrike18 else Double.NaN;

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume18a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18a / division, 0)) then yes else no, itmcallstrike18, callOptionvolume18a, Color.green, yes);

AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume18 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18 / division, 0)) then yes else no, itmcallstrike18-space, putOptionvolume18, Color.red, no);

def itmcallstrike19 = CallStrike - strikeSpacing * 19;
plot itmcall18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19a / division, 0)) then itmcallstrike19 else Double.NaN;
AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume19a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19a / division, 0)) then yes else no, itmcallstrike19, callOptionvolume19a, Color.green, yes);
AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume19 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19 / division, 0)) then yes else no, itmcallstrike19-space, putOptionvolume19, Color.red, no);
def itmcallstrike20 = CallStrike - strikeSpacing * 20;
plot itmcall19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20a / division, 0)) then itmcallstrike20 else Double.NaN;
AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume20a / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20a / division, 0)) then yes else no, itmcallstrike20, callOptionvolume20a, Color.green, yes);
AddChartBubble(if display_bubbles and BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume20 / division, 0)) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20 / division, 0)) then yes else no, itmcallstrike20-space, putOptionvolume20, Color.red, no);


####################
#PUTS
def atmputstrike = PutStrike - space;
plot atmput = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume / division, 0)) then atmputstrike else Double.NaN;
def itmputstrike1 = PutStrike + strikeSpacing - space;
plot itmput = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume1a / division, 0)) then itmputstrike1 else Double.NaN;
def itmPutStrike2 = PutStrike + strikeSpacing * 2 - space;
plot itmput1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume2a / division, 0)) then itmPutStrike2 else Double.NaN;
def itmPutStrike3 = PutStrike + strikeSpacing * 3 - space;
plot itmput2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume3a / division, 0)) then itmPutStrike3 else Double.NaN;
def itmPutStrike4 = PutStrike + strikeSpacing * 4 - space;
plot itmput3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume4a / division, 0)) then itmPutStrike4 else Double.NaN;
def itmPutStrike5 = PutStrike + strikeSpacing * 5 - space;
plot itmput4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume5a / division, 0)) then itmPutStrike5 else Double.NaN;
def itmPutStrike6 = PutStrike + strikeSpacing * 6 - space;
plot itmput5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume6a / division, 0)) then itmPutStrike6 else Double.NaN;
def itmPutStrike7 = PutStrike + strikeSpacing * 7 - space;
plot itmput6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume7a / division, 0)) then itmPutStrike7 else Double.NaN;
def itmPutStrike8 = PutStrike + strikeSpacing * 8 - space;
plot itmput7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume8a / division, 0)) then itmPutStrike8 else Double.NaN;
def itmPutStrike9 = PutStrike + strikeSpacing * 9 - space;
plot itmput8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume9a / division, 0)) then itmPutStrike9 else Double.NaN;
def itmPutStrike10 = PutStrike + strikeSpacing * 10 - space;
plot itmput9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume10a / division, 0)) then itmPutStrike10 else Double.NaN;
def itmPutStrike11 = PutStrike + strikeSpacing * 11 - space;
plot itmput10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume11a / division, 0)) then itmPutStrike11 else Double.NaN;
def itmPutStrike12 = PutStrike + strikeSpacing * 12 - space;
plot itmput11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume12a / division, 0)) then itmPutStrike12 else Double.NaN;
def itmPutStrike13 = PutStrike + strikeSpacing * 13 - space;
plot itmput12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume13a / division, 0)) then itmPutStrike13 else Double.NaN;
def itmPutStrike14 = PutStrike + strikeSpacing * 14 - space;
plot itmput13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume14a / division, 0)) then itmPutStrike14 else Double.NaN;
def itmPutStrike15 = PutStrike + strikeSpacing * 15 - space;
plot itmput14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume15a / division, 0)) then itmPutStrike15 else Double.NaN;
def itmPutStrike16 = PutStrike + strikeSpacing * 16 - space;
plot itmput15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume16a / division, 0)) then itmPutStrike16 else Double.NaN;
def itmPutStrike17 = PutStrike + strikeSpacing * 17 - space;
plot itmput16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume17a / division, 0)) then itmPutStrike17 else Double.NaN;
def itmPutStrike18 = PutStrike + strikeSpacing * 18 - space;
plot itmput17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume18a / division, 0)) then itmPutStrike18 else Double.NaN;
def itmPutStrike19 = PutStrike + strikeSpacing * 19 - space;
plot itmput18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume19a / division, 0)) then itmPutStrike19 else Double.NaN;
def itmPutStrike20 = PutStrike + strikeSpacing * 20 - space;
plot itmput19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume20a / division, 0)) then itmPutStrike20 else Double.NaN;

def otmputstrike1 = PutStrike - strikeSpacing - space;
plot otmput = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume1 / division, 0)) then otmputstrike1 else Double.NaN;
def otmputStrike2 = PutStrike - strikeSpacing * 2 - space;
plot otmput1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume2 / division, 0)) then otmputStrike2 else Double.NaN;
def otmputStrike3 = PutStrike - strikeSpacing * 3 - space;
plot otmput2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume3 / division, 0)) then otmputStrike3 else Double.NaN;
def otmputStrike4 = PutStrike - strikeSpacing * 4 - space;
plot otmput3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume4 / division, 0)) then otmputStrike4 else Double.NaN;
def otmputStrike5 = PutStrike - strikeSpacing * 5 - space;
plot otmput4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume5 / division, 0)) then otmputStrike5 else Double.NaN;
def otmputStrike6 = PutStrike - strikeSpacing * 6 - space;
plot otmput5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume6 / division, 0)) then otmputStrike6 else Double.NaN;
def otmputStrike7 = PutStrike - strikeSpacing * 7 - space;
plot otmput6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume7 / division, 0)) then otmputStrike7 else Double.NaN;
def otmputStrike8 = PutStrike - strikeSpacing * 8 - space;
plot otmput7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume8 / division, 0)) then otmputStrike8 else Double.NaN;
def otmputStrike9 = PutStrike - strikeSpacing * 9 - space;
plot otmput8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume9 / division, 0)) then otmputStrike9 else Double.NaN;
def otmputStrike10 = PutStrike - strikeSpacing * 10 - space;
plot otmput9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume10 / division, 0)) then otmputStrike10 else Double.NaN;
def otmputStrike11 = PutStrike - strikeSpacing * 11 - space;
plot otmput10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume11 / division, 0)) then otmputStrike11 else Double.NaN;
def otmputStrike12 = PutStrike - strikeSpacing * 12 - space;
plot otmput11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume12 / division, 0)) then otmputStrike12 else Double.NaN;
def otmputStrike13 = PutStrike - strikeSpacing * 13 - space;
plot otmput12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume13 / division, 0)) then otmputStrike13 else Double.NaN;
def otmputStrike14 = PutStrike - strikeSpacing * 14 - space;
plot otmput13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume14 / division, 0)) then otmputStrike14 else Double.NaN;
def otmputStrike15 = PutStrike - strikeSpacing * 15 - space;
plot otmput14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume15 / division, 0)) then otmputStrike15 else Double.NaN;
def otmputStrike16 = PutStrike - strikeSpacing * 16 - space;
plot otmput15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume16 / division, 0)) then otmputStrike16 else Double.NaN;
def otmputStrike17 = PutStrike - strikeSpacing * 17 - space;
plot otmput16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume17 / division, 0)) then otmputStrike17 else Double.NaN;
def otmputStrike18 = PutStrike - strikeSpacing * 18 - space;
plot otmput17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume18 / division, 0)) then otmputStrike18 else Double.NaN;
def otmputStrike19 = PutStrike - strikeSpacing * 19 - space;
plot otmput18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume19 / division, 0)) then otmputStrike19 else Double.NaN;
def otmputStrike20 = PutStrike - strikeSpacing * 20 - space;
plot otmput19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionVolume20 / division, 0)) then otmputStrike20 else Double.NaN;

atmcall.SetPaintingStrategy(PaintingStrategy.LINE);
atmcall.SetLineWeight(5);
atmcall.SetDefaultColor(GlobalColor("CallColor"));
otmcall.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall.SetLineWeight(5);
otmcall.SetDefaultColor(GlobalColor("CallColor"));
otmcall1.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall1.SetLineWeight(5);
otmcall1.SetDefaultColor(GlobalColor("CallColor"));
otmcall2.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall2.SetLineWeight(5);
otmcall2.SetDefaultColor(GlobalColor("CallColor"));
otmcall3.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall3.SetLineWeight(5);
otmcall3.SetDefaultColor(GlobalColor("CallColor"));
otmcall4.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall4.SetLineWeight(5);
otmcall4.SetDefaultColor(GlobalColor("CallColor"));
otmcall5.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall5.SetLineWeight(5);
otmcall5.SetDefaultColor(GlobalColor("CallColor"));
otmcall6.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall6.SetLineWeight(5);
otmcall6.SetDefaultColor(GlobalColor("CallColor"));
otmcall7.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall7.SetLineWeight(5);
otmcall7.SetDefaultColor(GlobalColor("CallColor"));
otmcall8.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall8.SetLineWeight(5);
otmcall8.SetDefaultColor(GlobalColor("CallColor"));
otmcall9.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall9.SetLineWeight(5);
otmcall9.SetDefaultColor(GlobalColor("CallColor"));
otmcall10.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall10.SetLineWeight(5);
otmcall10.SetDefaultColor(GlobalColor("CallColor"));
otmcall11.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall11.SetLineWeight(5);
otmcall11.SetDefaultColor(GlobalColor("CallColor"));
otmcall12.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall12.SetLineWeight(5);
otmcall12.SetDefaultColor(GlobalColor("CallColor"));
otmcall13.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall13.SetLineWeight(5);
otmcall13.SetDefaultColor(GlobalColor("CallColor"));
otmcall14.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall14.SetLineWeight(5);
otmcall14.SetDefaultColor(GlobalColor("CallColor"));
otmcall15.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall15.SetLineWeight(5);
otmcall15.SetDefaultColor(GlobalColor("CallColor"));
otmcall16.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall16.SetLineWeight(5);
otmcall16.SetDefaultColor(GlobalColor("CallColor"));
otmcall17.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall17.SetLineWeight(5);
otmcall17.SetDefaultColor(GlobalColor("CallColor"));
otmcall18.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall18.SetLineWeight(5);
otmcall18.SetDefaultColor(GlobalColor("CallColor"));
otmcall19.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall19.SetLineWeight(5);
otmcall19.SetDefaultColor(GlobalColor("CallColor"));

itmcall.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall.SetLineWeight(5);
itmcall.SetDefaultColor(GlobalColor("CallColor"));
itmcall1.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall1.SetLineWeight(5);
itmcall1.SetDefaultColor(GlobalColor("CallColor"));
itmcall2.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall2.SetLineWeight(5);
itmcall2.SetDefaultColor(GlobalColor("CallColor"));
itmcall3.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall3.SetLineWeight(5);
itmcall3.SetDefaultColor(GlobalColor("CallColor"));
itmcall4.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall4.SetLineWeight(5);
itmcall4.SetDefaultColor(GlobalColor("CallColor"));
itmcall5.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall5.SetLineWeight(5);
itmcall5.SetDefaultColor(GlobalColor("CallColor"));
itmcall6.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall6.SetLineWeight(5);
itmcall6.SetDefaultColor(GlobalColor("CallColor"));
itmcall7.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall7.SetLineWeight(5);
itmcall7.SetDefaultColor(GlobalColor("CallColor"));
itmcall8.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall8.SetLineWeight(5);
itmcall8.SetDefaultColor(GlobalColor("CallColor"));
itmcall9.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall9.SetLineWeight(5);
itmcall9.SetDefaultColor(GlobalColor("CallColor"));
itmcall10.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall10.SetLineWeight(5);
itmcall10.SetDefaultColor(GlobalColor("CallColor"));
itmcall11.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall11.SetLineWeight(5);
itmcall11.SetDefaultColor(GlobalColor("CallColor"));
itmcall12.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall12.SetLineWeight(5);
itmcall12.SetDefaultColor(GlobalColor("CallColor"));
itmcall13.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall13.SetLineWeight(5);
itmcall13.SetDefaultColor(GlobalColor("CallColor"));
itmcall14.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall14.SetLineWeight(5);
itmcall14.SetDefaultColor(GlobalColor("CallColor"));
itmcall15.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall15.SetLineWeight(5);
itmcall15.SetDefaultColor(GlobalColor("CallColor"));
itmcall16.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall16.SetLineWeight(5);
itmcall16.SetDefaultColor(GlobalColor("CallColor"));
itmcall17.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall17.SetLineWeight(5);
itmcall17.SetDefaultColor(GlobalColor("CallColor"));
itmcall18.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall18.SetLineWeight(5);
itmcall18.SetDefaultColor(GlobalColor("CallColor"));
itmcall19.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall19.SetLineWeight(5);
itmcall19.SetDefaultColor(GlobalColor("CallColor"));

atmput.SetPaintingStrategy(PaintingStrategy.LINE);
atmput.SetLineWeight(5);
atmput.SetDefaultColor(GlobalColor("PutColor"));
itmput.SetPaintingStrategy(PaintingStrategy.LINE);
itmput.SetLineWeight(5);
itmput.SetDefaultColor(GlobalColor("PutColor"));
itmput1.SetPaintingStrategy(PaintingStrategy.LINE);
itmput1.SetLineWeight(5);
itmput1.SetDefaultColor(GlobalColor("PutColor"));
itmput2.SetPaintingStrategy(PaintingStrategy.LINE);
itmput2.SetLineWeight(5);
itmput2.SetDefaultColor(GlobalColor("PutColor"));
itmput3.SetPaintingStrategy(PaintingStrategy.LINE);
itmput3.SetLineWeight(5);
itmput3.SetDefaultColor(GlobalColor("PutColor"));
itmput4.SetPaintingStrategy(PaintingStrategy.LINE);
itmput4.SetLineWeight(5);
itmput4.SetDefaultColor(GlobalColor("PutColor"));
itmput5.SetPaintingStrategy(PaintingStrategy.LINE);
itmput5.SetLineWeight(5);
itmput5.SetDefaultColor(GlobalColor("PutColor"));
itmput6.SetPaintingStrategy(PaintingStrategy.LINE);
itmput6.SetLineWeight(5);
itmput6.SetDefaultColor(GlobalColor("PutColor"));
itmput7.SetPaintingStrategy(PaintingStrategy.LINE);
itmput7.SetLineWeight(5);
itmput7.SetDefaultColor(GlobalColor("PutColor"));
itmput8.SetPaintingStrategy(PaintingStrategy.LINE);
itmput8.SetLineWeight(5);
itmput8.SetDefaultColor(GlobalColor("PutColor"));
itmput9.SetPaintingStrategy(PaintingStrategy.LINE);
itmput9.SetLineWeight(5);
itmput9.SetDefaultColor(GlobalColor("PutColor"));
itmput10.SetPaintingStrategy(PaintingStrategy.LINE);
itmput10.SetLineWeight(5);
itmput10.SetDefaultColor(GlobalColor("PutColor"));
itmput11.SetPaintingStrategy(PaintingStrategy.LINE);
itmput11.SetLineWeight(5);
itmput11.SetDefaultColor(GlobalColor("PutColor"));
itmput12.SetPaintingStrategy(PaintingStrategy.LINE);
itmput12.SetLineWeight(5);
itmput12.SetDefaultColor(GlobalColor("PutColor"));
itmput13.SetPaintingStrategy(PaintingStrategy.LINE);
itmput13.SetLineWeight(5);
itmput13.SetDefaultColor(GlobalColor("PutColor"));
itmput14.SetPaintingStrategy(PaintingStrategy.LINE);
itmput14.SetLineWeight(5);
itmput14.SetDefaultColor(GlobalColor("PutColor"));
itmput15.SetPaintingStrategy(PaintingStrategy.LINE);
itmput15.SetLineWeight(5);
itmput15.SetDefaultColor(GlobalColor("PutColor"));
itmput16.SetPaintingStrategy(PaintingStrategy.LINE);
itmput16.SetLineWeight(5);
itmput16.SetDefaultColor(GlobalColor("PutColor"));
itmput17.SetPaintingStrategy(PaintingStrategy.LINE);
itmput17.SetLineWeight(5);
itmput17.SetDefaultColor(GlobalColor("PutColor"));
itmput18.SetPaintingStrategy(PaintingStrategy.LINE);
itmput18.SetLineWeight(5);
itmput18.SetDefaultColor(GlobalColor("PutColor"));
itmput19.SetPaintingStrategy(PaintingStrategy.LINE);
itmput19.SetLineWeight(5);
itmput19.SetDefaultColor(GlobalColor("PutColor"));





otmput.SetPaintingStrategy(PaintingStrategy.LINE);
otmput.SetLineWeight(5);
otmput.SetDefaultColor(GlobalColor("PutColor"));
otmput1.SetPaintingStrategy(PaintingStrategy.LINE);
otmput1.SetLineWeight(5);
otmput1.SetDefaultColor(GlobalColor("PutColor"));
otmput2.SetPaintingStrategy(PaintingStrategy.LINE);
otmput2.SetLineWeight(5);
otmput2.SetDefaultColor(GlobalColor("PutColor"));
otmput3.SetPaintingStrategy(PaintingStrategy.LINE);
otmput3.SetLineWeight(5);
otmput3.SetDefaultColor(GlobalColor("PutColor"));
otmput4.SetPaintingStrategy(PaintingStrategy.LINE);
otmput4.SetLineWeight(5);
otmput4.SetDefaultColor(GlobalColor("PutColor"));
otmput5.SetPaintingStrategy(PaintingStrategy.LINE);
otmput5.SetLineWeight(5);
otmput5.SetDefaultColor(GlobalColor("PutColor"));
otmput6.SetPaintingStrategy(PaintingStrategy.LINE);
otmput6.SetLineWeight(5);
otmput6.SetDefaultColor(GlobalColor("PutColor"));
otmput7.SetPaintingStrategy(PaintingStrategy.LINE);
otmput7.SetLineWeight(5);
otmput7.SetDefaultColor(GlobalColor("PutColor"));
otmput8.SetPaintingStrategy(PaintingStrategy.LINE);
otmput8.SetLineWeight(5);
otmput8.SetDefaultColor(GlobalColor("PutColor"));
otmput9.SetPaintingStrategy(PaintingStrategy.LINE);
otmput9.SetLineWeight(5);
otmput9.SetDefaultColor(GlobalColor("PutColor"));
otmput10.SetPaintingStrategy(PaintingStrategy.LINE);
otmput10.SetLineWeight(5);
otmput10.SetDefaultColor(GlobalColor("PutColor"));
otmput11.SetPaintingStrategy(PaintingStrategy.LINE);
otmput11.SetLineWeight(5);
otmput11.SetDefaultColor(GlobalColor("PutColor"));
otmput12.SetPaintingStrategy(PaintingStrategy.LINE);
otmput12.SetLineWeight(5);
otmput12.SetDefaultColor(GlobalColor("PutColor"));
otmput13.SetPaintingStrategy(PaintingStrategy.LINE);
otmput13.SetLineWeight(5);
otmput13.SetDefaultColor(GlobalColor("PutColor"));
otmput14.SetPaintingStrategy(PaintingStrategy.LINE);
otmput14.SetLineWeight(5);
otmput14.SetDefaultColor(GlobalColor("PutColor"));
otmput15.SetPaintingStrategy(PaintingStrategy.LINE);
otmput15.SetLineWeight(5);
otmput15.SetDefaultColor(GlobalColor("PutColor"));
otmput16.SetPaintingStrategy(PaintingStrategy.LINE);
otmput16.SetLineWeight(5);
otmput16.SetDefaultColor(GlobalColor("PutColor"));
otmput17.SetPaintingStrategy(PaintingStrategy.LINE);
otmput17.SetLineWeight(5);
otmput17.SetDefaultColor(GlobalColor("PutColor"));
otmput18.SetPaintingStrategy(PaintingStrategy.LINE);
otmput18.SetLineWeight(5);
otmput18.SetDefaultColor(GlobalColor("PutColor"));
otmput19.SetPaintingStrategy(PaintingStrategy.LINE);
otmput19.SetLineWeight(5);
otmput19.SetDefaultColor(GlobalColor("PutColor"));
I would love to try this, but so far, the code is not working for me completely. I can only get the label to output put/call volume but it is not plotting the vertical or levels as seen in the photo. Can you provide any further explanation? Has anyone else tried using it with success?
 
Last edited:
I would love to try this, but so far, the code is not working for me completely. I can only get the label to output put/call volume but it is not plotting the vertical or levels as seen in the photo. Can you provide any further explanation? Has anyone else tried using it with success?
Hey. Here is an updated version. Works during market hours. Increase the expansion area to the right.

Code:
# volume_vertical_axis_manual_spx_v3
# Update Nov 6, 2023. Updated datestring
# @2187Nick
declare upper;
declare once_per_bar;
def CurrentYear = GetYear()-2000;
def CurrentMonth = GetMonth();
def CurrentDOM = GetDayOfMonth(GetYYYYMMDD()); #+1;

input symbol = "SPXW";
input strikeSpacing = 5.0;
input roundup = no;
input shift_line_right = 10;# negative numbers plot in candle area, positive in expansion
input division = 1000; # divides the open interest by this number. Gives user option to reduce size of bar plots.
input space = 1.00; # the vertical space between the put open interest bar and call open interest bar.
def DateString_auto = CurrentYear * 10000 + CurrentMonth * 100 + CurrentDOM;

input ManuallySetExpiration = {default "false", "true"};
input Expiration_YYMMDD = 231117;
def DateString = if manuallysetexpiration then Expiration_YYMMDD else DateString_auto;

DefineGlobalColor("CallColor", Color.GREEN);
DefineGlobalColor("PutColor", Color.RED);
AddLabel(yes,  "EXP: " + AsPrice(DateString) + "C", GlobalColor("CallColor"));
AddLabel(yes,  "EXP: " + AsPrice(DateString) + "P", GlobalColor("PutColor"));
def agg = AggregationPeriod.DAY;

def openlevel = close(period = agg);
def floor_or_ceiling = if roundup then Ceil(openlevel / 10) * 10 else Floor(openlevel / 10) * 10;
def PutStrike = floor_or_ceiling;
def CallStrike = floor_or_ceiling;

### Put Option volume
def putOptionvolume = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 0), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 0), agg);

def putOptionvolume1 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 1), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 1), agg);
def putOptionvolume2 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 2), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 2), agg);
def putOptionvolume3 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 3), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 3), agg);
def putOptionvolume4 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 4), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 4), agg);
def putOptionvolume5 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 5), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 5), agg);
def putOptionvolume6 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 6), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 6), agg);
def putOptionvolume7 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 7), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 7), agg);
def putOptionvolume8 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 8), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 8), agg);
def putOptionvolume9 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 9), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 9), agg);
def putOptionvolume10 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 10), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 10), agg);
def putOptionvolume11 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 11), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 11), agg);
def putOptionvolume12 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 12), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 12), agg);
def putOptionvolume13 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 13), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 13), agg);
def putOptionvolume14 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 14), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 14), agg);
def putOptionvolume15 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 15), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 15), agg);
def putOptionvolume16 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 16), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 16), agg);
def putOptionvolume17 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 17), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 17), agg);
def putOptionvolume18 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 18), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 18), agg);
def putOptionvolume19 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 19), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 19), agg);
def putOptionvolume20 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 20), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 20), agg);

def putOptionvolumea = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 0), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 0), agg);
def putOptionvolume1a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 1), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 1), agg);
def putOptionvolume2a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 2), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 2), agg);
def putOptionvolume3a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 3), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 3), agg);
def putOptionvolume4a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 4), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 4), agg);
def putOptionvolume5a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 5), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 5), agg);
def putOptionvolume6a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 6), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 6), agg);
def putOptionvolume7a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 7), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 7), agg);
def putOptionvolume8a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 8), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 8), agg);
def putOptionvolume9a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 9), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 9), agg);
def putOptionvolume10a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 10), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 10), agg);
def putOptionvolume11a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 11), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 11), agg);
def putOptionvolume12a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 12), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 12), agg);
def putOptionvolume13a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 13), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 13), agg);
def putOptionvolume14a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 14), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 14), agg);
def putOptionvolume15a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 15), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 15), agg);
def putOptionvolume16a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 16), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 16), agg);
def putOptionvolume17a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 17), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 17), agg);
def putOptionvolume18a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 18), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 18), agg);
def putOptionvolume19a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 19), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 19), agg);
def putOptionvolume20a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 20), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 20), agg);

###Call Option volume
def callOptionvolume = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 0), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 0), agg);

def callOptionvolume1 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 1), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 1), agg);
def callOptionvolume2 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 2), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 2), agg);
def callOptionvolume3 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 3), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 3), agg);
def callOptionvolume4 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 4), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 4), agg);
def callOptionvolume5 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 5), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 5), agg);
def callOptionvolume6 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 6), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 6), agg);
def callOptionvolume7 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 7), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 7), agg);
def callOptionvolume8 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 8), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 8), agg);
def callOptionvolume9 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 9), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 9), agg);
def callOptionvolume10 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 10), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 10), agg);
def callOptionvolume11 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 11), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 11), agg);
def callOptionvolume12 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 12), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 12), agg);
def callOptionvolume13 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 13), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 13), agg);
def callOptionvolume14 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 14), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 14), agg);
def callOptionvolume15 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 15), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 15), agg);
def callOptionvolume16 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 16), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 16), agg);
def callOptionvolume17 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 17), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 17), agg);
def callOptionvolume18 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 18), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 18), agg);
def callOptionvolume19 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 19), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 19), agg);
def callOptionvolume20 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 20), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 20), agg);

def callOptionvolumea = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 0), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 0), agg);
def callOptionvolume1a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 1), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 1), agg);
def callOptionvolume2a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 2), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 2), agg);
def callOptionvolume3a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 3), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 3), agg);
def callOptionvolume4a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 4), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 4), agg);
def callOptionvolume5a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 5), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 5), agg);
def callOptionvolume6a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 6), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 6), agg);
def callOptionvolume7a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 7), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 7), agg);
def callOptionvolume8a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 8), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 8), agg);
def callOptionvolume9a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 9), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 9), agg);
def callOptionvolume10a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 10), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 10), agg);
def callOptionvolume11a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 11), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 11), agg);
def callOptionvolume12a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 12), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 12), agg);
def callOptionvolume13a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 13), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 13), agg);
def callOptionvolume14a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 14), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 14), agg);
def callOptionvolume15a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 15), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 15), agg);
def callOptionvolume16a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 16), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 16), agg);
def callOptionvolume17a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 17), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 17), agg);
def callOptionvolume18a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 18), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 18), agg);
def callOptionvolume19a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 19), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 19), agg);
def callOptionvolume20a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 20), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 20), agg);

#####################################

def lastbar = if IsNaN(close[-1]) and !IsNaN(close) 
              then BarNumber() 
              else lastbar[1];

AddVerticalLine(BarNumber() >= HighestAll(lastbar +  shift_line_right) and  BarNumber() <= HighestAll(lastbar +  shift_line_right), "Live  volume",color.white,Curve.LONG_DASH);

## We plot the volume using tos bar numbers. Normally a full horizontal line would be
## plotted across then full length of the chart. Using if statement I narrow down the area of the line
## that is plotted. Example: atmcall( plot line from bar#: (lastbar + 10) to bar#(lastbar+10+ callOptionvolume);

def atmcallstrike = CallStrike;
plot atmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume / division, 0)) then atmcallstrike else Double.NaN;




AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume / division, 0)) then yes else no, atmcallstrike, callOptionvolume, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume / division, 0)) then yes else no, atmcallstrike-space, putOptionvolume, Color.red, no);

def otmcallstrike1 = CallStrike + strikeSpacing;
plot otmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1 / division, 0)) then otmcallstrike1 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume1 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1 / division, 0)) then yes else no, otmcallstrike1, callOptionvolume1, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume1a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1a / division, 0)) then yes else no, otmcallstrike1-space, putOptionvolume1a, Color.red, no);

def otmcallstrike2 = CallStrike + strikeSpacing * 2;
plot otmcall1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2 / division, 0)) then otmcallstrike2 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume2 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2 / division, 0)) then yes else no, otmcallstrike2, callOptionvolume2, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume2a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2a / division, 0)) then yes else no, otmcallstrike2-space, putOptionvolume2a, Color.red, no);

def otmcallstrike3 = CallStrike + strikeSpacing * 3;
plot otmcall2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3 / division, 0)) then otmcallstrike3 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume3 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3 / division, 0)) then yes else no, otmcallstrike3, callOptionvolume3, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume3a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3a / division, 0)) then yes else no, otmcallstrike3-space, putOptionvolume3a, Color.red, no);

def otmcallstrike4 = CallStrike + strikeSpacing * 4;
plot otmcall3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4 / division, 0)) then otmcallstrike4 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume4 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4 / division, 0)) then yes else no, otmcallstrike4, callOptionvolume4, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume4a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4a / division, 0)) then yes else no, otmcallstrike4-space, putOptionvolume4a, Color.red, no);

def otmcallstrike5 = CallStrike + strikeSpacing * 5;
plot otmcall4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5 / division, 0)) then otmcallstrike5 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume5 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5 / division, 0)) then yes else no, otmcallstrike5, callOptionvolume5, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume5a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5a / division, 0)) then yes else no, otmcallstrike5-space, putOptionvolume5a, Color.red, no);

def otmcallstrike6 = CallStrike + strikeSpacing * 6;
plot otmcall5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6 / division, 0)) then otmcallstrike6 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume6 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6 / division, 0)) then yes else no, otmcallstrike6, callOptionvolume6, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume6a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6a / division, 0)) then yes else no, otmcallstrike6-space, putOptionvolume6a, Color.red, no);
def otmcallstrike7 = CallStrike + strikeSpacing * 7;
plot otmcall6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7 / division, 0)) then otmcallstrike7 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume7 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7 / division, 0)) then yes else no, otmcallstrike7, callOptionvolume7, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume7a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7a / division, 0)) then yes else no, otmcallstrike7-space, putOptionvolume7a, Color.red, no);
def otmcallstrike8 = CallStrike + strikeSpacing * 8;
plot otmcall7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8 / division, 0)) then otmcallstrike8 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume8 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8 / division, 0)) then yes else no, otmcallstrike8, callOptionvolume8, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume8a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8a / division, 0)) then yes else no, otmcallstrike8-space, putOptionvolume8a, Color.red, no);
def otmcallstrike9 = CallStrike + strikeSpacing * 9;
plot otmcall8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9 / division, 0)) then otmcallstrike9 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume9 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9 / division, 0)) then yes else no, otmcallstrike9, callOptionvolume9, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume9a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9a / division, 0)) then yes else no, otmcallstrike9-space, putOptionvolume9a, Color.red, no);
def otmcallstrike10 = CallStrike + strikeSpacing * 10;
plot otmcall9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10 / division, 0)) then otmcallstrike10 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume10 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10 / division, 0)) then yes else no, otmcallstrike10, callOptionvolume10, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume10a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10a / division, 0)) then yes else no, otmcallstrike10-space, putOptionvolume10a, Color.red, no);
def otmcallstrike11 = CallStrike + strikeSpacing * 11;
plot otmcall10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11 / division, 0)) then otmcallstrike11 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume11 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11 / division, 0)) then yes else no, otmcallstrike11, callOptionvolume11, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume11a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11a / division, 0)) then yes else no, otmcallstrike11-space, putOptionvolume11a, Color.red, no);
def otmcallstrike12 = CallStrike + strikeSpacing * 12;
plot otmcall11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12 / division, 0)) then otmcallstrike12 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume12 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12 / division, 0)) then yes else no, otmcallstrike12, callOptionvolume12, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume12a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12a / division, 0)) then yes else no, otmcallstrike12-space, putOptionvolume12a, Color.red, no);
def otmcallstrike13 = CallStrike + strikeSpacing * 13;
plot otmcall12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13 / division, 0)) then otmcallstrike13 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume13 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13 / division, 0)) then yes else no, otmcallstrike13, callOptionvolume13, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume13a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13a / division, 0)) then yes else no, otmcallstrike13-space, putOptionvolume13a, Color.red, no);
def otmcallstrike14 = CallStrike + strikeSpacing * 14;
plot otmcall13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14 / division, 0)) then otmcallstrike14 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume14 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14 / division, 0)) then yes else no, otmcallstrike14, callOptionvolume14, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume14a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14a / division, 0)) then yes else no, otmcallstrike14-space, putOptionvolume14a, Color.red, no);
def otmcallstrike15 = CallStrike + strikeSpacing * 15;
plot otmcall14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15 / division, 0)) then otmcallstrike15 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume15 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15 / division, 0)) then yes else no, otmcallstrike15, callOptionvolume15, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume15a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15a / division, 0)) then yes else no, otmcallstrike15-space, putOptionvolume15a, Color.red, no);
def otmcallstrike16 = CallStrike + strikeSpacing * 16;
plot otmcall15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16 / division, 0)) then otmcallstrike16 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume16 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16 / division, 0)) then yes else no, otmcallstrike16, callOptionvolume16, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume16a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16a / division, 0)) then yes else no, otmcallstrike16-space, putOptionvolume16a, Color.red, no);
def otmcallstrike17 = CallStrike + strikeSpacing * 17;
plot otmcall16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17 / division, 0)) then otmcallstrike17 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume17 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17 / division, 0)) then yes else no, otmcallstrike17, callOptionvolume17, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume17a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17a / division, 0)) then yes else no, otmcallstrike17-space, putOptionvolume17a, Color.red, no);
def otmcallstrike18 = CallStrike + strikeSpacing * 18;
plot otmcall17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18 / division, 0)) then otmcallstrike18 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume18 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18 / division, 0)) then yes else no, otmcallstrike18, callOptionvolume18, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume18a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18a / division, 0)) then yes else no, otmcallstrike18-space, putOptionvolume18a, Color.red, no);
def otmcallstrike19 = CallStrike + strikeSpacing * 19;
plot otmcall18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19 / division, 0)) then otmcallstrike19 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume19 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19 / division, 0)) then yes else no, otmcallstrike19, callOptionvolume19, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume19a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19a / division, 0)) then yes else no, otmcallstrike19-space, putOptionvolume19a, Color.red, no);
def otmcallstrike20 = CallStrike + strikeSpacing * 20;
plot otmcall19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20 / division, 0)) then otmcallstrike20 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume20 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20 / division, 0)) then yes else no, otmcallstrike20, callOptionvolume20, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume20a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20a / division, 0)) then yes else no, otmcallstrike20-space, putOptionvolume20a, Color.red, no);


def itmcallstrike1 = CallStrike - strikeSpacing;
plot itmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolumea / division, 0)) then itmcallstrike1 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume1a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1a / division, 0)) then yes else no, itmcallstrike1, callOptionvolume1a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume1 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1 / division, 0)) then yes else no, itmcallstrike1-space, putOptionvolume1, Color.red, no);

def itmcallstrike2 = CallStrike - strikeSpacing * 2;
plot itmcall1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2a / division, 0)) then itmcallstrike2 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume2a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2a / division, 0)) then yes else no, itmcallstrike2, callOptionvolume2a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume2 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2 / division, 0)) then yes else no, itmcallstrike2-space, putOptionvolume2, Color.red, no);
def itmcallstrike3 = CallStrike - strikeSpacing * 3;
plot itmcall2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3a / division, 0)) then itmcallstrike3 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume3a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3a / division, 0)) then yes else no, itmcallstrike3, callOptionvolume3a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume3 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3 / division, 0)) then yes else no, itmcallstrike3-space, putOptionvolume3, Color.red, no);
def itmcallstrike4 = CallStrike - strikeSpacing * 4;
plot itmcall3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4a / division, 0)) then itmcallstrike4 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume4a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4a / division, 0)) then yes else no, itmcallstrike4, callOptionvolume4a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume4 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4 / division, 0)) then yes else no, itmcallstrike4-space, putOptionvolume4, Color.red, no);
def itmcallstrike5 = CallStrike - strikeSpacing * 5;
plot itmcall4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5a / division, 0)) then itmcallstrike5 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume5a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5a / division, 0)) then yes else no, itmcallstrike5, callOptionvolume5a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume5 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5 / division, 0)) then yes else no, itmcallstrike5-space, putOptionvolume5, Color.red, no);
def itmcallstrike6 = CallStrike - strikeSpacing * 6;
plot itmcall5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6a / division, 0)) then itmcallstrike6 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume6a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6a / division, 0)) then yes else no, itmcallstrike6, callOptionvolume6a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume6 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6 / division, 0)) then yes else no, itmcallstrike6-space, putOptionvolume6, Color.red, no);
def itmcallstrike7 = CallStrike - strikeSpacing * 7;
plot itmcall6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7a / division, 0)) then itmcallstrike7 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume7a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7a / division, 0)) then yes else no, itmcallstrike7, callOptionvolume7a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume7 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7 / division, 0)) then yes else no, itmcallstrike7-space, putOptionvolume7, Color.red, no);
def itmcallstrike8 = CallStrike - strikeSpacing * 8;
plot itmcall7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8a / division, 0)) then itmcallstrike8 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume8a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8a / division, 0)) then yes else no, itmcallstrike8, callOptionvolume8a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume8 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8 / division, 0)) then yes else no, itmcallstrike8-space, putOptionvolume8, Color.red, no);
def itmcallstrike9 = CallStrike - strikeSpacing * 9;
plot itmcall8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9a / division, 0)) then itmcallstrike9 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume9a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9a / division, 0)) then yes else no, itmcallstrike9, callOptionvolume9a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume9 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9 / division, 0)) then yes else no, itmcallstrike9-space, putOptionvolume9, Color.red, no);
def itmcallstrike10 = CallStrike - strikeSpacing * 10;
plot itmcall9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10a / division, 0)) then itmcallstrike10 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume10a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10a / division, 0)) then yes else no, itmcallstrike10, callOptionvolume10a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume10 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10 / division, 0)) then yes else no, itmcallstrike10-space, putOptionvolume10, Color.red, no);
def itmcallstrike11 = CallStrike - strikeSpacing * 11;
plot itmcall10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11a / division, 0)) then itmcallstrike11 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume11a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11a / division, 0)) then yes else no, itmcallstrike11, callOptionvolume11a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume11 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11 / division, 0)) then yes else no, itmcallstrike11-space, putOptionvolume11, Color.red, no);
def itmcallstrike12 = CallStrike - strikeSpacing * 12;
plot itmcall11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12a / division, 0)) then itmcallstrike12 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume12a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12a / division, 0)) then yes else no, itmcallstrike12, callOptionvolume12a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume12 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12 / division, 0)) then yes else no, itmcallstrike12-space, putOptionvolume12, Color.red, no);
def itmcallstrike13 = CallStrike - strikeSpacing * 13;
plot itmcall12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13a / division, 0)) then itmcallstrike13 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume13a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13a / division, 0)) then yes else no, itmcallstrike13, callOptionvolume13a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume13 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13 / division, 0)) then yes else no, itmcallstrike13-space, putOptionvolume13, Color.red, no);
def itmcallstrike14 = CallStrike - strikeSpacing * 14;
plot itmcall13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14a / division, 0)) then itmcallstrike14 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume14a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14a / division, 0)) then yes else no, itmcallstrike14, callOptionvolume14a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume14 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14 / division, 0)) then yes else no, itmcallstrike14-space, putOptionvolume14, Color.red, no);
def itmcallstrike15 = CallStrike - strikeSpacing * 15;
plot itmcall14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15a / division, 0)) then itmcallstrike15 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume15a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15a / division, 0)) then yes else no, itmcallstrike15, callOptionvolume15a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume15 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15 / division, 0)) then yes else no, itmcallstrike15-space, putOptionvolume15, Color.red, no);
def itmcallstrike16 = CallStrike - strikeSpacing * 16;
plot itmcall15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16a / division, 0)) then itmcallstrike16 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume16a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16a / division, 0)) then yes else no, itmcallstrike16, callOptionvolume16a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume16 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16 / division, 0)) then yes else no, itmcallstrike16-space, putOptionvolume16, Color.red, no);
def itmcallstrike17 = CallStrike - strikeSpacing * 17;
plot itmcall16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17a / division, 0)) then itmcallstrike17 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume17a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17a / division, 0)) then yes else no, itmcallstrike17, callOptionvolume17a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume17 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17 / division, 0)) then yes else no, itmcallstrike17-space, putOptionvolume17, Color.red, no);
def itmcallstrike18 = CallStrike - strikeSpacing * 18;
plot itmcall17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18a / division, 0)) then itmcallstrike18 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume18a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18a / division, 0)) then yes else no, itmcallstrike18, callOptionvolume18a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume18 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18 / division, 0)) then yes else no, itmcallstrike18-space, putOptionvolume18, Color.red, no);
def itmcallstrike19 = CallStrike - strikeSpacing * 19;
plot itmcall18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19a / division, 0)) then itmcallstrike19 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume19a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19a / division, 0)) then yes else no, itmcallstrike19, callOptionvolume19a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume19 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19 / division, 0)) then yes else no, itmcallstrike19-space, putOptionvolume19, Color.red, no);
def itmcallstrike20 = CallStrike - strikeSpacing * 20;
plot itmcall19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20a / division, 0)) then itmcallstrike20 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume20a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20a / division, 0)) then yes else no, itmcallstrike20, callOptionvolume20a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume20 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20 / division, 0)) then yes else no, itmcallstrike20-space, putOptionvolume20, Color.red, no);

#PUTS
def atmputstrike = PutStrike - space;
plot atmput  = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume / division, 0)) then atmputstrike else Double.NaN;

def itmputstrike1 = PutStrike + strikeSpacing - space;
plot itmput  = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1a / division, 0)) then itmputstrike1 else Double.NaN;

def itmPutStrike2 = PutStrike + strikeSpacing * 2 - space;
plot itmput1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2a / division, 0)) then itmPutStrike2 else Double.NaN;
def itmPutStrike3 = PutStrike + strikeSpacing * 3 - space;
plot itmput2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3a / division, 0)) then itmPutStrike3 else Double.NaN;
def itmPutStrike4 = PutStrike + strikeSpacing * 4 - space;
plot itmput3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4a / division, 0)) then itmPutStrike4 else Double.NaN;
def itmPutStrike5 = PutStrike + strikeSpacing * 5 - space;
plot itmput4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5a / division, 0)) then itmPutStrike5 else Double.NaN;
def itmPutStrike6 = PutStrike + strikeSpacing * 6 - space;
plot itmput5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6a / division, 0)) then itmPutStrike6 else Double.NaN;
def itmPutStrike7 = PutStrike + strikeSpacing * 7 - space;
plot itmput6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7a / division, 0)) then itmPutStrike7 else Double.NaN;
def itmPutStrike8 = PutStrike + strikeSpacing * 8 - space;
plot itmput7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8a / division, 0)) then itmPutStrike8 else Double.NaN;
def itmPutStrike9 = PutStrike + strikeSpacing * 9 - space;
plot itmput8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9a / division, 0)) then itmPutStrike9 else Double.NaN;
def itmPutStrike10 = PutStrike + strikeSpacing * 10 - space;
plot itmput9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10a / division, 0)) then itmPutStrike10 else Double.NaN;
def itmPutStrike11 = PutStrike + strikeSpacing * 11 - space;
plot itmput10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11a / division, 0)) then itmPutStrike11 else Double.NaN;
def itmPutStrike12 = PutStrike + strikeSpacing * 12 - space;
plot itmput11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12a / division, 0)) then itmPutStrike12 else Double.NaN;
def itmPutStrike13 = PutStrike + strikeSpacing * 13 - space;
plot itmput12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13a / division, 0)) then itmPutStrike13 else Double.NaN;
def itmPutStrike14 = PutStrike + strikeSpacing * 14 - space;
plot itmput13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14a / division, 0)) then itmPutStrike14 else Double.NaN;
def itmPutStrike15 = PutStrike + strikeSpacing * 15 - space;
plot itmput14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15a / division, 0)) then itmPutStrike15 else Double.NaN;
def itmPutStrike16 = PutStrike + strikeSpacing * 16 - space;
plot itmput15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16a / division, 0)) then itmPutStrike16 else Double.NaN;
def itmPutStrike17 = PutStrike + strikeSpacing * 17 - space;
plot itmput16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17a / division, 0)) then itmPutStrike17 else Double.NaN;
def itmPutStrike18 = PutStrike + strikeSpacing * 18 - space;
plot itmput17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18a / division, 0)) then itmPutStrike18 else Double.NaN;
def itmPutStrike19 = PutStrike + strikeSpacing * 19 - space;
plot itmput18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19a / division, 0)) then itmPutStrike19 else Double.NaN;
def itmPutStrike20 = PutStrike + strikeSpacing * 20 - space;
plot itmput19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20a / division, 0)) then itmPutStrike20 else Double.NaN;


def otmputstrike1 = PutStrike - strikeSpacing - space;
plot otmput  = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1 / division, 0)) then otmputstrike1 else Double.NaN;
def otmputStrike2 = PutStrike -  strikeSpacing * 2 - space;
plot otmput1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2 / division, 0)) then otmputStrike2 else Double.NaN;
def otmputStrike3 = PutStrike -  strikeSpacing * 3 - space;
plot otmput2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3 / division, 0)) then otmputStrike3 else Double.NaN;
def otmputStrike4 = PutStrike -  strikeSpacing * 4 - space;
plot otmput3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4 / division, 0)) then otmputStrike4 else Double.NaN;
def otmputStrike5 = PutStrike -  strikeSpacing * 5 - space;
plot otmput4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5 / division, 0)) then otmputStrike5 else Double.NaN;
def otmputStrike6 = PutStrike -  strikeSpacing * 6 - space;
plot otmput5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6 / division, 0)) then otmputStrike6 else Double.NaN;
def otmputStrike7 = PutStrike -  strikeSpacing * 7 - space;
plot otmput6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7 / division, 0)) then otmputStrike7 else Double.NaN;
def otmputStrike8 = PutStrike -  strikeSpacing * 8 - space;
plot otmput7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8 / division, 0)) then otmputStrike8 else Double.NaN;
def otmputStrike9 = PutStrike -  strikeSpacing * 9 - space;
plot otmput8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9 / division, 0)) then otmputStrike9 else Double.NaN;
def otmputStrike10 = PutStrike -  strikeSpacing * 10 - space;
plot otmput9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10 / division, 0)) then otmputStrike10 else Double.NaN;
def otmputStrike11 = PutStrike -  strikeSpacing * 11 - space;
plot otmput10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11 / division, 0)) then otmputStrike11 else Double.NaN;
def otmputStrike12 = PutStrike -  strikeSpacing * 12 - space;
plot otmput11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12 / division, 0)) then otmputStrike12 else Double.NaN;
def otmputStrike13 = PutStrike -  strikeSpacing * 13 - space;
plot otmput12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13 / division, 0)) then otmputStrike13 else Double.NaN;
def otmputStrike14 = PutStrike -  strikeSpacing * 14 - space;
plot otmput13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14 / division, 0)) then otmputStrike14 else Double.NaN;
def otmputStrike15 = PutStrike -  strikeSpacing * 15 - space;
plot otmput14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15 / division, 0)) then otmputStrike15 else Double.NaN;
def otmputStrike16 = PutStrike -  strikeSpacing * 16 - space;
plot otmput15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16 / division, 0)) then otmputStrike16 else Double.NaN;
def otmputStrike17 = PutStrike -  strikeSpacing * 17 - space;
plot otmput16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17 / division, 0)) then otmputStrike17 else Double.NaN;
def otmputStrike18 = PutStrike -  strikeSpacing * 18 - space;
plot otmput17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18 / division, 0)) then otmputStrike18 else Double.NaN;
def otmputStrike19 = PutStrike -  strikeSpacing * 19 - space;
plot otmput18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19 / division, 0)) then otmputStrike19 else Double.NaN;
def otmputStrike20 = PutStrike -  strikeSpacing * 20 - space;
plot otmput19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20 / division, 0)) then otmputStrike20 else Double.NaN;

atmcall.SetPaintingStrategy(PaintingStrategy.LINE);
atmcall.SetLineWeight(5);
atmcall.SetDefaultColor(GlobalColor("CallColor"));
otmcall.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall.SetLineWeight(5);
otmcall.SetDefaultColor(GlobalColor("CallColor"));
otmcall1.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall1.SetLineWeight(5);
otmcall1.SetDefaultColor(GlobalColor("CallColor"));
otmcall2.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall2.SetLineWeight(5);
otmcall2.SetDefaultColor(GlobalColor("CallColor"));
otmcall3.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall3.SetLineWeight(5);
otmcall3.SetDefaultColor(GlobalColor("CallColor"));
otmcall4.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall4.SetLineWeight(5);
otmcall4.SetDefaultColor(GlobalColor("CallColor"));
otmcall5.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall5.SetLineWeight(5);
otmcall5.SetDefaultColor(GlobalColor("CallColor"));
otmcall6.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall6.SetLineWeight(5);
otmcall6.SetDefaultColor(GlobalColor("CallColor"));
otmcall7.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall7.SetLineWeight(5);
otmcall7.SetDefaultColor(GlobalColor("CallColor"));
otmcall8.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall8.SetLineWeight(5);
otmcall8.SetDefaultColor(GlobalColor("CallColor"));
otmcall9.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall9.SetLineWeight(5);
otmcall9.SetDefaultColor(GlobalColor("CallColor"));
otmcall10.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall10.SetLineWeight(5);
otmcall10.SetDefaultColor(GlobalColor("CallColor"));
otmcall11.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall11.SetLineWeight(5);
otmcall11.SetDefaultColor(GlobalColor("CallColor"));
otmcall12.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall12.SetLineWeight(5);
otmcall12.SetDefaultColor(GlobalColor("CallColor"));
otmcall13.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall13.SetLineWeight(5);
otmcall13.SetDefaultColor(GlobalColor("CallColor"));
otmcall14.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall14.SetLineWeight(5);
otmcall14.SetDefaultColor(GlobalColor("CallColor"));
otmcall15.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall15.SetLineWeight(5);
otmcall15.SetDefaultColor(GlobalColor("CallColor"));
otmcall16.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall16.SetLineWeight(5);
otmcall16.SetDefaultColor(GlobalColor("CallColor"));
otmcall17.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall17.SetLineWeight(5);
otmcall17.SetDefaultColor(GlobalColor("CallColor"));
otmcall18.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall18.SetLineWeight(5);
otmcall18.SetDefaultColor(GlobalColor("CallColor"));
otmcall19.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall19.SetLineWeight(5);
otmcall19.SetDefaultColor(GlobalColor("CallColor"));

itmcall.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall.SetLineWeight(5);
itmcall.SetDefaultColor(GlobalColor("CallColor"));
itmcall1.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall1.SetLineWeight(5);
itmcall1.SetDefaultColor(GlobalColor("CallColor"));
itmcall2.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall2.SetLineWeight(5);
itmcall2.SetDefaultColor(GlobalColor("CallColor"));
itmcall3.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall3.SetLineWeight(5);
itmcall3.SetDefaultColor(GlobalColor("CallColor"));
itmcall4.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall4.SetLineWeight(5);
itmcall4.SetDefaultColor(GlobalColor("CallColor"));
itmcall5.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall5.SetLineWeight(5);
itmcall5.SetDefaultColor(GlobalColor("CallColor"));
itmcall6.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall6.SetLineWeight(5);
itmcall6.SetDefaultColor(GlobalColor("CallColor"));
itmcall7.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall7.SetLineWeight(5);
itmcall7.SetDefaultColor(GlobalColor("CallColor"));
itmcall8.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall8.SetLineWeight(5);
itmcall8.SetDefaultColor(GlobalColor("CallColor"));
itmcall9.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall9.SetLineWeight(5);
itmcall9.SetDefaultColor(GlobalColor("CallColor"));
itmcall10.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall10.SetLineWeight(5);
itmcall10.SetDefaultColor(GlobalColor("CallColor"));
itmcall11.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall11.SetLineWeight(5);
itmcall11.SetDefaultColor(GlobalColor("CallColor"));
itmcall12.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall12.SetLineWeight(5);
itmcall12.SetDefaultColor(GlobalColor("CallColor"));
itmcall13.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall13.SetLineWeight(5);
itmcall13.SetDefaultColor(GlobalColor("CallColor"));
itmcall14.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall14.SetLineWeight(5);
itmcall14.SetDefaultColor(GlobalColor("CallColor"));
itmcall15.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall15.SetLineWeight(5);
itmcall15.SetDefaultColor(GlobalColor("CallColor"));
itmcall16.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall16.SetLineWeight(5);
itmcall16.SetDefaultColor(GlobalColor("CallColor"));
itmcall17.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall17.SetLineWeight(5);
itmcall17.SetDefaultColor(GlobalColor("CallColor"));
itmcall18.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall18.SetLineWeight(5);
itmcall18.SetDefaultColor(GlobalColor("CallColor"));
itmcall19.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall19.SetLineWeight(5);
itmcall19.SetDefaultColor(GlobalColor("CallColor"));

atmput.SetPaintingStrategy(PaintingStrategy.LINE);
atmput.SetLineWeight(5);
atmput.SetDefaultColor(GlobalColor("PutColor"));
itmput.SetPaintingStrategy(PaintingStrategy.LINE);
itmput.SetLineWeight(5);
itmput.SetDefaultColor(GlobalColor("PutColor"));
itmput1.SetPaintingStrategy(PaintingStrategy.LINE);
itmput1.SetLineWeight(5);
itmput1.SetDefaultColor(GlobalColor("PutColor"));
itmput2.SetPaintingStrategy(PaintingStrategy.LINE);
itmput2.SetLineWeight(5);
itmput2.SetDefaultColor(GlobalColor("PutColor"));
itmput3.SetPaintingStrategy(PaintingStrategy.LINE);
itmput3.SetLineWeight(5);
itmput3.SetDefaultColor(GlobalColor("PutColor"));
itmput4.SetPaintingStrategy(PaintingStrategy.LINE);
itmput4.SetLineWeight(5);
itmput4.SetDefaultColor(GlobalColor("PutColor"));
itmput5.SetPaintingStrategy(PaintingStrategy.LINE);
itmput5.SetLineWeight(5);
itmput5.SetDefaultColor(GlobalColor("PutColor"));
itmput6.SetPaintingStrategy(PaintingStrategy.LINE);
itmput6.SetLineWeight(5);
itmput6.SetDefaultColor(GlobalColor("PutColor"));
itmput7.SetPaintingStrategy(PaintingStrategy.LINE);
itmput7.SetLineWeight(5);
itmput7.SetDefaultColor(GlobalColor("PutColor"));
itmput8.SetPaintingStrategy(PaintingStrategy.LINE);
itmput8.SetLineWeight(5);
itmput8.SetDefaultColor(GlobalColor("PutColor"));
itmput9.SetPaintingStrategy(PaintingStrategy.LINE);
itmput9.SetLineWeight(5);
itmput9.SetDefaultColor(GlobalColor("PutColor"));
itmput10.SetPaintingStrategy(PaintingStrategy.LINE);
itmput10.SetLineWeight(5);
itmput10.SetDefaultColor(GlobalColor("PutColor"));
itmput11.SetPaintingStrategy(PaintingStrategy.LINE);
itmput11.SetLineWeight(5);
itmput11.SetDefaultColor(GlobalColor("PutColor"));
itmput12.SetPaintingStrategy(PaintingStrategy.LINE);
itmput12.SetLineWeight(5);
itmput12.SetDefaultColor(GlobalColor("PutColor"));
itmput13.SetPaintingStrategy(PaintingStrategy.LINE);
itmput13.SetLineWeight(5);
itmput13.SetDefaultColor(GlobalColor("PutColor"));
itmput14.SetPaintingStrategy(PaintingStrategy.LINE);
itmput14.SetLineWeight(5);
itmput14.SetDefaultColor(GlobalColor("PutColor"));
itmput15.SetPaintingStrategy(PaintingStrategy.LINE);
itmput15.SetLineWeight(5);
itmput15.SetDefaultColor(GlobalColor("PutColor"));
itmput16.SetPaintingStrategy(PaintingStrategy.LINE);
itmput16.SetLineWeight(5);
itmput16.SetDefaultColor(GlobalColor("PutColor"));
itmput17.SetPaintingStrategy(PaintingStrategy.LINE);
itmput17.SetLineWeight(5);
itmput17.SetDefaultColor(GlobalColor("PutColor"));
itmput18.SetPaintingStrategy(PaintingStrategy.LINE);
itmput18.SetLineWeight(5);
itmput18.SetDefaultColor(GlobalColor("PutColor"));
itmput19.SetPaintingStrategy(PaintingStrategy.LINE);
itmput19.SetLineWeight(5);
itmput19.SetDefaultColor(GlobalColor("PutColor"));
otmput.SetPaintingStrategy(PaintingStrategy.LINE);
otmput.SetLineWeight(5);
otmput.SetDefaultColor(GlobalColor("PutColor"));
otmput1.SetPaintingStrategy(PaintingStrategy.LINE);
otmput1.SetLineWeight(5);
otmput1.SetDefaultColor(GlobalColor("PutColor"));
otmput2.SetPaintingStrategy(PaintingStrategy.LINE);
otmput2.SetLineWeight(5);
otmput2.SetDefaultColor(GlobalColor("PutColor"));
otmput3.SetPaintingStrategy(PaintingStrategy.LINE);
otmput3.SetLineWeight(5);
otmput3.SetDefaultColor(GlobalColor("PutColor"));
otmput4.SetPaintingStrategy(PaintingStrategy.LINE);
otmput4.SetLineWeight(5);
otmput4.SetDefaultColor(GlobalColor("PutColor"));
otmput5.SetPaintingStrategy(PaintingStrategy.LINE);
otmput5.SetLineWeight(5);
otmput5.SetDefaultColor(GlobalColor("PutColor"));
otmput6.SetPaintingStrategy(PaintingStrategy.LINE);
otmput6.SetLineWeight(5);
otmput6.SetDefaultColor(GlobalColor("PutColor"));
otmput7.SetPaintingStrategy(PaintingStrategy.LINE);
otmput7.SetLineWeight(5);
otmput7.SetDefaultColor(GlobalColor("PutColor"));
otmput8.SetPaintingStrategy(PaintingStrategy.LINE);
otmput8.SetLineWeight(5);
otmput8.SetDefaultColor(GlobalColor("PutColor"));
otmput9.SetPaintingStrategy(PaintingStrategy.LINE);
otmput9.SetLineWeight(5);
otmput9.SetDefaultColor(GlobalColor("PutColor"));
otmput10.SetPaintingStrategy(PaintingStrategy.LINE);
otmput10.SetLineWeight(5);
otmput10.SetDefaultColor(GlobalColor("PutColor"));
otmput11.SetPaintingStrategy(PaintingStrategy.LINE);
otmput11.SetLineWeight(5);
otmput11.SetDefaultColor(GlobalColor("PutColor"));
otmput12.SetPaintingStrategy(PaintingStrategy.LINE);
otmput12.SetLineWeight(5);
otmput12.SetDefaultColor(GlobalColor("PutColor"));
otmput13.SetPaintingStrategy(PaintingStrategy.LINE);
otmput13.SetLineWeight(5);
otmput13.SetDefaultColor(GlobalColor("PutColor"));
otmput14.SetPaintingStrategy(PaintingStrategy.LINE);
otmput14.SetLineWeight(5);
otmput14.SetDefaultColor(GlobalColor("PutColor"));
otmput15.SetPaintingStrategy(PaintingStrategy.LINE);
otmput15.SetLineWeight(5);
otmput15.SetDefaultColor(GlobalColor("PutColor"));
otmput16.SetPaintingStrategy(PaintingStrategy.LINE);
otmput16.SetLineWeight(5);
otmput16.SetDefaultColor(GlobalColor("PutColor"));
otmput17.SetPaintingStrategy(PaintingStrategy.LINE);
otmput17.SetLineWeight(5);
otmput17.SetDefaultColor(GlobalColor("PutColor"));
otmput18.SetPaintingStrategy(PaintingStrategy.LINE);
otmput18.SetLineWeight(5);
otmput18.SetDefaultColor(GlobalColor("PutColor"));
otmput19.SetPaintingStrategy(PaintingStrategy.LINE);
otmput19.SetLineWeight(5);
otmput19.SetDefaultColor(GlobalColor("PutColor"));
 
Hey. Here is an updated version. Works during market hours. Increase the expansion area to the right.

Code:
# volume_vertical_axis_manual_spx_v3
# Update Nov 6, 2023. Updated datestring
# @2187Nick
declare upper;
declare once_per_bar;
def CurrentYear = GetYear()-2000;
def CurrentMonth = GetMonth();
def CurrentDOM = GetDayOfMonth(GetYYYYMMDD()); #+1;

input symbol = "SPXW";
input strikeSpacing = 5.0;
input roundup = no;
input shift_line_right = 10;# negative numbers plot in candle area, positive in expansion
input division = 1000; # divides the open interest by this number. Gives user option to reduce size of bar plots.
input space = 1.00; # the vertical space between the put open interest bar and call open interest bar.
def DateString_auto = CurrentYear * 10000 + CurrentMonth * 100 + CurrentDOM;

input ManuallySetExpiration = {default "false", "true"};
input Expiration_YYMMDD = 231117;
def DateString = if manuallysetexpiration then Expiration_YYMMDD else DateString_auto;

DefineGlobalColor("CallColor", Color.GREEN);
DefineGlobalColor("PutColor", Color.RED);
AddLabel(yes,  "EXP: " + AsPrice(DateString) + "C", GlobalColor("CallColor"));
AddLabel(yes,  "EXP: " + AsPrice(DateString) + "P", GlobalColor("PutColor"));
def agg = AggregationPeriod.DAY;

def openlevel = close(period = agg);
def floor_or_ceiling = if roundup then Ceil(openlevel / 10) * 10 else Floor(openlevel / 10) * 10;
def PutStrike = floor_or_ceiling;
def CallStrike = floor_or_ceiling;

### Put Option volume
def putOptionvolume = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 0), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 0), agg);

def putOptionvolume1 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 1), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 1), agg);
def putOptionvolume2 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 2), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 2), agg);
def putOptionvolume3 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 3), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 3), agg);
def putOptionvolume4 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 4), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 4), agg);
def putOptionvolume5 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 5), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 5), agg);
def putOptionvolume6 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 6), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 6), agg);
def putOptionvolume7 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 7), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 7), agg);
def putOptionvolume8 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 8), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 8), agg);
def putOptionvolume9 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 9), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 9), agg);
def putOptionvolume10 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 10), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 10), agg);
def putOptionvolume11 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 11), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 11), agg);
def putOptionvolume12 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 12), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 12), agg);
def putOptionvolume13 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 13), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 13), agg);
def putOptionvolume14 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 14), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 14), agg);
def putOptionvolume15 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 15), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 15), agg);
def putOptionvolume16 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 16), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 16), agg);
def putOptionvolume17 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 17), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 17), agg);
def putOptionvolume18 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 18), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 18), agg);
def putOptionvolume19 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 19), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 19), agg);
def putOptionvolume20 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 20), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike - strikeSpacing * 20), agg);

def putOptionvolumea = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 0), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 0), agg);
def putOptionvolume1a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 1), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 1), agg);
def putOptionvolume2a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 2), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 2), agg);
def putOptionvolume3a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 3), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 3), agg);
def putOptionvolume4a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 4), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 4), agg);
def putOptionvolume5a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 5), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 5), agg);
def putOptionvolume6a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 6), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 6), agg);
def putOptionvolume7a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 7), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 7), agg);
def putOptionvolume8a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 8), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 8), agg);
def putOptionvolume9a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 9), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 9), agg);
def putOptionvolume10a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 10), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 10), agg);
def putOptionvolume11a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 11), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 11), agg);
def putOptionvolume12a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 12), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 12), agg);
def putOptionvolume13a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 13), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 13), agg);
def putOptionvolume14a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 14), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 14), agg);
def putOptionvolume15a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 15), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 15), agg);
def putOptionvolume16a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 16), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 16), agg);
def putOptionvolume17a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 17), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 17), agg);
def putOptionvolume18a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 18), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 18), agg);
def putOptionvolume19a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 19), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 19), agg);
def putOptionvolume20a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 20), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "P" + AsPrice(PutStrike + strikeSpacing * 20), agg);

###Call Option volume
def callOptionvolume = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 0), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 0), agg);

def callOptionvolume1 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 1), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 1), agg);
def callOptionvolume2 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 2), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 2), agg);
def callOptionvolume3 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 3), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 3), agg);
def callOptionvolume4 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 4), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 4), agg);
def callOptionvolume5 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 5), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 5), agg);
def callOptionvolume6 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 6), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 6), agg);
def callOptionvolume7 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 7), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 7), agg);
def callOptionvolume8 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 8), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 8), agg);
def callOptionvolume9 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 9), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 9), agg);
def callOptionvolume10 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 10), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 10), agg);
def callOptionvolume11 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 11), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 11), agg);
def callOptionvolume12 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 12), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 12), agg);
def callOptionvolume13 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 13), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 13), agg);
def callOptionvolume14 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 14), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 14), agg);
def callOptionvolume15 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 15), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 15), agg);
def callOptionvolume16 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 16), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 16), agg);
def callOptionvolume17 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 17), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 17), agg);
def callOptionvolume18 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 18), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 18), agg);
def callOptionvolume19 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 19), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 19), agg);
def callOptionvolume20 = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 20), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike + strikeSpacing * 20), agg);

def callOptionvolumea = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 0), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 0), agg);
def callOptionvolume1a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 1), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 1), agg);
def callOptionvolume2a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 2), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 2), agg);
def callOptionvolume3a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 3), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 3), agg);
def callOptionvolume4a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 4), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 4), agg);
def callOptionvolume5a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 5), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 5), agg);
def callOptionvolume6a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 6), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 6), agg);
def callOptionvolume7a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 7), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 7), agg);
def callOptionvolume8a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 8), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 8), agg);
def callOptionvolume9a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 9), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 9), agg);
def callOptionvolume10a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 10), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 10), agg);
def callOptionvolume11a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 11), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 11), agg);
def callOptionvolume12a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 12), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 12), agg);
def callOptionvolume13a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 13), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 13), agg);
def callOptionvolume14a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 14), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 14), agg);
def callOptionvolume15a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 15), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 15), agg);
def callOptionvolume16a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 16), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 16), agg);
def callOptionvolume17a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 17), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 17), agg);
def callOptionvolume18a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 18), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 18), agg);
def callOptionvolume19a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 19), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 19), agg);
def callOptionvolume20a = if IsNaN(volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 20), agg)) then 0 else volume("." + symbol + AsPrice(DateString) + "C" + AsPrice(CallStrike - strikeSpacing * 20), agg);

#####################################

def lastbar = if IsNaN(close[-1]) and !IsNaN(close)
              then BarNumber()
              else lastbar[1];

AddVerticalLine(BarNumber() >= HighestAll(lastbar +  shift_line_right) and  BarNumber() <= HighestAll(lastbar +  shift_line_right), "Live  volume",color.white,Curve.LONG_DASH);

## We plot the volume using tos bar numbers. Normally a full horizontal line would be
## plotted across then full length of the chart. Using if statement I narrow down the area of the line
## that is plotted. Example: atmcall( plot line from bar#: (lastbar + 10) to bar#(lastbar+10+ callOptionvolume);

def atmcallstrike = CallStrike;
plot atmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume / division, 0)) then atmcallstrike else Double.NaN;




AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume / division, 0)) then yes else no, atmcallstrike, callOptionvolume, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume / division, 0)) then yes else no, atmcallstrike-space, putOptionvolume, Color.red, no);

def otmcallstrike1 = CallStrike + strikeSpacing;
plot otmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1 / division, 0)) then otmcallstrike1 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume1 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1 / division, 0)) then yes else no, otmcallstrike1, callOptionvolume1, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume1a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1a / division, 0)) then yes else no, otmcallstrike1-space, putOptionvolume1a, Color.red, no);

def otmcallstrike2 = CallStrike + strikeSpacing * 2;
plot otmcall1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2 / division, 0)) then otmcallstrike2 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume2 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2 / division, 0)) then yes else no, otmcallstrike2, callOptionvolume2, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume2a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2a / division, 0)) then yes else no, otmcallstrike2-space, putOptionvolume2a, Color.red, no);

def otmcallstrike3 = CallStrike + strikeSpacing * 3;
plot otmcall2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3 / division, 0)) then otmcallstrike3 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume3 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3 / division, 0)) then yes else no, otmcallstrike3, callOptionvolume3, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume3a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3a / division, 0)) then yes else no, otmcallstrike3-space, putOptionvolume3a, Color.red, no);

def otmcallstrike4 = CallStrike + strikeSpacing * 4;
plot otmcall3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4 / division, 0)) then otmcallstrike4 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume4 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4 / division, 0)) then yes else no, otmcallstrike4, callOptionvolume4, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume4a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4a / division, 0)) then yes else no, otmcallstrike4-space, putOptionvolume4a, Color.red, no);

def otmcallstrike5 = CallStrike + strikeSpacing * 5;
plot otmcall4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5 / division, 0)) then otmcallstrike5 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume5 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5 / division, 0)) then yes else no, otmcallstrike5, callOptionvolume5, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume5a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5a / division, 0)) then yes else no, otmcallstrike5-space, putOptionvolume5a, Color.red, no);

def otmcallstrike6 = CallStrike + strikeSpacing * 6;
plot otmcall5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6 / division, 0)) then otmcallstrike6 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume6 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6 / division, 0)) then yes else no, otmcallstrike6, callOptionvolume6, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume6a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6a / division, 0)) then yes else no, otmcallstrike6-space, putOptionvolume6a, Color.red, no);
def otmcallstrike7 = CallStrike + strikeSpacing * 7;
plot otmcall6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7 / division, 0)) then otmcallstrike7 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume7 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7 / division, 0)) then yes else no, otmcallstrike7, callOptionvolume7, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume7a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7a / division, 0)) then yes else no, otmcallstrike7-space, putOptionvolume7a, Color.red, no);
def otmcallstrike8 = CallStrike + strikeSpacing * 8;
plot otmcall7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8 / division, 0)) then otmcallstrike8 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume8 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8 / division, 0)) then yes else no, otmcallstrike8, callOptionvolume8, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume8a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8a / division, 0)) then yes else no, otmcallstrike8-space, putOptionvolume8a, Color.red, no);
def otmcallstrike9 = CallStrike + strikeSpacing * 9;
plot otmcall8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9 / division, 0)) then otmcallstrike9 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume9 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9 / division, 0)) then yes else no, otmcallstrike9, callOptionvolume9, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume9a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9a / division, 0)) then yes else no, otmcallstrike9-space, putOptionvolume9a, Color.red, no);
def otmcallstrike10 = CallStrike + strikeSpacing * 10;
plot otmcall9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10 / division, 0)) then otmcallstrike10 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume10 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10 / division, 0)) then yes else no, otmcallstrike10, callOptionvolume10, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume10a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10a / division, 0)) then yes else no, otmcallstrike10-space, putOptionvolume10a, Color.red, no);
def otmcallstrike11 = CallStrike + strikeSpacing * 11;
plot otmcall10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11 / division, 0)) then otmcallstrike11 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume11 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11 / division, 0)) then yes else no, otmcallstrike11, callOptionvolume11, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume11a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11a / division, 0)) then yes else no, otmcallstrike11-space, putOptionvolume11a, Color.red, no);
def otmcallstrike12 = CallStrike + strikeSpacing * 12;
plot otmcall11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12 / division, 0)) then otmcallstrike12 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume12 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12 / division, 0)) then yes else no, otmcallstrike12, callOptionvolume12, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume12a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12a / division, 0)) then yes else no, otmcallstrike12-space, putOptionvolume12a, Color.red, no);
def otmcallstrike13 = CallStrike + strikeSpacing * 13;
plot otmcall12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13 / division, 0)) then otmcallstrike13 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume13 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13 / division, 0)) then yes else no, otmcallstrike13, callOptionvolume13, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume13a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13a / division, 0)) then yes else no, otmcallstrike13-space, putOptionvolume13a, Color.red, no);
def otmcallstrike14 = CallStrike + strikeSpacing * 14;
plot otmcall13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14 / division, 0)) then otmcallstrike14 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume14 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14 / division, 0)) then yes else no, otmcallstrike14, callOptionvolume14, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume14a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14a / division, 0)) then yes else no, otmcallstrike14-space, putOptionvolume14a, Color.red, no);
def otmcallstrike15 = CallStrike + strikeSpacing * 15;
plot otmcall14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15 / division, 0)) then otmcallstrike15 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume15 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15 / division, 0)) then yes else no, otmcallstrike15, callOptionvolume15, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume15a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15a / division, 0)) then yes else no, otmcallstrike15-space, putOptionvolume15a, Color.red, no);
def otmcallstrike16 = CallStrike + strikeSpacing * 16;
plot otmcall15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16 / division, 0)) then otmcallstrike16 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume16 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16 / division, 0)) then yes else no, otmcallstrike16, callOptionvolume16, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume16a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16a / division, 0)) then yes else no, otmcallstrike16-space, putOptionvolume16a, Color.red, no);
def otmcallstrike17 = CallStrike + strikeSpacing * 17;
plot otmcall16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17 / division, 0)) then otmcallstrike17 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume17 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17 / division, 0)) then yes else no, otmcallstrike17, callOptionvolume17, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume17a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17a / division, 0)) then yes else no, otmcallstrike17-space, putOptionvolume17a, Color.red, no);
def otmcallstrike18 = CallStrike + strikeSpacing * 18;
plot otmcall17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18 / division, 0)) then otmcallstrike18 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume18 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18 / division, 0)) then yes else no, otmcallstrike18, callOptionvolume18, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume18a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18a / division, 0)) then yes else no, otmcallstrike18-space, putOptionvolume18a, Color.red, no);
def otmcallstrike19 = CallStrike + strikeSpacing * 19;
plot otmcall18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19 / division, 0)) then otmcallstrike19 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume19 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19 / division, 0)) then yes else no, otmcallstrike19, callOptionvolume19, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume19a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19a / division, 0)) then yes else no, otmcallstrike19-space, putOptionvolume19a, Color.red, no);
def otmcallstrike20 = CallStrike + strikeSpacing * 20;
plot otmcall19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20 / division, 0)) then otmcallstrike20 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume20 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20 / division, 0)) then yes else no, otmcallstrike20, callOptionvolume20, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume20a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20a / division, 0)) then yes else no, otmcallstrike20-space, putOptionvolume20a, Color.red, no);


def itmcallstrike1 = CallStrike - strikeSpacing;
plot itmcall = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolumea / division, 0)) then itmcallstrike1 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume1a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume1a / division, 0)) then yes else no, itmcallstrike1, callOptionvolume1a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume1 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1 / division, 0)) then yes else no, itmcallstrike1-space, putOptionvolume1, Color.red, no);

def itmcallstrike2 = CallStrike - strikeSpacing * 2;
plot itmcall1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2a / division, 0)) then itmcallstrike2 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume2a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume2a / division, 0)) then yes else no, itmcallstrike2, callOptionvolume2a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume2 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2 / division, 0)) then yes else no, itmcallstrike2-space, putOptionvolume2, Color.red, no);
def itmcallstrike3 = CallStrike - strikeSpacing * 3;
plot itmcall2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3a / division, 0)) then itmcallstrike3 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume3a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume3a / division, 0)) then yes else no, itmcallstrike3, callOptionvolume3a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume3 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3 / division, 0)) then yes else no, itmcallstrike3-space, putOptionvolume3, Color.red, no);
def itmcallstrike4 = CallStrike - strikeSpacing * 4;
plot itmcall3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4a / division, 0)) then itmcallstrike4 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume4a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume4a / division, 0)) then yes else no, itmcallstrike4, callOptionvolume4a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume4 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4 / division, 0)) then yes else no, itmcallstrike4-space, putOptionvolume4, Color.red, no);
def itmcallstrike5 = CallStrike - strikeSpacing * 5;
plot itmcall4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5a / division, 0)) then itmcallstrike5 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume5a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume5a / division, 0)) then yes else no, itmcallstrike5, callOptionvolume5a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume5 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5 / division, 0)) then yes else no, itmcallstrike5-space, putOptionvolume5, Color.red, no);
def itmcallstrike6 = CallStrike - strikeSpacing * 6;
plot itmcall5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6a / division, 0)) then itmcallstrike6 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume6a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume6a / division, 0)) then yes else no, itmcallstrike6, callOptionvolume6a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume6 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6 / division, 0)) then yes else no, itmcallstrike6-space, putOptionvolume6, Color.red, no);
def itmcallstrike7 = CallStrike - strikeSpacing * 7;
plot itmcall6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7a / division, 0)) then itmcallstrike7 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume7a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume7a / division, 0)) then yes else no, itmcallstrike7, callOptionvolume7a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume7 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7 / division, 0)) then yes else no, itmcallstrike7-space, putOptionvolume7, Color.red, no);
def itmcallstrike8 = CallStrike - strikeSpacing * 8;
plot itmcall7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8a / division, 0)) then itmcallstrike8 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume8a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume8a / division, 0)) then yes else no, itmcallstrike8, callOptionvolume8a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume8 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8 / division, 0)) then yes else no, itmcallstrike8-space, putOptionvolume8, Color.red, no);
def itmcallstrike9 = CallStrike - strikeSpacing * 9;
plot itmcall8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9a / division, 0)) then itmcallstrike9 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume9a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume9a / division, 0)) then yes else no, itmcallstrike9, callOptionvolume9a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume9 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9 / division, 0)) then yes else no, itmcallstrike9-space, putOptionvolume9, Color.red, no);
def itmcallstrike10 = CallStrike - strikeSpacing * 10;
plot itmcall9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10a / division, 0)) then itmcallstrike10 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume10a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume10a / division, 0)) then yes else no, itmcallstrike10, callOptionvolume10a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume10 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10 / division, 0)) then yes else no, itmcallstrike10-space, putOptionvolume10, Color.red, no);
def itmcallstrike11 = CallStrike - strikeSpacing * 11;
plot itmcall10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11a / division, 0)) then itmcallstrike11 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume11a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume11a / division, 0)) then yes else no, itmcallstrike11, callOptionvolume11a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume11 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11 / division, 0)) then yes else no, itmcallstrike11-space, putOptionvolume11, Color.red, no);
def itmcallstrike12 = CallStrike - strikeSpacing * 12;
plot itmcall11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12a / division, 0)) then itmcallstrike12 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume12a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume12a / division, 0)) then yes else no, itmcallstrike12, callOptionvolume12a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume12 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12 / division, 0)) then yes else no, itmcallstrike12-space, putOptionvolume12, Color.red, no);
def itmcallstrike13 = CallStrike - strikeSpacing * 13;
plot itmcall12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13a / division, 0)) then itmcallstrike13 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume13a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume13a / division, 0)) then yes else no, itmcallstrike13, callOptionvolume13a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume13 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13 / division, 0)) then yes else no, itmcallstrike13-space, putOptionvolume13, Color.red, no);
def itmcallstrike14 = CallStrike - strikeSpacing * 14;
plot itmcall13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14a / division, 0)) then itmcallstrike14 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume14a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume14a / division, 0)) then yes else no, itmcallstrike14, callOptionvolume14a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume14 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14 / division, 0)) then yes else no, itmcallstrike14-space, putOptionvolume14, Color.red, no);
def itmcallstrike15 = CallStrike - strikeSpacing * 15;
plot itmcall14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15a / division, 0)) then itmcallstrike15 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume15a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume15a / division, 0)) then yes else no, itmcallstrike15, callOptionvolume15a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume15 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15 / division, 0)) then yes else no, itmcallstrike15-space, putOptionvolume15, Color.red, no);
def itmcallstrike16 = CallStrike - strikeSpacing * 16;
plot itmcall15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16a / division, 0)) then itmcallstrike16 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume16a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume16a / division, 0)) then yes else no, itmcallstrike16, callOptionvolume16a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume16 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16 / division, 0)) then yes else no, itmcallstrike16-space, putOptionvolume16, Color.red, no);
def itmcallstrike17 = CallStrike - strikeSpacing * 17;
plot itmcall16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17a / division, 0)) then itmcallstrike17 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume17a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume17a / division, 0)) then yes else no, itmcallstrike17, callOptionvolume17a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume17 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17 / division, 0)) then yes else no, itmcallstrike17-space, putOptionvolume17, Color.red, no);
def itmcallstrike18 = CallStrike - strikeSpacing * 18;
plot itmcall17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18a / division, 0)) then itmcallstrike18 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume18a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume18a / division, 0)) then yes else no, itmcallstrike18, callOptionvolume18a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume18 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18 / division, 0)) then yes else no, itmcallstrike18-space, putOptionvolume18, Color.red, no);
def itmcallstrike19 = CallStrike - strikeSpacing * 19;
plot itmcall18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19a / division, 0)) then itmcallstrike19 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume19a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume19a / division, 0)) then yes else no, itmcallstrike19, callOptionvolume19a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume19 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19 / division, 0)) then yes else no, itmcallstrike19-space, putOptionvolume19, Color.red, no);
def itmcallstrike20 = CallStrike - strikeSpacing * 20;
plot itmcall19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20a / division, 0)) then itmcallstrike20 else Double.NaN;
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(callOptionvolume20a / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(callOptionvolume20a / division, 0)) then yes else no, itmcallstrike20, callOptionvolume20a, Color.green, yes);
AddChartBubble(if BarNumber() >= HighestAll(lastbar + shift_line_right+ Round(putOptionvolume20 / division, 0)) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20 / division, 0)) then yes else no, itmcallstrike20-space, putOptionvolume20, Color.red, no);

#PUTS
def atmputstrike = PutStrike - space;
plot atmput  = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume / division, 0)) then atmputstrike else Double.NaN;

def itmputstrike1 = PutStrike + strikeSpacing - space;
plot itmput  = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1a / division, 0)) then itmputstrike1 else Double.NaN;

def itmPutStrike2 = PutStrike + strikeSpacing * 2 - space;
plot itmput1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2a / division, 0)) then itmPutStrike2 else Double.NaN;
def itmPutStrike3 = PutStrike + strikeSpacing * 3 - space;
plot itmput2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3a / division, 0)) then itmPutStrike3 else Double.NaN;
def itmPutStrike4 = PutStrike + strikeSpacing * 4 - space;
plot itmput3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4a / division, 0)) then itmPutStrike4 else Double.NaN;
def itmPutStrike5 = PutStrike + strikeSpacing * 5 - space;
plot itmput4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5a / division, 0)) then itmPutStrike5 else Double.NaN;
def itmPutStrike6 = PutStrike + strikeSpacing * 6 - space;
plot itmput5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6a / division, 0)) then itmPutStrike6 else Double.NaN;
def itmPutStrike7 = PutStrike + strikeSpacing * 7 - space;
plot itmput6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7a / division, 0)) then itmPutStrike7 else Double.NaN;
def itmPutStrike8 = PutStrike + strikeSpacing * 8 - space;
plot itmput7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8a / division, 0)) then itmPutStrike8 else Double.NaN;
def itmPutStrike9 = PutStrike + strikeSpacing * 9 - space;
plot itmput8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9a / division, 0)) then itmPutStrike9 else Double.NaN;
def itmPutStrike10 = PutStrike + strikeSpacing * 10 - space;
plot itmput9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10a / division, 0)) then itmPutStrike10 else Double.NaN;
def itmPutStrike11 = PutStrike + strikeSpacing * 11 - space;
plot itmput10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11a / division, 0)) then itmPutStrike11 else Double.NaN;
def itmPutStrike12 = PutStrike + strikeSpacing * 12 - space;
plot itmput11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12a / division, 0)) then itmPutStrike12 else Double.NaN;
def itmPutStrike13 = PutStrike + strikeSpacing * 13 - space;
plot itmput12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13a / division, 0)) then itmPutStrike13 else Double.NaN;
def itmPutStrike14 = PutStrike + strikeSpacing * 14 - space;
plot itmput13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14a / division, 0)) then itmPutStrike14 else Double.NaN;
def itmPutStrike15 = PutStrike + strikeSpacing * 15 - space;
plot itmput14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15a / division, 0)) then itmPutStrike15 else Double.NaN;
def itmPutStrike16 = PutStrike + strikeSpacing * 16 - space;
plot itmput15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16a / division, 0)) then itmPutStrike16 else Double.NaN;
def itmPutStrike17 = PutStrike + strikeSpacing * 17 - space;
plot itmput16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17a / division, 0)) then itmPutStrike17 else Double.NaN;
def itmPutStrike18 = PutStrike + strikeSpacing * 18 - space;
plot itmput17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18a / division, 0)) then itmPutStrike18 else Double.NaN;
def itmPutStrike19 = PutStrike + strikeSpacing * 19 - space;
plot itmput18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19a / division, 0)) then itmPutStrike19 else Double.NaN;
def itmPutStrike20 = PutStrike + strikeSpacing * 20 - space;
plot itmput19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20a / division, 0)) then itmPutStrike20 else Double.NaN;


def otmputstrike1 = PutStrike - strikeSpacing - space;
plot otmput  = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume1 / division, 0)) then otmputstrike1 else Double.NaN;
def otmputStrike2 = PutStrike -  strikeSpacing * 2 - space;
plot otmput1 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume2 / division, 0)) then otmputStrike2 else Double.NaN;
def otmputStrike3 = PutStrike -  strikeSpacing * 3 - space;
plot otmput2 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume3 / division, 0)) then otmputStrike3 else Double.NaN;
def otmputStrike4 = PutStrike -  strikeSpacing * 4 - space;
plot otmput3 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume4 / division, 0)) then otmputStrike4 else Double.NaN;
def otmputStrike5 = PutStrike -  strikeSpacing * 5 - space;
plot otmput4 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume5 / division, 0)) then otmputStrike5 else Double.NaN;
def otmputStrike6 = PutStrike -  strikeSpacing * 6 - space;
plot otmput5 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume6 / division, 0)) then otmputStrike6 else Double.NaN;
def otmputStrike7 = PutStrike -  strikeSpacing * 7 - space;
plot otmput6 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume7 / division, 0)) then otmputStrike7 else Double.NaN;
def otmputStrike8 = PutStrike -  strikeSpacing * 8 - space;
plot otmput7 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume8 / division, 0)) then otmputStrike8 else Double.NaN;
def otmputStrike9 = PutStrike -  strikeSpacing * 9 - space;
plot otmput8 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume9 / division, 0)) then otmputStrike9 else Double.NaN;
def otmputStrike10 = PutStrike -  strikeSpacing * 10 - space;
plot otmput9 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume10 / division, 0)) then otmputStrike10 else Double.NaN;
def otmputStrike11 = PutStrike -  strikeSpacing * 11 - space;
plot otmput10 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume11 / division, 0)) then otmputStrike11 else Double.NaN;
def otmputStrike12 = PutStrike -  strikeSpacing * 12 - space;
plot otmput11 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume12 / division, 0)) then otmputStrike12 else Double.NaN;
def otmputStrike13 = PutStrike -  strikeSpacing * 13 - space;
plot otmput12 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume13 / division, 0)) then otmputStrike13 else Double.NaN;
def otmputStrike14 = PutStrike -  strikeSpacing * 14 - space;
plot otmput13 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume14 / division, 0)) then otmputStrike14 else Double.NaN;
def otmputStrike15 = PutStrike -  strikeSpacing * 15 - space;
plot otmput14 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume15 / division, 0)) then otmputStrike15 else Double.NaN;
def otmputStrike16 = PutStrike -  strikeSpacing * 16 - space;
plot otmput15 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume16 / division, 0)) then otmputStrike16 else Double.NaN;
def otmputStrike17 = PutStrike -  strikeSpacing * 17 - space;
plot otmput16 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume17 / division, 0)) then otmputStrike17 else Double.NaN;
def otmputStrike18 = PutStrike -  strikeSpacing * 18 - space;
plot otmput17 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume18 / division, 0)) then otmputStrike18 else Double.NaN;
def otmputStrike19 = PutStrike -  strikeSpacing * 19 - space;
plot otmput18 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume19 / division, 0)) then otmputStrike19 else Double.NaN;
def otmputStrike20 = PutStrike -  strikeSpacing * 20 - space;
plot otmput19 = if BarNumber() >= HighestAll(lastbar + shift_line_right) and  BarNumber() <= HighestAll(lastbar + shift_line_right + Round(putOptionvolume20 / division, 0)) then otmputStrike20 else Double.NaN;

atmcall.SetPaintingStrategy(PaintingStrategy.LINE);
atmcall.SetLineWeight(5);
atmcall.SetDefaultColor(GlobalColor("CallColor"));
otmcall.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall.SetLineWeight(5);
otmcall.SetDefaultColor(GlobalColor("CallColor"));
otmcall1.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall1.SetLineWeight(5);
otmcall1.SetDefaultColor(GlobalColor("CallColor"));
otmcall2.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall2.SetLineWeight(5);
otmcall2.SetDefaultColor(GlobalColor("CallColor"));
otmcall3.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall3.SetLineWeight(5);
otmcall3.SetDefaultColor(GlobalColor("CallColor"));
otmcall4.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall4.SetLineWeight(5);
otmcall4.SetDefaultColor(GlobalColor("CallColor"));
otmcall5.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall5.SetLineWeight(5);
otmcall5.SetDefaultColor(GlobalColor("CallColor"));
otmcall6.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall6.SetLineWeight(5);
otmcall6.SetDefaultColor(GlobalColor("CallColor"));
otmcall7.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall7.SetLineWeight(5);
otmcall7.SetDefaultColor(GlobalColor("CallColor"));
otmcall8.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall8.SetLineWeight(5);
otmcall8.SetDefaultColor(GlobalColor("CallColor"));
otmcall9.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall9.SetLineWeight(5);
otmcall9.SetDefaultColor(GlobalColor("CallColor"));
otmcall10.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall10.SetLineWeight(5);
otmcall10.SetDefaultColor(GlobalColor("CallColor"));
otmcall11.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall11.SetLineWeight(5);
otmcall11.SetDefaultColor(GlobalColor("CallColor"));
otmcall12.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall12.SetLineWeight(5);
otmcall12.SetDefaultColor(GlobalColor("CallColor"));
otmcall13.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall13.SetLineWeight(5);
otmcall13.SetDefaultColor(GlobalColor("CallColor"));
otmcall14.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall14.SetLineWeight(5);
otmcall14.SetDefaultColor(GlobalColor("CallColor"));
otmcall15.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall15.SetLineWeight(5);
otmcall15.SetDefaultColor(GlobalColor("CallColor"));
otmcall16.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall16.SetLineWeight(5);
otmcall16.SetDefaultColor(GlobalColor("CallColor"));
otmcall17.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall17.SetLineWeight(5);
otmcall17.SetDefaultColor(GlobalColor("CallColor"));
otmcall18.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall18.SetLineWeight(5);
otmcall18.SetDefaultColor(GlobalColor("CallColor"));
otmcall19.SetPaintingStrategy(PaintingStrategy.LINE);
otmcall19.SetLineWeight(5);
otmcall19.SetDefaultColor(GlobalColor("CallColor"));

itmcall.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall.SetLineWeight(5);
itmcall.SetDefaultColor(GlobalColor("CallColor"));
itmcall1.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall1.SetLineWeight(5);
itmcall1.SetDefaultColor(GlobalColor("CallColor"));
itmcall2.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall2.SetLineWeight(5);
itmcall2.SetDefaultColor(GlobalColor("CallColor"));
itmcall3.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall3.SetLineWeight(5);
itmcall3.SetDefaultColor(GlobalColor("CallColor"));
itmcall4.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall4.SetLineWeight(5);
itmcall4.SetDefaultColor(GlobalColor("CallColor"));
itmcall5.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall5.SetLineWeight(5);
itmcall5.SetDefaultColor(GlobalColor("CallColor"));
itmcall6.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall6.SetLineWeight(5);
itmcall6.SetDefaultColor(GlobalColor("CallColor"));
itmcall7.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall7.SetLineWeight(5);
itmcall7.SetDefaultColor(GlobalColor("CallColor"));
itmcall8.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall8.SetLineWeight(5);
itmcall8.SetDefaultColor(GlobalColor("CallColor"));
itmcall9.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall9.SetLineWeight(5);
itmcall9.SetDefaultColor(GlobalColor("CallColor"));
itmcall10.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall10.SetLineWeight(5);
itmcall10.SetDefaultColor(GlobalColor("CallColor"));
itmcall11.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall11.SetLineWeight(5);
itmcall11.SetDefaultColor(GlobalColor("CallColor"));
itmcall12.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall12.SetLineWeight(5);
itmcall12.SetDefaultColor(GlobalColor("CallColor"));
itmcall13.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall13.SetLineWeight(5);
itmcall13.SetDefaultColor(GlobalColor("CallColor"));
itmcall14.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall14.SetLineWeight(5);
itmcall14.SetDefaultColor(GlobalColor("CallColor"));
itmcall15.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall15.SetLineWeight(5);
itmcall15.SetDefaultColor(GlobalColor("CallColor"));
itmcall16.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall16.SetLineWeight(5);
itmcall16.SetDefaultColor(GlobalColor("CallColor"));
itmcall17.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall17.SetLineWeight(5);
itmcall17.SetDefaultColor(GlobalColor("CallColor"));
itmcall18.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall18.SetLineWeight(5);
itmcall18.SetDefaultColor(GlobalColor("CallColor"));
itmcall19.SetPaintingStrategy(PaintingStrategy.LINE);
itmcall19.SetLineWeight(5);
itmcall19.SetDefaultColor(GlobalColor("CallColor"));

atmput.SetPaintingStrategy(PaintingStrategy.LINE);
atmput.SetLineWeight(5);
atmput.SetDefaultColor(GlobalColor("PutColor"));
itmput.SetPaintingStrategy(PaintingStrategy.LINE);
itmput.SetLineWeight(5);
itmput.SetDefaultColor(GlobalColor("PutColor"));
itmput1.SetPaintingStrategy(PaintingStrategy.LINE);
itmput1.SetLineWeight(5);
itmput1.SetDefaultColor(GlobalColor("PutColor"));
itmput2.SetPaintingStrategy(PaintingStrategy.LINE);
itmput2.SetLineWeight(5);
itmput2.SetDefaultColor(GlobalColor("PutColor"));
itmput3.SetPaintingStrategy(PaintingStrategy.LINE);
itmput3.SetLineWeight(5);
itmput3.SetDefaultColor(GlobalColor("PutColor"));
itmput4.SetPaintingStrategy(PaintingStrategy.LINE);
itmput4.SetLineWeight(5);
itmput4.SetDefaultColor(GlobalColor("PutColor"));
itmput5.SetPaintingStrategy(PaintingStrategy.LINE);
itmput5.SetLineWeight(5);
itmput5.SetDefaultColor(GlobalColor("PutColor"));
itmput6.SetPaintingStrategy(PaintingStrategy.LINE);
itmput6.SetLineWeight(5);
itmput6.SetDefaultColor(GlobalColor("PutColor"));
itmput7.SetPaintingStrategy(PaintingStrategy.LINE);
itmput7.SetLineWeight(5);
itmput7.SetDefaultColor(GlobalColor("PutColor"));
itmput8.SetPaintingStrategy(PaintingStrategy.LINE);
itmput8.SetLineWeight(5);
itmput8.SetDefaultColor(GlobalColor("PutColor"));
itmput9.SetPaintingStrategy(PaintingStrategy.LINE);
itmput9.SetLineWeight(5);
itmput9.SetDefaultColor(GlobalColor("PutColor"));
itmput10.SetPaintingStrategy(PaintingStrategy.LINE);
itmput10.SetLineWeight(5);
itmput10.SetDefaultColor(GlobalColor("PutColor"));
itmput11.SetPaintingStrategy(PaintingStrategy.LINE);
itmput11.SetLineWeight(5);
itmput11.SetDefaultColor(GlobalColor("PutColor"));
itmput12.SetPaintingStrategy(PaintingStrategy.LINE);
itmput12.SetLineWeight(5);
itmput12.SetDefaultColor(GlobalColor("PutColor"));
itmput13.SetPaintingStrategy(PaintingStrategy.LINE);
itmput13.SetLineWeight(5);
itmput13.SetDefaultColor(GlobalColor("PutColor"));
itmput14.SetPaintingStrategy(PaintingStrategy.LINE);
itmput14.SetLineWeight(5);
itmput14.SetDefaultColor(GlobalColor("PutColor"));
itmput15.SetPaintingStrategy(PaintingStrategy.LINE);
itmput15.SetLineWeight(5);
itmput15.SetDefaultColor(GlobalColor("PutColor"));
itmput16.SetPaintingStrategy(PaintingStrategy.LINE);
itmput16.SetLineWeight(5);
itmput16.SetDefaultColor(GlobalColor("PutColor"));
itmput17.SetPaintingStrategy(PaintingStrategy.LINE);
itmput17.SetLineWeight(5);
itmput17.SetDefaultColor(GlobalColor("PutColor"));
itmput18.SetPaintingStrategy(PaintingStrategy.LINE);
itmput18.SetLineWeight(5);
itmput18.SetDefaultColor(GlobalColor("PutColor"));
itmput19.SetPaintingStrategy(PaintingStrategy.LINE);
itmput19.SetLineWeight(5);
itmput19.SetDefaultColor(GlobalColor("PutColor"));
otmput.SetPaintingStrategy(PaintingStrategy.LINE);
otmput.SetLineWeight(5);
otmput.SetDefaultColor(GlobalColor("PutColor"));
otmput1.SetPaintingStrategy(PaintingStrategy.LINE);
otmput1.SetLineWeight(5);
otmput1.SetDefaultColor(GlobalColor("PutColor"));
otmput2.SetPaintingStrategy(PaintingStrategy.LINE);
otmput2.SetLineWeight(5);
otmput2.SetDefaultColor(GlobalColor("PutColor"));
otmput3.SetPaintingStrategy(PaintingStrategy.LINE);
otmput3.SetLineWeight(5);
otmput3.SetDefaultColor(GlobalColor("PutColor"));
otmput4.SetPaintingStrategy(PaintingStrategy.LINE);
otmput4.SetLineWeight(5);
otmput4.SetDefaultColor(GlobalColor("PutColor"));
otmput5.SetPaintingStrategy(PaintingStrategy.LINE);
otmput5.SetLineWeight(5);
otmput5.SetDefaultColor(GlobalColor("PutColor"));
otmput6.SetPaintingStrategy(PaintingStrategy.LINE);
otmput6.SetLineWeight(5);
otmput6.SetDefaultColor(GlobalColor("PutColor"));
otmput7.SetPaintingStrategy(PaintingStrategy.LINE);
otmput7.SetLineWeight(5);
otmput7.SetDefaultColor(GlobalColor("PutColor"));
otmput8.SetPaintingStrategy(PaintingStrategy.LINE);
otmput8.SetLineWeight(5);
otmput8.SetDefaultColor(GlobalColor("PutColor"));
otmput9.SetPaintingStrategy(PaintingStrategy.LINE);
otmput9.SetLineWeight(5);
otmput9.SetDefaultColor(GlobalColor("PutColor"));
otmput10.SetPaintingStrategy(PaintingStrategy.LINE);
otmput10.SetLineWeight(5);
otmput10.SetDefaultColor(GlobalColor("PutColor"));
otmput11.SetPaintingStrategy(PaintingStrategy.LINE);
otmput11.SetLineWeight(5);
otmput11.SetDefaultColor(GlobalColor("PutColor"));
otmput12.SetPaintingStrategy(PaintingStrategy.LINE);
otmput12.SetLineWeight(5);
otmput12.SetDefaultColor(GlobalColor("PutColor"));
otmput13.SetPaintingStrategy(PaintingStrategy.LINE);
otmput13.SetLineWeight(5);
otmput13.SetDefaultColor(GlobalColor("PutColor"));
otmput14.SetPaintingStrategy(PaintingStrategy.LINE);
otmput14.SetLineWeight(5);
otmput14.SetDefaultColor(GlobalColor("PutColor"));
otmput15.SetPaintingStrategy(PaintingStrategy.LINE);
otmput15.SetLineWeight(5);
otmput15.SetDefaultColor(GlobalColor("PutColor"));
otmput16.SetPaintingStrategy(PaintingStrategy.LINE);
otmput16.SetLineWeight(5);
otmput16.SetDefaultColor(GlobalColor("PutColor"));
otmput17.SetPaintingStrategy(PaintingStrategy.LINE);
otmput17.SetLineWeight(5);
otmput17.SetDefaultColor(GlobalColor("PutColor"));
otmput18.SetPaintingStrategy(PaintingStrategy.LINE);
otmput18.SetLineWeight(5);
otmput18.SetDefaultColor(GlobalColor("PutColor"));
otmput19.SetPaintingStrategy(PaintingStrategy.LINE);
otmput19.SetLineWeight(5);
otmput19.SetDefaultColor(GlobalColor("PutColor"));
It's working well! I'm curious how you are using this information. Entry/Exit? Support/Resistance?
 
Most Recent Update
Edit: Now works for prices > 1000
Code:
#hint barLength: The number of bars used to calculate the ADX <b>(Default is 14)</b>


#hint barLength: The number of bars used to calculate the ADX <b>(Default is 14)</b>


def series = 1;

input show_label = yes;
input mode = {default AUTO, MANUAL};


def RTHopen = open(period = AggregationPeriod.DAY);
def CurrentYear = GetYear();
def CurrentMonth = GetMonth();
def CurrentDOM = GetDayOfMonth(GetYYYYMMDD());
def Day1DOW1 = GetDayOfWeek((CurrentYear * 10000) + (CurrentMonth * 100) + 1); # First DOM is this DOW
def FirstFridayDOM1 = if Day1DOW1 < 6
then 6 - Day1DOW1
else if Day1DOW1 == 6
then 7
else 6;

def SecondFridayDOM = FirstFridayDOM1 + 7;
def ThirdFridayDOM = FirstFridayDOM1 + 14;
def FourthFridayDOM = FirstFridayDOM1 + 21;
def RollDOM = FirstFridayDOM1 + 14; #changed to 21 to pick up all Fridays of the current month for weekly options
def ExpMonthA = if RollDOM > CurrentDOM #MK - expmonth1 changed to ExpmonthA
then CurrentMonth + series - 1
else CurrentMonth + series;

def ExpMonthB = if ExpMonthA > 12 #options month input -- #MK - expmonth2 changed to ExpmonthB
then ExpMonthA - 12
else ExpMonthA;

def ExpYear = if ExpMonthA > 12 #options year input
then CurrentYear + 1
else CurrentYear;


def Day1DOW = GetDayOfWeek(ExpYear * 10000 + ExpMonthB * 100 + 1); #first friday expiry calc
def FirstFridayDOM = if Day1DOW < 6
then 6 - Day1DOW
else if Day1DOW == 6
then 7
else 6;

#MK added easier input to fix date
input datefix = 0;
def ExpDOM = FirstFridayDOM + 14 + datefix;

def ExpMonth2 = ExpMonthB; #MK in case more date issues need to be fixed

#strike spacing inputs
input maxStrikeSpacing = 25;
input manualCenterStrike = 440;
input manualStrikeSpacing = 1.0;


#centerstrike
rec centerStrike = if (mode == mode.AUTO and !IsNaN(close)) then Round(close / 10.0, 0) * 10.0 else if (mode == mode.MANUAL and !IsNaN(close)) then manualcenterstrike else centerStrike[1]; #MK - imported from prev code - plot now working

#strikeSpacing
def strikeSpacingC = fold i = 1 to maxStrikeSpacing with spacing = 0 do if !IsNaN( open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", Asprice(centerStrike + (maxStrikeSpacing - i)))))) then maxStrikeSpacing - i else spacing;

rec strikeSpacing = if (mode == mode.AUTO and !IsNaN(close)) then strikeSpacingC else if (mode == mode.MANUAL and !IsNaN(close)) then manualStrikeSpacing else strikeSpacing[1];

### bar vars ###
input displayOffset = 5; # Number of bars to right of current bar for display
input barWeight = 1;
rec barOffset = if !IsNaN(close) then strikeSpacing / 10.0 else barOffset[1];
rec extBar = if IsNaN(close[displayOffset]) then extBar[1] + 1 else 0; # Number of bars of right space minus 5
input barLength = 45;

#call/put colors
DefineGlobalColor("Calls", Color.GREEN);
DefineGlobalColor("Puts", Color.RED);

#current option expiry label
#AddLabel(yes, Concat("Expiration: ", Concat(Concat(ExpYear - 2000,
        #if ExpMonth2 <= 9 then Concat("0", ExpMonth2)
            #else Concat("", ExpMonth2)),
        #if ExpDOM <= 9 then Concat("0", ExpDOM)
            #else Concat("", ExpDOM))), Color.WHITE);


AddLabel(yes, (Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM))))));
addLabel(yes, (Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike)))));


#options calculations **************

def c1_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing *0 ))));
def c2_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 1))));
def c3_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 2))));
def c4_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 3))));
def c5_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing))));
def c6_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 2))));
def c7_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 3))));

def c8_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 4))));
def c9_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 4))));
def c10_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 5))));
def c11_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 5))));
def c12_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 6))));
def c13_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 6))));
def c14_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 7))));
def c15_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 7))));
def c16_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 8))));
def c17_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 8))));
def c18_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 9))));
def c19_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 9))));
def c20_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 10))));
def c21_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 10))));
def c22_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 11))));
def c23_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 11))));
def c24_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 12))));
def c25_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 12))));
def c26_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 13))));
def c27_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 13))));
def c28_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 14))));
def c29_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 14))));
def c30_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 15))));
def c31_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 15))));
def c32_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 16))));
def c33_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 16))));
def c34_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 17))));
def c35_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 17))));
def c36_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 18))));
def c37_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 18))));
def c38_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike - strikeSpacing * 19))));
def c39_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("C", AsPrice(centerStrike + strikeSpacing * 19))));

#puts
def p1_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike))));
def p2_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing))));
def p3_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 2))));
def p4_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 3))));

def p5_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing))));
def p6_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 2))));
def p7_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 3))));

def p8_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 4))));
def p9_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 4))));
def p10_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 5))));
def p11_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 5))));
def p12_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 6))));
def p13_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 6))));
def p14_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 7))));
def p15_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 7))));
def p16_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 8))));
def p17_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 8))));
def p18_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 9))));
def p19_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 9))));
def p20_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 10))));
def p21_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 10))));
def p22_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 11))));
def p23_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 11))));
def p24_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 12))));
def p25_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 12))));
def p26_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 13))));
def p27_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 13))));
def p28_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 14))));
def p29_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 14))));
def p30_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 15))));
def p31_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 15))));
def p32_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 16))));
def p33_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 16))));
def p34_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 17))));
def p35_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 17))));
def p36_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 18))));
def p37_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 18))));
def p38_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike - strikeSpacing * 19))));
def p39_V_d = open_interest(Concat(Concat(".", Concat(GetSymbolPart(), Concat(Concat(ExpYear - 2000, if ExpMonth2 <= 9 then Concat("0", ExpMonth2) else Concat("", ExpMonth2)), if ExpDOM <= 9 then Concat("0", ExpDOM) else Concat("", ExpDOM)))), Concat("P", AsPrice(centerStrike + strikeSpacing * 19))));

def c1_V = if !IsNaN(c1_V_d) then c1_V_d else 0;
def c2_V = if !IsNaN(c2_V_d) then c2_V_d else 0;
def c3_V = if !IsNaN(c3_V_d) then c3_V_d else 0;
def c4_V = if !IsNaN(c4_V_d) then c4_V_d else 0;
def c5_V = if !IsNaN(c5_V_d) then c5_V_d else 0;
def c6_V = if !IsNaN(c6_V_d) then c6_V_d else 0;
def c7_V = if !IsNaN(c7_V_d) then c7_V_d else 0;
def c8_V = if !IsNaN(c8_V_d) then c8_V_d else 0;
def c9_V = if !IsNaN(c9_V_d) then c9_V_d else 0;
def c10_V = if !IsNaN(c10_V_d) then c10_V_d else 0;
def c11_V = if !IsNaN(c11_V_d) then c11_V_d else 0;

def c12_V = if !IsNaN(c12_V_d) then c12_V_d else 0;
def c13_V = if !IsNaN(c13_V_d) then c13_V_d else 0;
def c14_V = if !IsNaN(c14_V_d) then c14_V_d else 0;
def c15_V = if !IsNaN(c15_V_d) then c15_V_d else 0;
def c16_V = if !IsNaN(c16_V_d) then c16_V_d else 0;
def c17_V = if !IsNaN(c17_V_d) then c17_V_d else 0;
def c18_V = if !IsNaN(c18_V_d) then c18_V_d else 0;
def c19_V = if !IsNaN(c19_V_d) then c19_V_d else 0;
def c20_V = if !IsNaN(c20_V_d) then c20_V_d else 0;
def c21_V = if !IsNaN(c21_V_d) then c21_V_d else 0;
def c22_V = if !IsNaN(c22_V_d) then c22_V_d else 0;
def c23_V = if !IsNaN(c23_V_d) then c23_V_d else 0;
def c24_V = if !IsNaN(c24_V_d) then c24_V_d else 0;
def c25_V = if !IsNaN(c25_V_d) then c25_V_d else 0;
def c26_V = if !IsNaN(c26_V_d) then c26_V_d else 0;
def c27_V = if !IsNaN(c27_V_d) then c27_V_d else 0;
def c28_V = if !IsNaN(c28_V_d) then c28_V_d else 0;
def c29_V = if !IsNaN(c29_V_d) then c29_V_d else 0;
def c30_V = if !IsNaN(c30_V_d) then c30_V_d else 0;

def c31_V = if !IsNaN(c31_V_d) then c31_V_d else 0;
def c32_V = if !IsNaN(c32_V_d) then c32_V_d else 0;
def c33_V = if !IsNaN(c33_V_d) then c33_V_d else 0;
def c34_V = if !IsNaN(c34_V_d) then c34_V_d else 0;
def c35_V = if !IsNaN(c35_V_d) then c35_V_d else 0;
def c36_V = if !IsNaN(c36_V_d) then c36_V_d else 0;
def c37_V = if !IsNaN(c37_V_d) then c37_V_d else 0;
def c38_V = if !IsNaN(c38_V_d) then c38_V_d else 0;

def p1_V = if !IsNaN(p1_V_d) then p1_V_d else 0;
def p2_V = if !IsNaN(p2_V_d) then p2_V_d else 0;
def p3_V = if !IsNaN(p3_V_d) then p3_V_d else 0;
def p4_V = if !IsNaN(p4_V_d) then p4_V_d else 0;
def p5_V = if !IsNaN(p5_V_d) then p5_V_d else 0;
def p6_V = if !IsNaN(p6_V_d) then p6_V_d else 0;
def p7_V = if !IsNaN(p7_V_d) then p7_V_d else 0;
def p8_V = if !IsNaN(p8_V_d) then p8_V_d else 0;
def p9_V = if !IsNaN(p9_V_d) then p9_V_d else 0;
def p10_V = if !IsNaN(p10_V_d) then p10_V_d else 0;
def p11_V = if !IsNaN(p11_V_d) then p11_V_d else 0;

def p12_V = if !IsNaN(p12_V_d) then p12_V_d else 0;
def p13_V = if !IsNaN(p13_V_d) then p13_V_d else 0;
def p14_V = if !IsNaN(p14_V_d) then p14_V_d else 0;
def p15_V = if !IsNaN(p15_V_d) then p15_V_d else 0;
def p16_V = if !IsNaN(p16_V_d) then p16_V_d else 0;
def p17_V = if !IsNaN(p17_V_d) then p17_V_d else 0;
def p18_V = if !IsNaN(p18_V_d) then p18_V_d else 0;
def p19_V = if !IsNaN(p19_V_d) then p19_V_d else 0;
def p20_V = if !IsNaN(p20_V_d) then p20_V_d else 0;
def p21_V = if !IsNaN(p21_V_d) then p21_V_d else 0;
def p22_V = if !IsNaN(p22_V_d) then p22_V_d else 0;
def p23_V = if !IsNaN(p23_V_d) then p23_V_d else 0;
def p24_V = if !IsNaN(p24_V_d) then p24_V_d else 0;
def p25_V = if !IsNaN(p25_V_d) then p25_V_d else 0;
def p26_V = if !IsNaN(p26_V_d) then p26_V_d else 0;
def p27_V = if !IsNaN(p27_V_d) then p27_V_d else 0;
def p28_V = if !IsNaN(p28_V_d) then p28_V_d else 0;
def p29_V = if !IsNaN(p29_V_d) then p29_V_d else 0;
def p30_V = if !IsNaN(p30_V_d) then p30_V_d else 0;

def p31_V = if !IsNaN(p31_V_d) then p31_V_d else 0;
def p32_V = if !IsNaN(p32_V_d) then p32_V_d else 0;
def p33_V = if !IsNaN(p33_V_d) then p33_V_d else 0;
def p34_V = if !IsNaN(p34_V_d) then p34_V_d else 0;
def p35_V = if !IsNaN(p35_V_d) then p35_V_d else 0;
def p36_V = if !IsNaN(p36_V_d) then p36_V_d else 0;
def p37_V = if !IsNaN(p37_V_d) then p37_V_d else 0;
def p38_V = if !IsNaN(p38_V_d) then p38_V_d else 0;


def c1t = Max(Max(Max(Max(c1_V, c2_V), c3_V), c4_V), c5_V);
def c2t = Max(Max(Max(Max(Max(c6_V, c7_V), c8_V), c9_V), c10_V), c11_V);

def c3t = Max(Max(Max(Max(Max(Max(Max(c12_V, c13_V), c14_V), c15_V), c16_V), c17_V),c18_V),c19_V);
def c4t = Max(Max(Max(Max(Max(c20_V, c21_V),c22_V),c23_V),c24_V),c25_V);
def c5t = Max(Max(Max(Max(Max(Max(c26_V,c27_V),c28_v),c29_v),c30_V),c31_v),c32_v);
def c6t = Max(Max(Max(Max(Max(c33_V,c34_V),c35_v),c36_v),c37_V),c38_v);

def p1t = Max(Max(Max(Max(p1_V, p2_V), p3_V), p4_V), p5_V);
def p2t = Max(Max(Max(Max(Max(p6_V, p7_V), p8_V), p9_V), p10_V), p11_V);

def p3t = Max(Max(Max(Max(Max(Max(Max(p12_V, p13_V), p14_V), p15_V), p16_V), p17_V),p18_V),p19_V);
def p4t = Max(Max(Max(Max(Max(p20_V, p21_V),p22_V),p23_V),p24_V),p25_V);
def p5t = Max(Max(Max(Max(Max(Max(p26_V,p27_V),p28_v),p29_v),p30_V),p31_v),p32_v);
def p6t = Max(Max(Max(Max(Max(p33_V,p34_V),p35_v),p36_v),p37_V),p38_v);



def c_V_max = Max(Max(Max(Max(Max(c1t, c2t), c3t), c4t),c5t),c6t);
def p_V_max = Max(Max(Max(Max(Max(p1t, p2t), p3t), p4t),p5t),p6t);
def OI_max = Max(c_V_max, p_V_max);

def cVT = c1_V + c2_V + c3_V + c4_V + c5_V + c6_V + c7_V + c8_V + c9_V + c10_V + c11_V + c12_V + c13_V + c14_V + c15_V + c16_V + c17_V + c18_V + c19_V + c20_V + c21_V + c22_V + c23_V + c24_V + c25_V + c26_V + c27_V + c28_V + c29_V + c30_V + c31_V + c32_V + c33_V + c34_V + c35_V + c36_V + c37_V + c38_V;

def pVT = p1_V + p2_V + p3_V + p4_V + p5_V + p6_V + p7_V + p8_V + p9_V + p10_V + p11_V + p12_V + p13_V + p14_V + p15_V + p16_V + p17_V + p18_V + p19_V + p20_V + p21_V + p22_V + p23_V + p24_V + p25_V + p26_V + p27_V + p28_V + p29_V + p30_V + p31_V + p32_V + p33_V + p34_V + p35_V + p36_V + p37_V + p38_V;

AddLabel(yes, Concat("Call OI: ", cVT), GlobalColor("Calls"));
AddLabel(yes, Concat("Put OI: ", pVT), GlobalColor("Puts"));


#strike spacing
def strikespac = if mode == mode.AUTO then strikeSpacing else 1; #MK - auto pricerange option
AddLabel(show_label, Concat("Strike Spacing: ", strikespac), Color.WHITE);

rec c1_D = if IsNaN(close) then c1_D[1] else Ceil((c1_V / OI_max) * barLength);
plot C1 = if c1_D >= extBar and extBar != 0 then centerStrike + barOffset else Double.NaN;
C1.SetDefaultColor(GlobalColor("Calls") );
C1.SetLineWeight(barWeight);

rec c2_D = if IsNaN(close) then c2_D[1] else Ceil((c2_V / OI_max) * barLength);
plot C2 = if c2_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac else Double.NaN;
C2.SetDefaultColor(GlobalColor("Calls"));
C2.SetLineWeight(barWeight);

rec c3_D = if IsNaN(close) then c3_D[1] else Ceil((c3_V / OI_max) * barLength);
plot C3 = if c3_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 2 else Double.NaN;
C3.SetDefaultColor(GlobalColor("Calls"));
C3.SetLineWeight(barWeight);

rec c4_D = if IsNaN(close) then c4_D[1] else Ceil((c4_V / OI_max) * barLength);
plot C4 = if c4_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 3 else Double.NaN;
C4.SetDefaultColor(GlobalColor("Calls"));
C4.SetLineWeight(barWeight);

rec c5_D = if IsNaN(close) then c5_D[1] else Ceil((c5_V / OI_max) * barLength);
plot C5 = if c5_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac else Double.NaN;
C5.SetDefaultColor(GlobalColor("Calls"));
C5.SetLineWeight(barWeight);

rec c6_D = if IsNaN(close) then c6_D[1] else Ceil((c6_V / OI_max) * barLength);
plot C6 = if c6_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 2 else Double.NaN;
C6.SetDefaultColor(GlobalColor("Calls"));
C6.SetLineWeight(barWeight);

rec c7_D = if IsNaN(close) then c7_D[1] else Ceil((c7_V / OI_max) * barLength);
plot C7 = if c7_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 3 else Double.NaN;
C7.SetDefaultColor(GlobalColor("Calls"));
C7.SetLineWeight(barWeight);

rec c8_D = if IsNaN(close) then c8_D[1] else Ceil((c8_V / OI_max) * barLength);
plot C8 = if c8_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 4 else Double.NaN;
C8.SetDefaultColor(GlobalColor("Calls"));
C8.SetLineWeight(barWeight);

rec c9_D = if IsNaN(close) then c9_D[1] else Ceil((c9_V / OI_max) * barLength);
plot C9 = if c9_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 4 else Double.NaN;
C9.SetDefaultColor(GlobalColor("Calls"));
C9.SetLineWeight(barWeight);

rec c10_D = if IsNaN(close) then c10_D[1] else Ceil((c10_V / OI_max) * barLength);
plot C10 = if c10_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 5 else Double.NaN;
C10.SetDefaultColor(GlobalColor("Calls"));
C10.SetLineWeight(barWeight);

rec c11_D = if IsNaN(close) then c11_D[1] else Ceil((c11_V / OI_max) * barLength);
plot C11 = if c11_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 5 else Double.NaN;
C11.SetDefaultColor(GlobalColor("Calls"));
C11.SetLineWeight(barWeight);

rec c12_D = if IsNaN(close) then c12_D[1] else Ceil((c12_V / OI_max) * barLength);
plot C12 = if c12_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 6 else Double.NaN;
C12.SetDefaultColor(GlobalColor("Calls"));
C12.SetLineWeight(barWeight);

rec c13_D = if IsNaN(close) then c13_D[1] else Ceil((c13_V / OI_max) * barLength);
plot C13 = if c13_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 6 else Double.NaN;
C13.SetDefaultColor(GlobalColor("Calls"));
C13.SetLineWeight(barWeight);

rec c14_D = if IsNaN(close) then c14_D[1] else Ceil((c14_V / OI_max) * barLength);
plot C14 = if c14_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 7 else Double.NaN;
C14.SetDefaultColor(GlobalColor("Calls"));
C14.SetLineWeight(barWeight);

rec c15_D = if IsNaN(close) then c15_D[1] else Ceil((c15_V / OI_max) * barLength);
plot C15 = if c15_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 7 else Double.NaN;
C15.SetDefaultColor(GlobalColor("Calls"));
C15.SetLineWeight(barWeight);

rec c16_D = if IsNaN(close) then c16_D[1] else Ceil((c16_V / OI_max) * barLength);
plot C16 = if c16_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 8 else Double.NaN;
C16.SetDefaultColor(GlobalColor("Calls"));
C16.SetLineWeight(barWeight);

rec c17_D = if IsNaN(close) then c17_D[1] else Ceil((c17_V / OI_max) * barLength);
plot C17 = if c17_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 8 else Double.NaN;
C17.SetDefaultColor(GlobalColor("Calls"));
C17.SetLineWeight(barWeight);

rec c18_D = if IsNaN(close) then c18_D[1] else Ceil((c18_V / OI_max) * barLength);
plot C18 = if c18_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 9 else Double.NaN;
C18.SetDefaultColor(GlobalColor("Calls"));
C18.SetLineWeight(barWeight);

rec c19_D = if IsNaN(close) then c19_D[1] else Ceil((c19_V / OI_max) * barLength);
plot C19 = if c19_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 9 else Double.NaN;
C19.SetDefaultColor(GlobalColor("Calls"));
C19.SetLineWeight(barWeight);

rec c20_D = if IsNaN(close) then c20_D[1] else Ceil((c20_V / OI_max) * barLength);
plot C20 = if c20_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 10 else Double.NaN;
C20.SetDefaultColor(GlobalColor("Calls"));
C20.SetLineWeight(barWeight);

rec c21_D = if IsNaN(close) then c21_D[1] else Ceil((c21_V / OI_max) * barLength);
plot C21 = if c21_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 10 else Double.NaN;
C21.SetDefaultColor(GlobalColor("Calls"));
C21.SetLineWeight(barWeight);

rec c22_D = if IsNaN(close) then c22_D[1] else Ceil((c22_V / OI_max) * barLength);
plot C22 = if c22_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 11 else Double.NaN;
C22.SetDefaultColor(GlobalColor("Calls"));
C22.SetLineWeight(barWeight);

rec c23_D = if IsNaN(close) then c23_D[1] else Ceil((c23_V / OI_max) * barLength);
plot C23 = if c23_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 11 else Double.NaN;
C23.SetDefaultColor(GlobalColor("Calls"));
C23.SetLineWeight(barWeight);

rec c24_D = if IsNaN(close) then c24_D[1] else Ceil((c24_V / OI_max) * barLength);
plot C24 = if c24_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 12 else Double.NaN;
C24.SetDefaultColor(GlobalColor("Calls"));
C24.SetLineWeight(barWeight);

rec c25_D = if IsNaN(close) then c25_D[1] else Ceil((c25_V / OI_max) * barLength);
plot C25 = if c25_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 12 else Double.NaN;
C25.SetDefaultColor(GlobalColor("Calls"));
C25.SetLineWeight(barWeight);

rec c26_D = if IsNaN(close) then c26_D[1] else Ceil((c26_V / OI_max) * barLength);
plot C26 = if c26_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 13 else Double.NaN;
C26.SetDefaultColor(GlobalColor("Calls"));
C26.SetLineWeight(barWeight);

rec c27_D = if IsNaN(close) then c27_D[1] else Ceil((c27_V / OI_max) * barLength);
plot C27 = if c27_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 13 else Double.NaN;
C27.SetDefaultColor(GlobalColor("Calls"));
C27.SetLineWeight(barWeight);

rec c28_D = if IsNaN(close) then c28_D[1] else Ceil((c28_V / OI_max) * barLength);
plot C28 = if c28_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 14 else Double.NaN;
C28.SetDefaultColor(GlobalColor("Calls"));
C28.SetLineWeight(barWeight);

rec c29_D = if IsNaN(close) then c29_D[1] else Ceil((c29_V / OI_max) * barLength);
plot C29 = if c29_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 14 else Double.NaN;
C29.SetDefaultColor(GlobalColor("Calls"));
C29.SetLineWeight(barWeight);

rec c30_D = if IsNaN(close) then c30_D[1] else Ceil((c30_V / OI_max) * barLength);
plot C30 = if c30_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 15 else Double.NaN;
C30.SetDefaultColor(GlobalColor("Calls"));
C30.SetLineWeight(barWeight);

rec c31_D = if IsNaN(close) then c31_D[1] else Ceil((c31_V / OI_max) * barLength);
plot C31 = if c31_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 15 else Double.NaN;
C31.SetDefaultColor(GlobalColor("Calls"));
C31.SetLineWeight(barWeight);

rec c32_D = if IsNaN(close) then c32_D[1] else Ceil((c32_V / OI_max) * barLength);
plot C32 = if c32_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 16 else Double.NaN;
C32.SetDefaultColor(GlobalColor("Calls"));
C32.SetLineWeight(barWeight);

rec c33_D = if IsNaN(close) then c33_D[1] else Ceil((c33_V / OI_max) * barLength);
plot C33 = if c33_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 16 else Double.NaN;
C33.SetDefaultColor(GlobalColor("Calls"));
C33.SetLineWeight(barWeight);

rec c34_D = if IsNaN(close) then c34_D[1] else Ceil((c34_V / OI_max) * barLength);
plot C34 = if c34_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 17 else Double.NaN;
C34.SetDefaultColor(GlobalColor("Calls"));
C34.SetLineWeight(barWeight);

rec c35_D = if IsNaN(close) then c35_D[1] else Ceil((c35_V / OI_max) * barLength);
plot C35 = if c35_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 17 else Double.NaN;
C35.SetDefaultColor(GlobalColor("Calls"));
C35.SetLineWeight(barWeight);

rec c36_D = if IsNaN(close) then c36_D[1] else Ceil((c36_V / OI_max) * barLength);
plot C36 = if c36_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 18 else Double.NaN;
C36.SetDefaultColor(GlobalColor("Calls"));
C36.SetLineWeight(barWeight);

rec c37_D = if IsNaN(close) then c37_D[1] else Ceil((c37_V / OI_max) * barLength);
plot C37 = if c37_D >= extBar and extBar != 0 then centerStrike + barOffset + strikespac * 18 else Double.NaN;
C37.SetDefaultColor(GlobalColor("Calls"));
C37.SetLineWeight(barWeight);

rec c38_D = if IsNaN(close) then c38_D[1] else Ceil((c38_V / OI_max) * barLength);
plot C38 = if c38_D >= extBar and extBar != 0 then centerStrike + barOffset - strikespac * 19 else Double.NaN;
C38.SetDefaultColor(GlobalColor("Calls"));
C38.SetLineWeight(barWeight);


rec p1_D = if IsNaN(close) then p1_D[1] else Ceil((p1_V / OI_max) * barLength);
plot P1 = if p1_D >= extBar and extBar != 0 then centerStrike - barOffset else Double.NaN;
P1.SetDefaultColor(GlobalColor("Puts") );
P1.SetLineWeight(barWeight);

rec p2_D = if IsNaN(close) then p2_D[1] else Ceil((p2_V / OI_max) * barLength);
plot P2 = if p2_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac else Double.NaN;
P2.SetDefaultColor(GlobalColor("Puts"));
P2.SetLineWeight(barWeight);

rec p3_D = if IsNaN(close) then p3_D[1] else Ceil((p3_V / OI_max) * barLength);
plot P3 = if p3_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 2 else Double.NaN;
P3.SetDefaultColor(GlobalColor("Puts"));
P3.SetLineWeight(barWeight);

rec p4_D = if IsNaN(close) then p4_D[1] else Ceil((p4_V / OI_max) * barLength);
plot P4 = if p4_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 3 else Double.NaN;
P4.SetDefaultColor(GlobalColor("Puts"));
P4.SetLineWeight(barWeight);

rec p5_D = if IsNaN(close) then p5_D[1] else Ceil((p5_V / OI_max) * barLength);
plot P5 = if p5_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac else Double.NaN;
P5.SetDefaultColor(GlobalColor("Puts"));
P5.SetLineWeight(barWeight);

rec p6_D = if IsNaN(close) then p6_D[1] else Ceil((p6_V / OI_max) * barLength);
plot P6 = if p6_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 2 else Double.NaN;
P6.SetDefaultColor(GlobalColor("Puts"));
P6.SetLineWeight(barWeight);

rec p7_D = if IsNaN(close) then p7_D[1] else Ceil((p7_V / OI_max) * barLength);
plot P7 = if p7_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 3 else Double.NaN;
P7.SetDefaultColor(GlobalColor("Puts"));
P7.SetLineWeight(barWeight);

rec p8_D = if IsNaN(close) then p8_D[1] else Ceil((p8_V / OI_max) * barLength);
plot P8 = if p8_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 4 else Double.NaN;
P8.SetDefaultColor(GlobalColor("Puts"));
P8.SetLineWeight(barWeight);

rec p9_D = if IsNaN(close) then p9_D[1] else Ceil((p9_V / OI_max) * barLength);
plot P9 = if p9_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 4 else Double.NaN;
P9.SetDefaultColor(GlobalColor("Puts"));
P9.SetLineWeight(barWeight);

rec p10_D = if IsNaN(close) then p10_D[1] else Ceil((p10_V / OI_max) * barLength);
plot P10 = if p10_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 5 else Double.NaN;
P10.SetDefaultColor(GlobalColor("Puts"));
P10.SetLineWeight(barWeight);

rec p11_D = if IsNaN(close) then p11_D[1] else Ceil((p11_V / OI_max) * barLength);
plot P11 = if p11_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 5 else Double.NaN;
P11.SetDefaultColor(GlobalColor("Puts"));
P11.SetLineWeight(barWeight);

rec p12_D = if IsNaN(close) then p12_D[1] else Ceil((p12_V / OI_max) * barLength);
plot P12 = if p12_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 6 else Double.NaN;
P12.SetDefaultColor(GlobalColor("Puts"));
P12.SetLineWeight(barWeight);

rec p13_D = if IsNaN(close) then p13_D[1] else Ceil((p13_V / OI_max) * barLength);
plot P13 = if p13_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 6 else Double.NaN;
P13.SetDefaultColor(GlobalColor("Puts"));
P13.SetLineWeight(barWeight);

rec p14_D = if IsNaN(close) then p14_D[1] else Ceil((p14_V / OI_max) * barLength);
plot P14 = if p14_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 7 else Double.NaN;
P14.SetDefaultColor(GlobalColor("Puts"));
P14.SetLineWeight(barWeight);

rec p15_D = if IsNaN(close) then p15_D[1] else Ceil((p15_V / OI_max) * barLength);
plot P15 = if p15_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 7 else Double.NaN;
P15.SetDefaultColor(GlobalColor("Puts"));
P15.SetLineWeight(barWeight);

rec p16_D = if IsNaN(close) then p16_D[1] else Ceil((p16_V / OI_max) * barLength);
plot P16 = if p16_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 8 else Double.NaN;
P16.SetDefaultColor(GlobalColor("Puts"));
P16.SetLineWeight(barWeight);

rec p17_D = if IsNaN(close) then p17_D[1] else Ceil((p17_V / OI_max) * barLength);
plot P17 = if p17_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 8 else Double.NaN;
P17.SetDefaultColor(GlobalColor("Puts"));
P17.SetLineWeight(barWeight);

rec p18_D = if IsNaN(close) then p18_D[1] else Ceil((p18_V / OI_max) * barLength);
plot P18 = if p18_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 9 else Double.NaN;
P18.SetDefaultColor(GlobalColor("Puts"));
P18.SetLineWeight(barWeight);

rec p19_D = if IsNaN(close) then p19_D[1] else Ceil((p19_V / OI_max) * barLength);
plot P19 = if p19_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 9 else Double.NaN;
P19.SetDefaultColor(GlobalColor("Puts"));
P19.SetLineWeight(barWeight);

rec p20_D = if IsNaN(close) then p20_D[1] else Ceil((p20_V / OI_max) * barLength);
plot p20 = if p20_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 10 else Double.NaN;
P20.SetDefaultColor(GlobalColor("Puts"));
P20.SetLineWeight(barWeight);

rec p21_D = if IsNaN(close) then p21_D[1] else Ceil((P21_V / OI_max) * barLength);
plot P21 = if p21_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 10 else Double.NaN;
P21.SetDefaultColor(GlobalColor("Puts"));
P21.SetLineWeight(barWeight);

rec p22_D = if IsNaN(close) then p22_D[1] else Ceil((p22_V / OI_max) * barLength);
plot P22 = if p22_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 11 else Double.NaN;
P22.SetDefaultColor(GlobalColor("Puts"));
P22.SetLineWeight(barWeight);

rec p23_D = if IsNaN(close) then p23_D[1] else Ceil((p23_V / OI_max) * barLength);
plot P23 = if p23_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 11 else Double.NaN;
P23.SetDefaultColor(GlobalColor("Puts"));
P23.SetLineWeight(barWeight);

rec p24_D = if IsNaN(close) then p24_D[1] else Ceil((p24_V / OI_max) * barLength);
plot P24 = if p24_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 12 else Double.NaN;
P24.SetDefaultColor(GlobalColor("Puts"));
P24.SetLineWeight(barWeight);

rec p25_D = if IsNaN(close) then p25_D[1] else Ceil((p25_V / OI_max) * barLength);
plot P25 = if p25_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 12 else Double.NaN;
P25.SetDefaultColor(GlobalColor("Puts"));
P25.SetLineWeight(barWeight);

rec p26_D = if IsNaN(close) then p26_D[1] else Ceil((p26_V / OI_max) * barLength);
plot P26 = if p26_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 13 else Double.NaN;
P26.SetDefaultColor(GlobalColor("Puts"));
P26.SetLineWeight(barWeight);

rec p27_D = if IsNaN(close) then p27_D[1] else Ceil((p27_V / OI_max) * barLength);
plot P27 = if p27_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 13 else Double.NaN;
P27.SetDefaultColor(GlobalColor("Puts"));
P27.SetLineWeight(barWeight);

rec p28_D = if IsNaN(close) then p28_D[1] else Ceil((p28_V / OI_max) * barLength);
plot P28 = if p28_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 14 else Double.NaN;
P28.SetDefaultColor(GlobalColor("Puts"));
P28.SetLineWeight(barWeight);

rec p29_D = if IsNaN(close) then p29_D[1] else Ceil((p29_V / OI_max) * barLength);
plot P29 = if p29_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 14 else Double.NaN;
P29.SetDefaultColor(GlobalColor("Puts"));
P29.SetLineWeight(barWeight);

rec p30_D = if IsNaN(close) then p30_D[1] else Ceil((p30_V / OI_max) * barLength);
plot P30 = if p30_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 15 else Double.NaN;
P30.SetDefaultColor(GlobalColor("Puts"));
P30.SetLineWeight(barWeight);

rec p31_D = if IsNaN(close) then p31_D[1] else Ceil((p31_V / OI_max) * barLength);
plot P31 = if p31_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 15 else Double.NaN;
P31.SetDefaultColor(GlobalColor("Puts"));
P31.SetLineWeight(barWeight);

rec p32_D = if IsNaN(close) then p32_D[1] else Ceil((p32_V / OI_max) * barLength);
plot P32 = if p32_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 16 else Double.NaN;
P32.SetDefaultColor(GlobalColor("Puts"));
P32.SetLineWeight(barWeight);

rec p33_D = if IsNaN(close) then p33_D[1] else Ceil((p33_V / OI_max) * barLength);
plot P33 = if p33_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 16 else Double.NaN;
P33.SetDefaultColor(GlobalColor("Puts"));
P33.SetLineWeight(barWeight);

rec p34_D = if IsNaN(close) then p34_D[1] else Ceil((p34_V / OI_max) * barLength);
plot P34 = if p34_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 17 else Double.NaN;
P34.SetDefaultColor(GlobalColor("Puts"));
P34.SetLineWeight(barWeight);

rec p35_D = if IsNaN(close) then p35_D[1] else Ceil((p35_V / OI_max) * barLength);
plot P35 = if p35_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 17 else Double.NaN;
P35.SetDefaultColor(GlobalColor("Puts"));
P35.SetLineWeight(barWeight);

rec p36_D = if IsNaN(close) then p36_D[1] else Ceil((p36_V / OI_max) * barLength);
plot P36 = if p36_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 18 else Double.NaN;
P36.SetDefaultColor(GlobalColor("Puts"));
P36.SetLineWeight(barWeight);

rec p37_D = if IsNaN(close) then p37_D[1] else Ceil((p37_V / OI_max) * barLength);
plot P37 = if p37_D >= extBar and extBar != 0 then centerStrike - barOffset + strikespac * 18 else Double.NaN;
P37.SetDefaultColor(GlobalColor("Puts"));
P37.SetLineWeight(barWeight);

rec p38_D = if IsNaN(close) then p38_D[1] else Ceil((p38_V / OI_max) * barLength);
plot P38 = if p38_D >= extBar and extBar != 0 then centerStrike - barOffset - strikespac * 19 else Double.NaN;
P38.SetDefaultColor(GlobalColor("Puts"));
P38.SetLineWeight(barWeight);


C1.SetPaintingStrategy(PaintingStrategy.DASHES);
C2.SetPaintingStrategy(PaintingStrategy.DASHES);
C3.SetPaintingStrategy(PaintingStrategy.DASHES);
C4.SetPaintingStrategy(PaintingStrategy.DASHES);
C5.SetPaintingStrategy(PaintingStrategy.DASHES);
C6.SetPaintingStrategy(PaintingStrategy.DASHES);
C7.SetPaintingStrategy(PaintingStrategy.DASHES);
C8.SetPaintingStrategy(PaintingStrategy.DASHES);
C9.SetPaintingStrategy(PaintingStrategy.DASHES);
C10.SetPaintingStrategy(PaintingStrategy.DASHES);
C11.SetPaintingStrategy(PaintingStrategy.DASHES);

C12.SetPaintingStrategy(PaintingStrategy.DASHES);
C13.SetPaintingStrategy(PaintingStrategy.DASHES);
C14.SetPaintingStrategy(PaintingStrategy.DASHES);
C15.SetPaintingStrategy(PaintingStrategy.DASHES);
C16.SetPaintingStrategy(PaintingStrategy.DASHES);
C17.SetPaintingStrategy(PaintingStrategy.DASHES);
C18.SetPaintingStrategy(PaintingStrategy.DASHES);
C19.SetPaintingStrategy(PaintingStrategy.DASHES);
C20.SetPaintingStrategy(PaintingStrategy.DASHES);
C21.SetPaintingStrategy(PaintingStrategy.DASHES);
C22.SetPaintingStrategy(PaintingStrategy.DASHES);
C23.SetPaintingStrategy(PaintingStrategy.DASHES);
C24.SetPaintingStrategy(PaintingStrategy.DASHES);
C25.SetPaintingStrategy(PaintingStrategy.DASHES);
C26.SetPaintingStrategy(PaintingStrategy.DASHES);
C27.SetPaintingStrategy(PaintingStrategy.DASHES);
C28.SetPaintingStrategy(PaintingStrategy.DASHES);
C29.SetPaintingStrategy(PaintingStrategy.DASHES);
C30.SetPaintingStrategy(PaintingStrategy.DASHES);

C31.SetPaintingStrategy(PaintingStrategy.DASHES);
C32.SetPaintingStrategy(PaintingStrategy.DASHES);
C33.SetPaintingStrategy(PaintingStrategy.DASHES);
C34.SetPaintingStrategy(PaintingStrategy.DASHES);
C35.SetPaintingStrategy(PaintingStrategy.DASHES);
C36.SetPaintingStrategy(PaintingStrategy.DASHES);
C37.SetPaintingStrategy(PaintingStrategy.DASHES);
C38.SetPaintingStrategy(PaintingStrategy.DASHES);


P1.SetPaintingStrategy(PaintingStrategy.DASHES);
P2.SetPaintingStrategy(PaintingStrategy.DASHES);
P3.SetPaintingStrategy(PaintingStrategy.DASHES);
P4.SetPaintingStrategy(PaintingStrategy.DASHES);
P5.SetPaintingStrategy(PaintingStrategy.DASHES);
P6.SetPaintingStrategy(PaintingStrategy.DASHES);
P7.SetPaintingStrategy(PaintingStrategy.DASHES);
P8.SetPaintingStrategy(PaintingStrategy.DASHES);
P9.SetPaintingStrategy(PaintingStrategy.DASHES);
P10.SetPaintingStrategy(PaintingStrategy.DASHES);
P11.SetPaintingStrategy(PaintingStrategy.DASHES);

P12.SetPaintingStrategy(PaintingStrategy.DASHES);
P13.SetPaintingStrategy(PaintingStrategy.DASHES);
P14.SetPaintingStrategy(PaintingStrategy.DASHES);
P15.SetPaintingStrategy(PaintingStrategy.DASHES);
P16.SetPaintingStrategy(PaintingStrategy.DASHES);
P17.SetPaintingStrategy(PaintingStrategy.DASHES);
P18.SetPaintingStrategy(PaintingStrategy.DASHES);
P19.SetPaintingStrategy(PaintingStrategy.DASHES);
P20.SetPaintingStrategy(PaintingStrategy.DASHES);
P21.SetPaintingStrategy(PaintingStrategy.DASHES);
P22.SetPaintingStrategy(PaintingStrategy.DASHES);
P23.SetPaintingStrategy(PaintingStrategy.DASHES);
P24.SetPaintingStrategy(PaintingStrategy.DASHES);
P25.SetPaintingStrategy(PaintingStrategy.DASHES);
P26.SetPaintingStrategy(PaintingStrategy.DASHES);
P27.SetPaintingStrategy(PaintingStrategy.DASHES);
P28.SetPaintingStrategy(PaintingStrategy.DASHES);
P29.SetPaintingStrategy(PaintingStrategy.DASHES);
P30.SetPaintingStrategy(PaintingStrategy.DASHES);

P31.SetPaintingStrategy(PaintingStrategy.DASHES);
P32.SetPaintingStrategy(PaintingStrategy.DASHES);
P33.SetPaintingStrategy(PaintingStrategy.DASHES);
P34.SetPaintingStrategy(PaintingStrategy.DASHES);
P35.SetPaintingStrategy(PaintingStrategy.DASHES);
P36.SetPaintingStrategy(PaintingStrategy.DASHES);
P37.SetPaintingStrategy(PaintingStrategy.DASHES);
P38.SetPaintingStrategy(PaintingStrategy.DASHES);




rec c1_V_e = if IsNaN(close) and !IsNaN(close[1]) then c1_V[1] else c1_V_e[1];
rec c2_V_e = if IsNaN(close) and !IsNaN(close[1]) then c2_V[1] else c2_V_e[1];
rec c3_V_e = if IsNaN(close) and !IsNaN(close[1]) then c3_V[1] else c3_V_e[1];
rec c4_V_e = if IsNaN(close) and !IsNaN(close[1]) then c4_V[1] else c4_V_e[1];
rec c5_V_e = if IsNaN(close) and !IsNaN(close[1]) then c5_V[1] else c5_V_e[1];
rec c6_V_e = if IsNaN(close) and !IsNaN(close[1]) then c6_V[1] else c6_V_e[1];
rec c7_V_e = if IsNaN(close) and !IsNaN(close[1]) then c7_V[1] else c7_V_e[1];
rec c8_V_e = if IsNaN(close) and !IsNaN(close[1]) then c8_V[1] else c8_V_e[1];
rec c9_V_e = if IsNaN(close) and !IsNaN(close[1]) then c9_V[1] else c9_V_e[1];
rec c10_V_e = if IsNaN(close) and !IsNaN(close[1]) then c10_V[1] else c10_V_e[1];
rec c11_V_e = if IsNaN(close) and !IsNaN(close[1]) then c11_V[1] else c11_V_e[1];

rec c12_V_e = if IsNaN(close) and !IsNaN(close[1]) then c12_V[1] else c12_V_e[1];
rec c13_V_e = if IsNaN(close) and !IsNaN(close[1]) then c13_V[1] else c13_V_e[1];
rec c14_V_e = if IsNaN(close) and !IsNaN(close[1]) then c14_V[1] else c14_V_e[1];
rec c15_V_e = if IsNaN(close) and !IsNaN(close[1]) then c15_V[1] else c15_V_e[1];
rec c16_V_e = if IsNaN(close) and !IsNaN(close[1]) then c16_V[1] else c16_V_e[1];
rec c17_V_e = if IsNaN(close) and !IsNaN(close[1]) then c17_V[1] else c17_V_e[1];
rec c18_V_e = if IsNaN(close) and !IsNaN(close[1]) then c18_V[1] else c18_V_e[1];
rec c19_V_e = if IsNaN(close) and !IsNaN(close[1]) then c19_V[1] else c19_V_e[1];
rec c20_V_e = if IsNaN(close) and !IsNaN(close[1]) then c20_V[1] else c20_V_e[1];
rec c21_V_e = if IsNaN(close) and !IsNaN(close[1]) then c21_V[1] else c21_V_e[1];
rec c22_V_e = if IsNaN(close) and !IsNaN(close[1]) then c22_V[1] else c22_V_e[1];
rec c23_V_e = if IsNaN(close) and !IsNaN(close[1]) then c23_V[1] else c23_V_e[1];
rec c24_V_e = if IsNaN(close) and !IsNaN(close[1]) then c24_V[1] else c24_V_e[1];
rec c25_V_e = if IsNaN(close) and !IsNaN(close[1]) then c25_V[1] else c25_V_e[1];
rec c26_V_e = if IsNaN(close) and !IsNaN(close[1]) then c26_V[1] else c26_V_e[1];
rec c27_V_e = if IsNaN(close) and !IsNaN(close[1]) then c27_V[1] else c27_V_e[1];
rec c28_V_e = if IsNaN(close) and !IsNaN(close[1]) then c28_V[1] else c28_V_e[1];
rec c29_V_e = if IsNaN(close) and !IsNaN(close[1]) then c29_V[1] else c29_V_e[1];
rec c30_V_e = if IsNaN(close) and !IsNaN(close[1]) then c30_V[1] else c30_V_e[1];

rec c31_V_e = if IsNaN(close) and !IsNaN(close[1]) then c31_V[1] else c31_V_e[1];
rec c32_V_e = if IsNaN(close) and !IsNaN(close[1]) then c32_V[1] else c32_V_e[1];
rec c33_V_e = if IsNaN(close) and !IsNaN(close[1]) then c33_V[1] else c33_V_e[1];
rec c34_V_e = if IsNaN(close) and !IsNaN(close[1]) then c34_V[1] else c34_V_e[1];
rec c35_V_e = if IsNaN(close) and !IsNaN(close[1]) then c35_V[1] else c35_V_e[1];
rec c36_V_e = if IsNaN(close) and !IsNaN(close[1]) then c36_V[1] else c36_V_e[1];
rec c37_V_e = if IsNaN(close) and !IsNaN(close[1]) then c37_V[1] else c37_V_e[1];
rec c38_V_e = if IsNaN(close) and !IsNaN(close[1]) then c38_V[1] else c38_V_e[1];


rec p1_V_e = if IsNaN(close) and !IsNaN(close[1]) then p1_V[1] else p1_V_e[1];
rec p2_V_e = if IsNaN(close) and !IsNaN(close[1]) then p2_V[1] else p2_V_e[1];
rec p3_V_e = if IsNaN(close) and !IsNaN(close[1]) then p3_V[1] else p3_V_e[1];
rec p4_V_e = if IsNaN(close) and !IsNaN(close[1]) then p4_V[1] else p4_V_e[1];
rec p5_V_e = if IsNaN(close) and !IsNaN(close[1]) then p5_V[1] else p5_V_e[1];
rec p6_V_e = if IsNaN(close) and !IsNaN(close[1]) then p6_V[1] else p6_V_e[1];
rec p7_V_e = if IsNaN(close) and !IsNaN(close[1]) then p7_V[1] else p7_V_e[1];
rec p8_V_e = if IsNaN(close) and !IsNaN(close[1]) then p8_V[1] else p8_V_e[1];
rec p9_V_e = if IsNaN(close) and !IsNaN(close[1]) then p9_V[1] else p9_V_e[1];
rec p10_V_e = if IsNaN(close) and !IsNaN(close[1]) then p10_V[1] else p10_V_e[1];
rec p11_V_e = if IsNaN(close) and !IsNaN(close[1]) then p11_V[1] else p11_V_e[1];

rec p12_V_e = if IsNaN(close) and !IsNaN(close[1]) then p12_V[1] else p12_V_e[1];
rec p13_V_e = if IsNaN(close) and !IsNaN(close[1]) then p13_V[1] else p13_V_e[1];
rec p14_V_e = if IsNaN(close) and !IsNaN(close[1]) then p14_V[1] else p14_V_e[1];
rec p15_V_e = if IsNaN(close) and !IsNaN(close[1]) then p15_V[1] else p15_V_e[1];
rec p16_V_e = if IsNaN(close) and !IsNaN(close[1]) then p16_V[1] else p16_V_e[1];
rec p17_V_e = if IsNaN(close) and !IsNaN(close[1]) then p17_V[1] else p17_V_e[1];
rec p18_V_e = if IsNaN(close) and !IsNaN(close[1]) then p18_V[1] else p18_V_e[1];
rec p19_V_e = if IsNaN(close) and !IsNaN(close[1]) then p19_V[1] else p19_V_e[1];
rec p20_V_e = if IsNaN(close) and !IsNaN(close[1]) then p20_V[1] else p20_V_e[1];
rec p21_V_e = if IsNaN(close) and !IsNaN(close[1]) then p21_V[1] else p21_V_e[1];
rec p22_V_e = if IsNaN(close) and !IsNaN(close[1]) then p22_V[1] else p22_V_e[1];
rec p23_V_e = if IsNaN(close) and !IsNaN(close[1]) then p23_V[1] else p23_V_e[1];
rec p24_V_e = if IsNaN(close) and !IsNaN(close[1]) then p24_V[1] else p24_V_e[1];
rec p25_V_e = if IsNaN(close) and !IsNaN(close[1]) then p25_V[1] else p25_V_e[1];
rec p26_V_e = if IsNaN(close) and !IsNaN(close[1]) then p26_V[1] else p26_V_e[1];
rec p27_V_e = if IsNaN(close) and !IsNaN(close[1]) then p27_V[1] else p27_V_e[1];
rec p28_V_e = if IsNaN(close) and !IsNaN(close[1]) then p28_V[1] else p28_V_e[1];
rec p29_V_e = if IsNaN(close) and !IsNaN(close[1]) then p29_V[1] else p29_V_e[1];
rec p30_V_e = if IsNaN(close) and !IsNaN(close[1]) then p30_V[1] else p30_V_e[1];

rec p31_V_e = if IsNaN(close) and !IsNaN(close[1]) then p31_V[1] else p31_V_e[1];
rec p32_V_e = if IsNaN(close) and !IsNaN(close[1]) then p32_V[1] else p32_V_e[1];
rec p33_V_e = if IsNaN(close) and !IsNaN(close[1]) then p33_V[1] else p33_V_e[1];
rec p34_V_e = if IsNaN(close) and !IsNaN(close[1]) then p34_V[1] else p34_V_e[1];
rec p35_V_e = if IsNaN(close) and !IsNaN(close[1]) then p35_V[1] else p35_V_e[1];
rec p36_V_e = if IsNaN(close) and !IsNaN(close[1]) then p36_V[1] else p36_V_e[1];
rec p37_V_e = if IsNaN(close) and !IsNaN(close[1]) then p37_V[1] else p37_V_e[1];
rec p38_V_e = if IsNaN(close) and !IsNaN(close[1]) then p38_V[1] else p38_V_e[1];

AddChartBubble(c1_D == extBar, C1, concat("", c1_V_e), globalColor("Calls"), yes );

AddChartBubble(c2_D == extBar, C2, concat("", c2_V_e), globalColor("Calls"), yes );

AddChartBubble(c3_D == extBar, C3, concat("", c3_V_e), globalColor("Calls"), yes );

AddChartBubble(c4_D == extBar, C4, concat("", c4_V_e), globalColor("Calls"), yes );

AddChartBubble(c5_D == extBar, C5, concat("", c5_V_e), globalColor("Calls"), yes );

AddChartBubble(c6_D == extBar, C6, concat("", c6_V_e), globalColor("Calls"), yes );

AddChartBubble(c7_D == extBar, C7, concat("", c7_V_e), globalColor("Calls"), yes );

AddChartBubble(c8_D == extBar, C8, concat("", c8_V_e), globalColor("Calls"), yes );

AddChartBubble(c9_D == extBar, C9, concat("", c9_V_e), globalColor("Calls"), yes );

AddChartBubble(c10_D == extBar, C10, concat("", c10_V_e), globalColor("Calls"), yes );

AddChartBubble(c11_D == extBar, C11, concat("", c11_V_e), globalColor("Calls"), yes );



AddChartBubble(c12_D == extBar, C12, concat("", c12_V_e), globalColor("Calls"), yes );

AddChartBubble(c13_D == extBar, C13, concat("", c13_V_e), globalColor("Calls"), yes );

AddChartBubble(c14_D == extBar, C14, concat("", c14_V_e), globalColor("Calls"), yes );

AddChartBubble(c15_D == extBar, C15, concat("", c15_V_e), globalColor("Calls"), yes );

AddChartBubble(c16_D == extBar, C16, concat("", c16_V_e), globalColor("Calls"), yes );

AddChartBubble(c17_D == extBar, C17, concat("", c17_V_e), globalColor("Calls"), yes );

AddChartBubble(c18_D == extBar, C18, concat("", c18_V_e), globalColor("Calls"), yes );

AddChartBubble(c19_D == extBar, C19, concat("", c19_V_e), globalColor("Calls"), yes );

AddChartBubble(c20_D == extBar, C20, concat("", c20_V_e), globalColor("Calls"), yes );

AddChartBubble(c21_D == extBar, C21, concat("", c21_V_e), globalColor("Calls"), yes );

AddChartBubble(c22_D == extBar, C22, concat("", c22_V_e), globalColor("Calls"), yes );

AddChartBubble(c23_D == extBar, C23, concat("", c23_V_e), globalColor("Calls"), yes );

AddChartBubble(c24_D == extBar, C24, concat("", c24_V_e), globalColor("Calls"), yes );

AddChartBubble(c25_D == extBar, C25, concat("", c25_V_e), globalColor("Calls"), yes );

AddChartBubble(c26_D == extBar, C26, concat("", c26_V_e), globalColor("Calls"), yes );

AddChartBubble(c27_D == extBar, C27, concat("", c27_V_e), globalColor("Calls"), yes );

AddChartBubble(c28_D == extBar, C28, concat("", c28_V_e), globalColor("Calls"), yes );

AddChartBubble(c29_D == extBar, C29, concat("", c29_V_e), globalColor("Calls"), yes );

AddChartBubble(c30_D == extBar, C30, concat("", c30_V_e), globalColor("Calls"), yes );



AddChartBubble(c31_D == extBar, C31, concat("", c31_V_e), globalColor("Calls"), yes );

AddChartBubble(c32_D == extBar, C32, concat("", c32_V_e), globalColor("Calls"), yes );

AddChartBubble(c33_D == extBar, C33, concat("", c33_V_e), globalColor("Calls"), yes );

AddChartBubble(c34_D == extBar, C34, concat("", c34_V_e), globalColor("Calls"), yes );

AddChartBubble(c35_D == extBar, C35, concat("", c35_V_e), globalColor("Calls"), yes );

AddChartBubble(c36_D == extBar, C36, concat("", c36_V_e), globalColor("Calls"), yes );

AddChartBubble(c37_D == extBar, C37, concat("", c37_V_e), globalColor("Calls"), yes );

AddChartBubble(c38_D == extBar, C38, concat("", c38_V_e), globalColor("Calls"), yes );





AddChartBubble(p1_D == extBar, P1, concat("", p1_V_e), globalColor("Puts"), no );

AddChartBubble(p2_D == extBar, P2, concat("", p2_V_e), globalColor("Puts"), no );

AddChartBubble(p3_D == extBar, P3, concat("", p3_V_e), globalColor("Puts"), no );

AddChartBubble(p4_D == extBar, P4, concat("", p4_V_e), globalColor("Puts"), no );

AddChartBubble(p5_D == extBar, P5, concat("", p5_V_e), globalColor("Puts"), no );

AddChartBubble(p6_D == extBar, P6, concat("", p6_V_e), globalColor("Puts"), no );

AddChartBubble(p7_D == extBar, P7, concat("", p7_V_e), globalColor("Puts"), no );

AddChartBubble(p8_D == extBar, P8, concat("", p8_V_e), globalColor("Puts"), no );

AddChartBubble(p9_D == extBar, P9, concat("", p9_V_e), globalColor("Puts"), no );

AddChartBubble(p10_D == extBar, P10, concat("", p10_V_e), globalColor("Puts"), no );

AddChartBubble(p11_D == extBar, P11, concat("", p11_V_e), globalColor("Puts"), no );



AddChartBubble(p12_D == extBar, P12, concat("", p12_V_e), globalColor("Puts"), no );

AddChartBubble(p13_D == extBar, P13, concat("", p13_V_e), globalColor("Puts"), no );

AddChartBubble(p14_D == extBar, P14, concat("", p14_V_e), globalColor("Puts"), no );

AddChartBubble(p15_D == extBar, P15, concat("", p15_V_e), globalColor("Puts"), no );

AddChartBubble(p16_D == extBar, P16, concat("", p16_V_e), globalColor("Puts"), no );

AddChartBubble(p17_D == extBar, P17, concat("", p17_V_e), globalColor("Puts"), no );

AddChartBubble(p18_D == extBar, P18, concat("", p18_V_e), globalColor("Puts"), no );

AddChartBubble(p19_D == extBar, P19, concat("", p19_V_e), globalColor("Puts"), no );

AddChartBubble(p20_D == extBar, P20, concat("", P20_V_e), globalColor("Calls"), yes );

AddChartBubble(p21_D == extBar, P21, concat("", p21_V_e), globalColor("Calls"), yes );

AddChartBubble(p22_D == extBar, P22, concat("", p22_V_e), globalColor("Calls"), yes );

AddChartBubble(p23_D == extBar, P23, concat("", p23_V_e), globalColor("Calls"), yes );

AddChartBubble(p24_D == extBar, P24, concat("", p24_V_e), globalColor("Calls"), yes );

AddChartBubble(p25_D == extBar, P25, concat("", p25_V_e), globalColor("Calls"), yes );

AddChartBubble(p26_D == extBar, P26, concat("", p26_V_e), globalColor("Calls"), yes );

AddChartBubble(p27_D == extBar, P27, concat("", p27_V_e), globalColor("Calls"), yes );

AddChartBubble(p28_D == extBar, P28, concat("", p28_V_e), globalColor("Calls"), yes );

AddChartBubble(p29_D == extBar, P29, concat("", p29_V_e), globalColor("Calls"), yes );

AddChartBubble(p30_D == extBar, P30, concat("", p30_V_e), globalColor("Calls"), yes );



AddChartBubble(p31_D == extBar, P31, concat("", p31_V_e), globalColor("Calls"), yes );

AddChartBubble(p32_D == extBar, P32, concat("", p32_V_e), globalColor("Calls"), yes );

AddChartBubble(p33_D == extBar, P33, concat("", p33_V_e), globalColor("Calls"), yes );

AddChartBubble(p34_D == extBar, P34, concat("", p34_V_e), globalColor("Calls"), yes );

AddChartBubble(p35_D == extBar, P35, concat("", p35_V_e), globalColor("Calls"), yes );

AddChartBubble(p36_D == extBar, P36, concat("", p36_V_e), globalColor("Calls"), yes );

AddChartBubble(p37_D == extBar, P37, concat("", p37_V_e), globalColor("Calls"), yes );

AddChartBubble(p38_D == extBar, P38, concat("", p38_V_e), globalColor("Calls"), yes );




C1.HideBubble();
C2.HideBubble();
C3.HideBubble();
C4.HideBubble();
C5.HideBubble();
C6.HideBubble();
C7.HideBubble();
C8.HideBubble();
C9.HideBubble();
C10.HideBubble();
C11.HideBubble();

C12.HideBubble();
C13.HideBubble();
C14.HideBubble();
C15.HideBubble();
C16.HideBubble();
C17.HideBubble();
C18.HideBubble();
C19.HideBubble();
C20.HideBubble();
C21.HideBubble();
C22.HideBubble();
C23.HideBubble();
C24.HideBubble();
C25.HideBubble();
C26.HideBubble();
C27.HideBubble();
C28.HideBubble();
C29.HideBubble();
C30.HideBubble();

C31.HideBubble();
C32.HideBubble();
C33.HideBubble();
C34.HideBubble();
C35.HideBubble();
C36.HideBubble();
C37.HideBubble();
C38.HideBubble();

P1.HideBubble();
P2.HideBubble();
P3.HideBubble();
P4.HideBubble();
P5.HideBubble();
P6.HideBubble();
P7.HideBubble();
P8.HideBubble();
P9.HideBubble();
P10.HideBubble();
P11.HideBubble();

P12.HideBubble();
P13.HideBubble();
P14.HideBubble();
P15.HideBubble();
P16.HideBubble();
P17.HideBubble();
P18.HideBubble();
P19.HideBubble();
P20.HideBubble();
P21.HideBubble();
P22.HideBubble();
P23.HideBubble();
P24.HideBubble();
P25.HideBubble();
P26.HideBubble();
P27.HideBubble();
P28.HideBubble();
P29.HideBubble();
P30.HideBubble();

P31.HideBubble();
P32.HideBubble();
P33.HideBubble();
P34.HideBubble();
P35.HideBubble();
P36.HideBubble();
P37.HideBubble();
P38.HideBubble();

C1.HideTitle();
C2.HideTitle();
C3.HideTitle();
C4.HideTitle();
C5.HideTitle();
C6.HideTitle();
C7.HideTitle();
C8.HideTitle();
C9.HideTitle();
C10.HideTitle();
C11.HideTitle();

C12.HideTitle();
C13.HideTitle();
C14.HideTitle();
C15.HideTitle();
C16.HideTitle();
C17.HideTitle();
C18.HideTitle();
C19.HideTitle();
C20.HideTitle();
C21.HideTitle();
C22.HideTitle();
C23.HideTitle();
C24.HideTitle();
C25.HideTitle();
C26.HideTitle();
C27.HideTitle();
C28.HideTitle();
C29.HideTitle();
C30.HideTitle();

C31.HideTitle();
C32.HideTitle();
C33.HideTitle();
C34.HideTitle();
C35.HideTitle();
C36.HideTitle();
C37.HideTitle();
C38.HideTitle();

P1.HideTitle();
P2.HideTitle();
P3.HideTitle();
P4.HideTitle();
P5.HideTitle();
P6.HideTitle();
P7.HideTitle();
P8.HideTitle();
P9.HideTitle();
P10.HideTitle();
P11.HideTitle();

P12.HideTitle();
P13.HideTitle();
P14.HideTitle();
P15.HideTitle();
P16.HideTitle();
P17.HideTitle();
P18.HideTitle();
P19.HideTitle();
P20.HideTitle();
P21.HideTitle();
P22.HideTitle();
P23.HideTitle();
P24.HideTitle();
P25.HideTitle();
P26.HideTitle();
P27.HideTitle();
P28.HideTitle();
P29.HideTitle();
P30.HideTitle();

P31.HideTitle();
P32.HideTitle();
P33.HideTitle();
P34.HideTitle();
P35.HideTitle();
P36.HideTitle();
P37.HideTitle();
P38.HideTitle();
Hi bro,

"I really like the metrics you've designed, but is it possible to update the latest OI before the market opens at 9:30, rather than waiting until after the market opens at 9:30?"
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
335 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top