How to do a scan/filter for IV of nearest weekly options?

FBones

New member
Hello, I asked a similar question earlier, and it got moved to the "IV Rank and IV Percentile Indicator" thread. I don't think that is a good fit because I'm not asking about IV Rank or IV Percentile (which is a comparison of current IVs against historical IVs), and I'm specifically trying to use a scanner rather than a chart.

My question is: how can I build a scanner that filters based on the implied volatility of the current front weekly options?

Actually, what I'd like is a scan that compares the IV of the current weekly options to the IV of options just a little farther out.

For example, today I found FLEX that had weekly options with IVs around 140-150% but that had options 2 weeks out with IV only 90%. These make fantastic calendar/diagonal spread opportunities, and I'd like to be able to scan for these.
 
Solution
  1. Using "Option Hacker" tab.
  2. Choose "add filter" then choose "option".
  3. Set the DTE (days to expiration) and then set the desired implied volatility.

MpbHGV9.png

XeoNoX

Well-known member
VIP
  1. Using "Option Hacker" tab.
  2. Choose "add filter" then choose "option".
  3. Set the DTE (days to expiration) and then set the desired implied volatility.

MpbHGV9.png
 
Solution

FBones

New member
  1. Using "Option Hacker" tab.
  2. Choose "add filter" then choose "option".
  3. Set the DTE (days to expiration) and then set the desired implied volatility.

MpbHGV9.png
Thanks! I didn't think to use this simple option. I was making it hard on myself by looking at the IV of stocks rather than searching directly for the options.
 
@mourningwood4521 any updates on your findings?
I made it so I can plot the options on the chart, with custom intervals between the strikes, and you have to specify the expiration date you want to have plotted. Im having trouble converting it to a scan, I don't know enough terminology for this yet.

1) I can't figure out the add label sequence to make it not show an add label for the options that are not fitting my parameter. so if the add label returns N/a for double.nan, I can't get it to not show that individual function.

after I figure this out,

2) My issue is I don't know what to type to make it so it only shows the functions that fit my parameter. So say I have 40 lines of def, and I want to make it only show the functions that are greater than 0.50 and less than 2.00, I want it to say something like
get(def xyz) if defxyz is > then 0.5 and get(defxyz) if defxyz < 2.0;
im pretty sure I need to assign a value to it, as that is what it says on



each def is:
Code:
def xyz = "inseret function or whatever math"
def xyz1 = "inseret function or whatever math"
def xyz2 = "inseret function or whatever math"
def xyz4 = "inseret function or whatever math"
def xyz5 = "inseret function or whatever math"
and keep this series going up to
def xyz40 = "inseret function or whatever math"



3) Now, I need to make it return these values in my scan. I'm having trouble assigning words to make it search the 41 defines and only show the ones that meet the defined terms.
So when you do a scan, you normally have 1 plot trigger, like the example

Code:
def math1  = RSI
def  oversold = 30
plot trigger = RSI < oversold;

I want it to say plot trigger = (if) (any of xyz-xyz40) is greater than 0.5 and less than 2 is true display those values and anything that is outside the 0.5-2 range won't show.

If you or anyone can help with the above 3 points, that would be amazing. I will be using them on many other scripts. I'll drop my scratch work code after this, and then i'll add a separate code at the very bottom which is my final product .
#---------------------------------------------------------------
I have seen people write codes for get option strikes in the YYYYMMDD format, but they are much more complex than this, and you have to pay for them :(.

I'm thinking I will just make a scan with all the other parameters, make that a watchlist, then click through that list of stocks and view my add label plot on each to choose strikes that look juicy for the current time frame.
This section is my scratch work, its only on the call side and is where I got stuck.
Code:
####### work by mourningwood4521
#Hint: shows my work on different strings i was attempting to combine but failed to do so. need to revist. see very bottom of screen. this is for calls only!#############
declare lower;
input optionSeriesPrefix = "210319"; 
input strikeSpacing = 0.5; #choose either .5, 1, 2.5, 5, 10, or 25;

####### work by mourningwood4521
#def putstrike = GetNextITMOption(optionSeriesPrefix);
#def putstrike = PutStrike2(GetNextITMOption());
#def putstrike3 = getnextITMOption(getsymbol(optionSeriesPrefixpclose));
#def otherprice = OptionPrice(GetStrike());
# expirationDate, OptionClass.CALL)));
#  GetNextITMOption ( String optionCode);
#def putstrike = GetNextITMOption (optionSeriesPrefix);

def PutStrike = Ceil(close[1] / 10) * 10;
def CallStrike = Floor(close[1] / 10) * 10;

AddLabel(1, GetSymbol() + " Exp:" + optionSeriesPrefix + " CStrike:" + CallStrike + " PStrike:" + PutStrike , Color.WHITE);

input ShowAllLabels = no;
input  showcall = no;
input  Showcall1 = no;
input  Showcall2 = no;
input  Showcall3 = no;
input  Showcall4 = no;
input  Showcall5 = no;
input  Showcall6 = no;
input  Showcall7 = no;
input  Showcall8 = no;
input  Showcall9 = no;
input  Showcall10 = no;
input  Showcall11 = no;
input  Showcall12 = no;
input  Showcall13 = no;
input  Showcall14 = no;
input  Showcall15 = no;
input  Showcall16 = no;
input  Showcall17 = no;
input  Showcall18 = no;
input  Showcall19 = no;
input  Showcall20 = no;
input  Showcall21 = no;
input  Showcall22 = no;
input  Showcall23 = no;
input  Showcall24 = no;
input  Showcall25 = no;
input  Showcall26 = no;
input  Showcall27 = no;
input  Showcall28 = no;
input  Showcall29 = no;
input  Showcall30 = no;
input  Showcall31 = no;
input  Showcall32 = no;
input  Showcall33 = no;
input  Showcall34 = no;
input  Showcall35 = no;
input  Showcall36 = no;
input  Showcall37 = no;
input  Showcall38 = no;
input  Showcall39 = no;
input  Showcall40 = no;
###Call Option Volume
def callOptionclose = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 0))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 0));
def callOptionclose1  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 1))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 1));
def callOptionclose2  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 2))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 2));
def callOptionclose3  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 3))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 3));
def callOptionclose4  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 4))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 4));
def callOptionclose5  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 5))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 5));
def callOptionclose6  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 6))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 6));
def callOptionclose7  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 7))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 7));
def callOptionclose8  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 8))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 8));
def callOptionclose9  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 9))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 9));
def callOptionclose10 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 10))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 10));
def callOptionclose11 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 11))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 11));
def callOptionclose12 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 12))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 12));
def callOptionclose13 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 13))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 13));
def callOptionclose14 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 14))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 14));
def callOptionclose15 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 15))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 15));
def callOptionclose16 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 16))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 16));
def callOptionclose17 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 17))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 17));
def callOptionclose18 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 18))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 18));
def callOptionclose19 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 19))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 19));
def callOptionclose20 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 20))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 20));
def callOptionclose21 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 21))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 21));
def callOptionclose22 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 22))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 22));
def callOptionclose23 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 23))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 23));
def callOptionclose24 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 24))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 24));
def callOptionclose25 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 25))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 25));
def callOptionclose26 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 26))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 26));
def callOptionclose27 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 27))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 27));
def callOptionclose28 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 28))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 28));
def callOptionclose29 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 29))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 29));
def callOptionclose30 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 30))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 30));
def callOptionclose31 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 31))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 31));
def callOptionclose32 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 32))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 32));
def callOptionclose33 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 33))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 33));
def callOptionclose34 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 34))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 34));
def callOptionclose35 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 35))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 35));
def callOptionclose36 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 36))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 36));
def callOptionclose37 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 37))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 37));
def callOptionclose38 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 38))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 38));
def callOptionclose39 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 39))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 39));
def callOptionclose40 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 40))) then Double.NaN else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 40));

######## this section is me trying to do what i said in section #2

input optionpremiumlowerlimit = 0.50; #hint: change this parameter to the lower limit of the amount per option contract premium to be.
input optionpremiumupperlimit = 2.0;  #hint: change this parameter to the upper limit of the amount per option contract premium to be.

#for puts###
#def putoptionprice = if putOptionclose  >= optionpremiumlowerlimit and putoptionclose <= optionpremiumupperlimit then 2 else double.nan; 

def calloptionprice    = if callOptionclose    >= optionpremiumlowerlimit and callOptionclose   <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice1   = if callOptionclose1   >= optionpremiumlowerlimit and callOptionclose1  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice2   = if callOptionclose2   >= optionpremiumlowerlimit and callOptionclose2  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice3   = if callOptionclose3   >= optionpremiumlowerlimit and callOptionclose3  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice4   = if callOptionclose4   >= optionpremiumlowerlimit and callOptionclose4  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice5   = if callOptionclose5   >= optionpremiumlowerlimit and callOptionclose5  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice6   = if callOptionclose6   >= optionpremiumlowerlimit and callOptionclose6  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice7   = if callOptionclose7   >= optionpremiumlowerlimit and callOptionclose7  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice8   = if callOptionclose8   >= optionpremiumlowerlimit and callOptionclose8  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice9   = if callOptionclose9   >= optionpremiumlowerlimit and callOptionclose9  <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice10  = if callOptionclose10  >= optionpremiumlowerlimit and callOptionclose10 <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice11  = if callOptionclose11  >= optionpremiumlowerlimit and callOptionclose11 <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice12  = if callOptionclose12  >= optionpremiumlowerlimit and callOptionclose12 <= optionpremiumupperlimit then 2 else Double.NaN; 
def calloptionprice13  = if callOptionclose13  >= optionpremiumlowerlimit and callOptionclose13 <= optionpremiumupperlimit then 2 else Double.NaN; 

#Show Individual Call Volume Labels
AddLabel(showcall   or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 0) + ":  " + callOptionclose,   Color.CYAN);
AddLabel(Showcall1  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 1) + ":  " + callOptionclose1,  Color.CYAN);
AddLabel(Showcall2  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 2) + ":  " + callOptionclose2,  Color.CYAN);
AddLabel(Showcall3  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 3) + ":  " + callOptionclose3,  Color.CYAN);
AddLabel(Showcall4  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 4) + ":  " + callOptionclose4,  Color.CYAN);
AddLabel(Showcall5  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 5) + ":  " + callOptionclose5,  Color.CYAN);
AddLabel(Showcall6  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 6) + ":  " + callOptionclose6,  Color.CYAN);
AddLabel(Showcall7  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 7) + ":  " + callOptionclose7,  Color.CYAN);
AddLabel(Showcall8  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 8) + ":  " + callOptionclose8,  Color.CYAN);
AddLabel(Showcall9  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 9) + ":  " + callOptionclose9,  Color.CYAN);
AddLabel(Showcall10 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 10) + ":  " + callOptionclose10, Color.CYAN);
AddLabel(Showcall11 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 11) + ":  " + callOptionclose11, Color.CYAN);
AddLabel(Showcall12 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 12) + ":  " + callOptionclose12, Color.CYAN);
AddLabel(Showcall13 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 13) + ":  " + callOptionclose13, Color.CYAN);
AddLabel(Showcall14 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 14) + ":  " + callOptionclose14, Color.CYAN);
AddLabel(Showcall15 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 15) + ":  " + callOptionclose15, Color.CYAN);
AddLabel(Showcall16 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 16) + ":  " + callOptionclose16, Color.CYAN);
AddLabel(Showcall17 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 17) + ":  " + callOptionclose17, Color.CYAN);
AddLabel(Showcall18 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 18) + ":  " + callOptionclose18, Color.CYAN);
AddLabel(Showcall19 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 19) + ":  " + callOptionclose19, Color.CYAN);
AddLabel(Showcall20 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 20) + ":  " + callOptionclose20, Color.CYAN);
AddLabel(Showcall21 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 21) + ":  " + callOptionclose21,  Color.CYAN);
AddLabel(Showcall22 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 22) + ":  " + callOptionclose22,  Color.CYAN);
AddLabel(Showcall23 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 23) + ":  " + callOptionclose23,  Color.CYAN);
AddLabel(Showcall24 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 24) + ":  " + callOptionclose24,  Color.CYAN);
AddLabel(Showcall25 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 25) + ":  " + callOptionclose25,  Color.CYAN);
AddLabel(Showcall26 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 26) + ":  " + callOptionclose26,  Color.CYAN);
AddLabel(Showcall27 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 27) + ":  " + callOptionclose27,  Color.CYAN);
AddLabel(Showcall28 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 28) + ":  " + callOptionclose28,  Color.CYAN);
AddLabel(Showcall29 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 29) + ":  " + callOptionclose29,  Color.CYAN);
AddLabel(Showcall30 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 30) + ":  " + callOptionclose30, Color.CYAN);
AddLabel(Showcall31 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 31) + ":  " + callOptionclose31, Color.CYAN);
AddLabel(Showcall32 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 32) + ":  " + callOptionclose32, Color.CYAN);
AddLabel(Showcall33 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 33) + ":  " + callOptionclose33, Color.CYAN);
AddLabel(Showcall34 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 34) + ":  " + callOptionclose34, Color.CYAN);
AddLabel(Showcall35 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 35) + ":  " + callOptionclose35, Color.CYAN);
AddLabel(Showcall36 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 36) + ":  " + callOptionclose36, Color.CYAN);
AddLabel(Showcall37 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 37) + ":  " + callOptionclose37, Color.CYAN);
AddLabel(Showcall38 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 38) + ":  " + callOptionclose38, Color.CYAN);
AddLabel(Showcall39 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 39) + ":  " + callOptionclose39, Color.CYAN);
AddLabel(Showcall40 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 40) + ":  " + callOptionclose40, Color.CYAN);

#Show Individual Call price Labels###my edit 

################# this was me trying to make the add label section only display labels that were true.

#def booleanvisible = 

#def termxyz = if get(showcall()) == then 1 else double.nan;
# yescalloptionclose is true ;
#AddLabel(boolean visible, Any text, CustomColor color);
#Addlabel(yes, if VARIABLENAME > 0 then "Yes" else "No", if VARIABLENAME > 0 then Color.GREEN else Color.RED (y) );
#AddLabel(yes, if showcall is true then ("C" + AsPrice(CallStrike + strikeSpacing * 0) + ":  " + callOptionclose) else Double.NaN,   Color.CYAN);
#AddLabel(1, if "C" + AsPrice(CallStrike + strikeSpacing * 1) + ":  " + callOptionclose1   > 0 then yes else Double.NaN,  Color.CYAN);
#AddLabel(yes, if "C" + AsPrice(CallStrike + strikeSpacing * 2) + ":  " + callOptionclose2   > 0  then yes else Double.NaN,  Color.CYAN);
#AddLabel(2, "C" + AsPrice(CallStrike + strikeSpacing * 3) + ":  " + callOptionclose3,  Color.CYAN);
#AddLabel(2, "C" + AsPrice(CallStrike + strikeSpacing * 4) + ":  " + callOptionclose4,  Color.CYAN);
#AddLabel(2, "C" + AsPrice(CallStrike + strikeSpacing * 5) + ":  " + callOptionclose5,  Color.CYAN);
#AddLabel(2, "C" + AsPrice(CallStrike + strikeSpacing * 6) + ":  " + callOptionclose6,  Color.CYAN);
#AddLabel(2, "C" + AsPrice(CallStrike + strikeSpacing * 7) + ":  " + callOptionclose7,  Color.CYAN);
#AddLabel(yes, if Showcall8 >0 then yes else double.nan, "C" + AsPrice(CallStrike + strikeSpacing * 8) + ":  " + callOptionclose8,  Color.CYAN);
#AddLabel(Showcall9  or ShowAllLabels, if callOptionclose9 isnan then double.NaN else "C" + AsPrice(CallStrike + strikeSpacing * 9) + ":  " + callOptionclose9,  Color.CYAN);

#AddLabel(2, "C" + AsPrice(CallStrike + strikeSpacing * 38) + ":  " + callOptionclose38, Color.CYAN);
#AddLabel(2, "C" + AsPrice(CallStrike + strikeSpacing * 39) + ":  " + callOptionclose39, Color.CYAN);
#AddLabel(2, "C" + AsPrice(CallStrike + strikeSpacing * 40) + ":  " + callOptionclose40, Color.CYAN);
#---------------------------------------------------------------------------------------------------------------------
 
@mourningwood4521 any updates on your findings?
here is my actual code. I figured id make a separate comment incase admin wants to make it into its own post.
This code finds the volume on a stocks calls and puts and displays them as an addlabel as a lower study.
Code:
#Hint: script shows the option price in the addlabel format on the option with expiration date you write in. Shows a N/A on strikes that do not exist. this will take a while to load, so please be patient.
# Option PRICE addlabel Indicator
#This code was heavily modified by mourningwood4521 from something  #NPTrading made.

declare lower;
input optionSeriesPrefix = "210319"; #NPTrading : manually update option expiry date in format YYMMDD
input strikeSpacing = 10; #: { ".5", "1", "2.5", "5", default "10", "25" }; #default 10 for large price stock

## if you want to use todays last priceActionIndicator then use this function,
def PutStrike = if close < 1000 then Ceil(close / 10) * 10 else Ceil(close / 100) * 100;
def CallStrike = if close < 1000 then Floor(close / 10) * 10 else Floor(close / 100) * 100;

#otherwise, if you want to use yesterdays close use this function below, and delete the 2 hastags below and add hastags in front of the 2 lines above.

#def PutStrike = if close[1] < 1000 then Ceil(close[1] / 10) * 10 else Ceil(close[1] / 100) * 100;
#def CallStrike = if close[1] < 1000 then Floor(close[1] / 10) * 10 else Floor(close[1] / 100) * 100;


AddLabel(1, GetSymbol() + " Exp:" + optionSeriesPrefix + " CStrike:" + CallStrike + " PStrike:" + PutStrike , Color.WHITE);

input ShowAllLabels = no;
input Showput  = no;
input Showput1 = no;
input Showput2 = no;
input Showput3 = no;
input Showput4 = no;
input Showput5 = no;
input Showput6 = no;
input Showput7 = no;
input Showput8 = no;
input Showput9 = no;
input Showput10 = no;
input Showput11 = no;
input Showput12 = no;
input Showput13 = no;
input Showput14 = no;
input Showput15 = no;
input Showput16 = no;
input Showput17 = no;
input Showput18 = no;
input Showput19 = no;
input Showput20 = no;
input Showput21 = no;
input Showput22 = no;
input Showput23 = no;
input Showput24 = no;
input Showput25 = no;
input Showput26 = no;
input Showput27 = no;
input Showput28 = no;
input Showput29 = no;
input Showput30 = no;
input Showput31 = no;
input Showput32 = no;
input Showput33 = no;
input Showput34 = no;
input Showput35 = no;
input Showput36 = no;
input Showput37 = no;
input Showput38 = no;
input Showput39 = no;
input Showput40 = no;


### Put Option Volume
def putOptionclose   = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 0))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 0));
def putOptionclose1  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 1))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 1));
def putOptionclose2  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 2))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 2));
def putOptionclose3  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 3))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 3));
def putOptionclose4  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 4))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 4));
def putOptionclose5  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 5))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 5));
def putOptionclose6  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 6))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 6));
def putOptionclose7  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 7))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 7));
def putOptionclose8  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 8))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 8));
def putOptionclose9  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 9))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 9));
def putOptionclose10 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 10))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 10));
def putOptionclose11 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 11))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 11));
def putOptionclose12 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 12))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 12));
def putOptionclose13 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 13))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 13));
def putOptionclose14 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 14))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 14));
def putOptionclose15 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 15))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 15));
def putOptionclose16 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 16))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 16));
def putOptionclose17 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 17))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 17));
def putOptionclose18 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 18))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 18));
def putOptionclose19 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 19))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 19));
def putOptionclose20 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 20))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 20));
def putOptionclose21  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 21))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 21));
def putOptionclose22  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 22))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 22));
def putOptionclose23  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 23))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 23));
def putOptionclose24  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 24))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 24));
def putOptionclose25  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 25))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 25));
def putOptionclose26  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 26))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 26));
def putOptionclose27  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 27))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 27));
def putOptionclose28  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 28))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 28));
def putOptionclose29  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 29))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 29));
def putOptionclose30 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 30))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 30));
def putOptionclose31 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 31))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 31));
def putOptionclose32 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 32))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 32));
def putOptionclose33 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 33))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 33));
def putOptionclose34 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 34))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 34));
def putOptionclose35 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 35))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 35));
def putOptionclose36 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 36))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 36));
def putOptionclose37 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 37))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 37));
def putOptionclose38 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 38))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 38));
def putOptionclose39 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 39))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 39));
def putOptionclose40 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 40))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "P" + AsPrice(PutStrike - strikeSpacing * 40));

####Show Individual Put Volume Labels
AddLabel(Showput    or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 0) + ":  " + putOptionclose, color.red);
AddLabel(Showput1   or ShowAllLabels, "P" + AsPrice(PutStrike  - (strikeSpacing * 1)) + ":  " + putOptionclose1, color.red);
AddLabel(Showput2   or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 2) + ":  " + putOptionclose2, color.red);
AddLabel(Showput3   or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 3) + ":  " + putOptionclose3, color.red);
AddLabel(Showput4   or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 4) + ":  " + putOptionclose4, color.red);
AddLabel(Showput5   or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 5) + ":  " + putOptionclose5, color.red);
AddLabel(Showput6   or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 6) + ":  " + putOptionclose6, color.red);
AddLabel(Showput7   or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 7) + ":  " + putOptionclose7, color.red);
AddLabel(Showput8   or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 8) + ":  " + putOptionclose8, color.red);
AddLabel(Showput9   or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 9) + ":  " + putOptionclose9, color.red);
AddLabel(Showput10  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 10) + ":  " + putOptionclose10, color.red);
AddLabel(Showput11  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 11) + ":  " + putOptionclose11, color.red);
AddLabel(Showput12  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 12) + ":  " + putOptionclose12, color.red);
AddLabel(Showput13  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 13) + ":  " + putOptionclose13, color.red);
AddLabel(Showput14  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 14) + ":  " + putOptionclose14, color.red);
AddLabel(Showput15  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 15) + ":  " + putOptionclose15, color.red);
AddLabel(Showput16  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 16) + ":  " + putOptionclose16, color.red);
AddLabel(Showput17  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 17) + ":  " + putOptionclose17, color.red);
AddLabel(Showput18  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 18) + ":  " + putOptionclose18, color.red);
AddLabel(Showput19  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 19) + ":  " + putOptionclose19, color.red);
AddLabel(Showput20  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 20) + ":  " + putOptionclose20, color.red);
AddLabel(Showput21  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 21) + ":  " + putOptionclose21, color.red);
AddLabel(Showput22  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 22) + ":  " + putOptionclose22, color.red);
AddLabel(Showput23  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 23) + ":  " + putOptionclose23, color.red);
AddLabel(Showput24  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 24) + ":  " + putOptionclose24, color.red);
AddLabel(Showput25  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 25) + ":  " + putOptionclose25, color.red);
AddLabel(Showput26  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 26) + ":  " + putOptionclose26, color.red);
AddLabel(Showput27  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 27) + ":  " + putOptionclose27, color.red);
AddLabel(Showput28  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 28) + ":  " + putOptionclose28, color.red);
AddLabel(Showput29  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 29) + ":  " + putOptionclose29, color.red);
AddLabel(Showput30  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 30) + ":  " + putOptionclose30, color.red);
AddLabel(Showput31  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 31) + ":  " + putOptionclose31, color.red);
AddLabel(Showput32  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 32) + ":  " + putOptionclose32, color.red);
AddLabel(Showput33  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 33) + ":  " + putOptionclose33, color.red);
AddLabel(Showput34  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 34) + ":  " + putOptionclose34, color.red);
AddLabel(Showput35  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 35) + ":  " + putOptionclose35, color.red);
AddLabel(Showput36  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 36) + ":  " + putOptionclose36, color.red);
AddLabel(Showput37  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 37) + ":  " + putOptionclose37, color.red);
AddLabel(Showput38  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 38) + ":  " + putOptionclose38, color.red);
AddLabel(Showput39  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 39) + ":  " + putOptionclose39, color.red);
AddLabel(Showput40  or ShowAllLabels, "P" + AsPrice(PutStrike  - strikeSpacing * 40) + ":  " + putOptionclose40, color.red);


#calls######################################################################



input  showcall = no;
input  Showcall1 = no;
input  Showcall2 = no;
input  Showcall3 = no;
input  Showcall4 = no;
input  Showcall5 = no;
input  Showcall6 = no;
input  Showcall7 = no;
input  Showcall8 = no;
input  Showcall9 = no;
input  Showcall10 = no;
input  Showcall11 = no;
input  Showcall12 = no;
input  Showcall13 = no;
input  Showcall14 = no;
input  Showcall15 = no;
input  Showcall16 = no;
input  Showcall17 = no;
input  Showcall18 = no;
input  Showcall19 = no;
input  Showcall20 = no;
input  Showcall21 = no;
input  Showcall22 = no;
input  Showcall23 = no;
input  Showcall24 = no;
input  Showcall25 = no;
input  Showcall26 = no;
input  Showcall27 = no;
input  Showcall28 = no;
input  Showcall29 = no;
input  Showcall30 = no;
input  Showcall31 = no;
input  Showcall32 = no;
input  Showcall33 = no;
input  Showcall34 = no;
input  Showcall35 = no;
input  Showcall36 = no;
input  Showcall37 = no;
input  Showcall38 = no;
input  Showcall39 = no;
input  Showcall40 = no;
###Call Option Volume
def callOptionclose = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 0))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 0));
def callOptionclose1  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 1))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 1));
def callOptionclose2  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 2))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 2));
def callOptionclose3  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 3))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 3));
def callOptionclose4  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 4))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 4));
def callOptionclose5  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 5))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 5));
def callOptionclose6  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 6))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 6));
def callOptionclose7  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 7))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 7));
def callOptionclose8  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 8))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 8));
def callOptionclose9  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 9))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 9));
def callOptionclose10 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 10))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 10));
def callOptionclose11 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 11))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 11));
def callOptionclose12 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 12))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 12));
def callOptionclose13 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 13))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 13));
def callOptionclose14 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 14))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 14));
def callOptionclose15 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 15))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 15));
def callOptionclose16 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 16))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 16));
def callOptionclose17 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 17))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 17));
def callOptionclose18 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 18))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 18));
def callOptionclose19 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 19))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 19));
def callOptionclose20 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 20))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 20));
def callOptionclose21  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 21))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 21));
def callOptionclose22  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 22))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 22));
def callOptionclose23  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 23))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 23));
def callOptionclose24  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 24))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 24));
def callOptionclose25  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 25))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 25));
def callOptionclose26  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 26))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 26));
def callOptionclose27  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 27))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 27));
def callOptionclose28  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 28))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 28));
def callOptionclose29  = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 29))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 29));
def callOptionclose30 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 30))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 30));
def callOptionclose31 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 31))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 31));
def callOptionclose32 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 32))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 32));
def callOptionclose33 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 33))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 33));
def callOptionclose34 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 34))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 34));
def callOptionclose35 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 35))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 35));
def callOptionclose36 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 36))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 36));
def callOptionclose37 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 37))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 37));
def callOptionclose38 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 38))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 38));
def callOptionclose39 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 39))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 39));
def callOptionclose40 = if IsNaN(close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 40))) then double.nan else close("." + GetSymbol() + optionSeriesPrefix + "C" + AsPrice(CallStrike + strikeSpacing * 40));

#Show Individual Call Volume Labels
AddLabel(showcall   or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 0) + ":  " + callOptionclose,   Color.green);
AddLabel(Showcall1  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 1) + ":  " + callOptionclose1,  Color.green);
AddLabel(Showcall2  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 2) + ":  " + callOptionclose2,  Color.green);
AddLabel(Showcall3  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 3) + ":  " + callOptionclose3,  Color.green);
AddLabel(Showcall4  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 4) + ":  " + callOptionclose4,  Color.green);
AddLabel(Showcall5  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 5) + ":  " + callOptionclose5,  Color.green);
AddLabel(Showcall6  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 6) + ":  " + callOptionclose6,  Color.green);
AddLabel(Showcall7  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 7) + ":  " + callOptionclose7,  Color.green);
AddLabel(Showcall8  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 8) + ":  " + callOptionclose8,  Color.green);
AddLabel(Showcall9  or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 9) + ":  " + callOptionclose9,  Color.green);
AddLabel(Showcall10 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 10) + ":  " + callOptionclose10, Color.green);
AddLabel(Showcall11 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 11) + ":  " + callOptionclose11, Color.green);
AddLabel(Showcall12 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 12) + ":  " + callOptionclose12, Color.green);
AddLabel(Showcall13 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 13) + ":  " + callOptionclose13, Color.green);
AddLabel(Showcall14 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 14) + ":  " + callOptionclose14, Color.green);
AddLabel(Showcall15 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 15) + ":  " + callOptionclose15, Color.green);
AddLabel(Showcall16 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 16) + ":  " + callOptionclose16, Color.green);
AddLabel(Showcall17 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 17) + ":  " + callOptionclose17, Color.green);
AddLabel(Showcall18 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 18) + ":  " + callOptionclose18, Color.green);
AddLabel(Showcall19 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 19) + ":  " + callOptionclose19, Color.green);
AddLabel(Showcall20 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 20) + ":  " + callOptionclose20, Color.green);
AddLabel(Showcall21 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 21) + ":  " + callOptionclose21, Color.green);
AddLabel(Showcall22 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 22) + ":  " + callOptionclose22, Color.green);
AddLabel(Showcall23 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 23) + ":  " + callOptionclose23, Color.green);
AddLabel(Showcall24 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 24) + ":  " + callOptionclose24, Color.green);
AddLabel(Showcall25 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 25) + ":  " + callOptionclose25, Color.green);
AddLabel(Showcall26 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 26) + ":  " + callOptionclose26, Color.green);
AddLabel(Showcall27 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 27) + ":  " + callOptionclose27, Color.green);
AddLabel(Showcall28 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 28) + ":  " + callOptionclose28, Color.green);
AddLabel(Showcall29 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 29) + ":  " + callOptionclose29, Color.green);
AddLabel(Showcall30 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 30) + ":  " + callOptionclose30, Color.green);
AddLabel(Showcall31 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 31) + ":  " + callOptionclose31, Color.green);
AddLabel(Showcall32 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 32) + ":  " + callOptionclose32, Color.green);
AddLabel(Showcall33 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 33) + ":  " + callOptionclose33, Color.green);
AddLabel(Showcall34 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 34) + ":  " + callOptionclose34, Color.green);
AddLabel(Showcall35 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 35) + ":  " + callOptionclose35, Color.green);
AddLabel(Showcall36 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 36) + ":  " + callOptionclose36, Color.green);
AddLabel(Showcall37 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 37) + ":  " + callOptionclose37, Color.green);
AddLabel(Showcall38 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 38) + ":  " + callOptionclose38, Color.green);
AddLabel(Showcall39 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 39) + ":  " + callOptionclose39, Color.green);
AddLabel(Showcall40 or ShowAllLabels, "C" + AsPrice(CallStrike + strikeSpacing * 40) + ":  " + callOptionclose40, Color.green);
.
 

XeoNoX

Well-known member
VIP
I made it so I can plot the options on the chart, with custom intervals between the strikes, and you have to specify the expiration date you want to have plotted. Im having trouble converting it to a scan, I don't know enough terminology for this yet.

thats correct, as i mentioned, your having trouble converting it into a scan because TOS limits using certain options scan codes , in other words you cant scan against certain option syntaxes that you need in order to reference certain option related returns.

nice chart study script btw.
 
thank you @XeoNoX !!!

even if the options were just a stock or underlying parameter, I don't know how to string together a code to make it scan for the next.

When I tryed switching the input data to YYYYMMDD it doesn't take it, which is the format for the options when you scan for them using option hacker. so when I found that out, I proved you were correct and I wanted to give up but instead made the addlable script.

Hopefully TOS gets it together. The last update made it so any saved studies you had, it will no longer open in that format. save in 1 hr time frame on a study? it will open to 1Y:1D now. I was appalled by that. I still am. Defeats the purpose of saving a study for quick access.
 

Similar threads

Top