Intrinsic Knowledge
Member
Hi guys,
Just giving back to what I have learnt from this great forum UTS. As below is the code but as usual don't use it in isolation. Based on my past experience great to pair with S/L or gaps.
Let me explain abit the logic of this codes. If anyone of you are doing options trading then you might have a head start. Or you can study the code and figure the logic and foundation behind this indicator. The formula I am using is based on the difference on the 25 above and below Strike Price I have back tested this based on the 5 min TF using on 0DTE - you will need to adjust to the expiration date.
Option Premium FlowI have input the video link - hope that it explains well enough! Cheers
So the difference is above $1m either for Call or Put options. For example, if we have a signal of $1m call option difference now. We are expecting traders/institutional are closing the trades. Therefore, we might be seeing a reversal soon.
I m trying to post more examples soon. Btw, I m no longer using TOS as they have regulated limited to only accredited account in Singapore
https://www.schwab.com.sg/retail-client
Enjoys and all the best!
Just giving back to what I have learnt from this great forum UTS. As below is the code but as usual don't use it in isolation. Based on my past experience great to pair with S/L or gaps.
Let me explain abit the logic of this codes. If anyone of you are doing options trading then you might have a head start. Or you can study the code and figure the logic and foundation behind this indicator. The formula I am using is based on the difference on the 25 above and below Strike Price I have back tested this based on the 5 min TF using on 0DTE - you will need to adjust to the expiration date.
Option Premium FlowI have input the video link - hope that it explains well enough! Cheers
So the difference is above $1m either for Call or Put options. For example, if we have a signal of $1m call option difference now. We are expecting traders/institutional are closing the trades. Therefore, we might be seeing a reversal soon.
I m trying to post more examples soon. Btw, I m no longer using TOS as they have regulated limited to only accredited account in Singapore
https://www.schwab.com.sg/retail-client
Enjoys and all the best!
Code:
### Option Premium_Put&Call
declare lower;
input optionSeriesPrefix = ".QQQ230519";
input strike = 322.0;
def strikeSpace1 = 1.0;
def strikeSpace2 = 2.0;
def strikeSpace3 = 3.0;
def strikeSpace4 = 4.0;
def strikeSpace5 = 5.0;
def strikeSpace6 = 6.0;
def strikeSpace7 = 7.0;
def strikeSpace8 = 8.0;
def strikeSpace9 = 9.0;
def strikeSpace10 = 10.0;
def strikeSpace11 = 11.0;
def strikeSpace12 = 12.0;
def strikeSpace13 = 13.0;
def strikeSpace14 = 14.0;
def strikeSpace15 = 15.0;
def strikeSpace16 = 16.0;
def strikeSpace17 = 17.0;
def strikeSpace18 = 18.0;
def strikeSpace19 = 19.0;
def strikeSpace20 = 20.0;
def strikeSpace21 = 21.0;
def strikeSpace22 = 22.0;
def strikeSpace23 = 23.0;
def strikeSpace24 = 24.0;
def strikeSpace25 = 25.0;
### Put Option Volume
def putOptionVolume = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike)));
def putOptionVolume1 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace1)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace1)));
def putOptionVolume2 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace2)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace2)));
def putOptionVolume3 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace3)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace3)));
def putOptionVolume4 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace4)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace4)));
def putOptionVolume5 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace5)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace5)));
def putOptionVolume6 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace6)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace6)));
def putOptionVolume7 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace7)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace7)));
def putOptionVolume8 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace8)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace8)));
def putOptionVolume9 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace9)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace9)));
def putOptionVolume10 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace10)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace10)));
def putOptionVolume11 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace11)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace11)));
def putOptionVolume12 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace12)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace12)));
def putOptionVolume13 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace13)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace13)));
def putOptionVolume14 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace14)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace1)));
def putOptionVolume15 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace15)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace15)));
def putOptionVolume16 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace16)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace16)));
def putOptionVolume17 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace17)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace17)));
def putOptionVolume18 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace18)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace18)));
def putOptionVolume19 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace19)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace19)));
def putOptionVolume20 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace20)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace20)));
def putOptionVolume21 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace21)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace21)));
def putOptionVolume22 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace22)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace22)));
def putOptionVolume23 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace23)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace23)));
def putOptionVolume24 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace24)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace24)));
def putOptionVolume25 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace25)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace25)));
def putOptionVolume26 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace1)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace1)));
def putOptionVolume27 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace2)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace2)));
def putOptionVolume28 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace3)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace3)));
def putOptionVolume29 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace4)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace4)));
def putOptionVolume30 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace5)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace5)));
def putOptionVolume31 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace6)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace6)));
def putOptionVolume32 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace7)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace7)));
def putOptionVolume33 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace8)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace8)));
def putOptionVolume34 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace9)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace9)));
def putOptionVolume35 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace10)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace10)));
def putOptionVolume36 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace11)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace11)));
def putOptionVolume37 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace12)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace12)));
def putOptionVolume38 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace13)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace13)));
def putOptionVolume39 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace14)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace14)));
def putOptionVolume40 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace15)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace15)));
def putOptionVolume41 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace16)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace16)));
def putOptionVolume42 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace17)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace17)));
def putOptionVolume43 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace18)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace18)));
def putOptionVolume44 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace19)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace19)));
def putOptionVolume45 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace20)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace20)));
def putOptionVolume46 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace21)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace21)));
def putOptionVolume47 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace22)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace22)));
def putOptionVolume48 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace23)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace23)));
def putOptionVolume49 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace24)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace24)));
def putOptionVolume50 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace25)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace25)));
### Call Option Volume
def callOptionVolume = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike)));
def callOptionVolume1 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace1)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace1)));
def callOptionVolume2 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace2)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace2)));
def callOptionVolume3 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace3)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace3)));
def callOptionVolume4 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace4)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace4)));
def callOptionVolume5 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace5)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace5)));
def callOptionVolume6 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace6)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace6)));
def callOptionVolume7 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace7)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace7)));
def callOptionVolume8 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace8)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace8)));
def callOptionVolume9 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace9)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace9)));
def callOptionVolume10 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace10)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace10)));
def callOptionVolume11 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace11)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace11)));
def callOptionVolume12 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace12)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace12)));
def callOptionVolume13 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace13)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace13)));
def callOptionVolume14 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace14)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace1)));
def callOptionVolume15 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace15)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace15)));
def callOptionVolume16 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace16)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace16)));
def callOptionVolume17 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace17)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace17)));
def callOptionVolume18 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace18)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace18)));
def callOptionVolume19 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace19)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace19)));
def callOptionVolume20 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace20)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace20)));
def callOptionVolume21 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace21)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace21)));
def callOptionVolume22 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace22)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace22)));
def callOptionVolume23 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace23)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace23)));
def callOptionVolume24 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace24)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace24)));
def callOptionVolume25 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace25)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace25)));
def callOptionVolume26 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace1)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace1)));
def callOptionVolume27 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace2)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace2)));
def callOptionVolume28 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace3)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace3)));
def callOptionVolume29 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace4)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace4)));
def callOptionVolume30 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace5)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace5)));
def callOptionVolume31 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace6)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace6)));
def callOptionVolume32 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace7)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace7)));
def callOptionVolume33 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace8)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace8)));
def callOptionVolume34 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace9)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace9)));
def callOptionVolume35 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace10)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace10)));
def callOptionVolume36 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace11)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace11)));
def callOptionVolume37 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace12)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace12)));
def callOptionVolume38 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace13)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace13)));
def callOptionVolume39 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace14)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace14)));
def callOptionVolume40 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace15)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace15)));
def callOptionVolume41 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace16)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace16)));
def callOptionVolume42 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace17)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace17)));
def callOptionVolume43 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace18)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace18)));
def callOptionVolume44 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace19)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace19)));
def callOptionVolume45 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace20)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace20)));
def callOptionVolume46 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace21)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace21)));
def callOptionVolume47 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace22)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace22)));
def callOptionVolume48 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace23)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace23)));
def callOptionVolume49 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace24)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace24)));
def callOptionVolume50 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace25)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace25)));
### Put Option Premium
def putOptionPremium = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike)));
def putOptionPremium1 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace1)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace1)));
def putOptionPremium2 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace2)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace2)));
def putOptionPremium3 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace3)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace3)));
def putOptionPremium4 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace4)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace4)));
def putOptionPremium5 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace5)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace5)));
def putOptionPremium6 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace6)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace6)));
def putOptionPremium7 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace7)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace7)));
def putOptionPremium8 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace8)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace8)));
def putOptionPremium9 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace9)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace9)));
def putOptionPremium10 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace10)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace10)));
def putOptionPremium11 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace11)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace11)));
def putOptionPremium12 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace12)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace12)));
def putOptionPremium13 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace13)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace13)));
def putOptionPremium14 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace14)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace1)));
def putOptionPremium15 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace15)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace15)));
def putOptionPremium16 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace16)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace16)));
def putOptionPremium17 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace17)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace17)));
def putOptionPremium18 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace18)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace18)));
def putOptionPremium19 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace19)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace19)));
def putOptionPremium20 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace20)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace20)));
def putOptionPremium21 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace21)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace21)));
def putOptionPremium22 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace22)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace22)));
def putOptionPremium23 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace23)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace23)));
def putOptionPremium24 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace24)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace24)));
def putOptionPremium25 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace25)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike-strikeSpace25)));
def putOptionPremium26 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace1)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace1)));
def putOptionPremium27 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace2)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace2)));
def putOptionPremium28 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace3)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace3)));
def putOptionPremium29 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace4)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace4)));
def putOptionPremium30 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace5)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace5)));
def putOptionPremium31 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace6)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace6)));
def putOptionPremium32 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace7)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace7)));
def putOptionPremium33 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace8)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace8)));
def putOptionPremium34 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace9)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace9)));
def putOptionPremium35 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace10)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace10)));
def putOptionPremium36 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace11)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace11)));
def putOptionPremium37 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace12)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace12)));
def putOptionPremium38 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace13)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace13)));
def putOptionPremium39 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace14)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace14)));
def putOptionPremium40 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace15)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace15)));
def putOptionPremium41 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace16)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace16)));
def putOptionPremium42 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace17)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace17)));
def putOptionPremium43 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace18)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace18)));
def putOptionPremium44 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace19)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace19)));
def putOptionPremium45 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace20)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace20)));
def putOptionPremium46 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace21)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace21)));
def putOptionPremium47 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace22)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace22)));
def putOptionPremium48 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace23)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace23)));
def putOptionPremium49 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace24)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace24)));
def putOptionPremium50 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace25)))) then 0 else close(Concat(optionSeriesPrefix, Concat("P", strike+strikeSpace25)));
### Call Option Premium
def callOptionPremium = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike)));
def callOptionPremium1 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace1)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace1)));
def callOptionPremium2 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace2)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace2)));
def callOptionPremium3 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace3)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace3)));
def callOptionPremium4 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace4)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace4)));
def callOptionPremium5 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace5)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace5)));
def callOptionPremium6 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace6)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace6)));
def callOptionPremium7 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace7)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace7)));
def callOptionPremium8 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace8)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace8)));
def callOptionPremium9 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace9)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace9)));
def callOptionPremium10 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace10)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace10)));
def callOptionPremium11 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace11)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace11)));
def callOptionPremium12 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace12)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace12)));
def callOptionPremium13 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace13)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace13)));
def callOptionPremium14 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace14)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace1)));
def callOptionPremium15 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace15)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace15)));
def callOptionPremium16 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace16)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace16)));
def callOptionPremium17 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace17)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace17)));
def callOptionPremium18 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace18)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace18)));
def callOptionPremium19 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace19)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace19)));
def callOptionPremium20 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace20)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace20)));
def callOptionPremium21 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace21)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace21)));
def callOptionPremium22 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace22)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace22)));
def callOptionPremium23 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace23)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace23)));
def callOptionPremium24 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace24)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace24)));
def callOptionPremium25 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace25)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike-strikeSpace25)));
def callOptionPremium26 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace1)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace1)));
def callOptionPremium27 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace2)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace2)));
def callOptionPremium28 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace3)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace3)));
def callOptionPremium29 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace4)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace4)));
def callOptionPremium30 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace5)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace5)));
def callOptionPremium31 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace6)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace6)));
def callOptionPremium32 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace7)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace7)));
def callOptionPremium33 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace8)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace8)));
def callOptionPremium34 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace9)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace9)));
def callOptionPremium35 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace10)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace10)));
def callOptionPremium36 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace11)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace11)));
def callOptionPremium37 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace12)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace12)));
def callOptionPremium38 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace13)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace13)));
def callOptionPremium39 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace14)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace14)));
def callOptionPremium40 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace15)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace15)));
def callOptionPremium41 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace16)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace16)));
def callOptionPremium42 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace17)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace17)));
def callOptionPremium43 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace18)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace18)));
def callOptionPremium44 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace19)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace19)));
def callOptionPremium45 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace20)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace20)));
def callOptionPremium46 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace21)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace21)));
def callOptionPremium47 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace22)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace22)));
def callOptionPremium48 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace23)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace23)));
def callOptionPremium49 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace24)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace24)));
def callOptionPremium50 = if IsNaN(close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace25)))) then 0 else close(Concat(optionSeriesPrefix, Concat("C", strike+strikeSpace25)));
### Total Put Premium
def totalPutPremium = (putOptionVolume*putOptionPremium)+(putOptionVolume1*putOptionPremium1)
+(putOptionVolume2*putOptionPremium2)+(putOptionVolume3*putOptionPremium3)+(putOptionVolume4*putOptionPremium4)
+(putOptionVolume5*putOptionPremium5)+(putOptionVolume6*putOptionPremium6)+(putOptionVolume7*putOptionPremium7)
+(putOptionVolume8*putOptionPremium8)+(putOptionVolume9*putOptionPremium9)+(putOptionVolume10*putOptionPremium10)
+(putOptionVolume11*putOptionPremium11)+(putOptionVolume12*putOptionPremium12)+(putOptionVolume13*putOptionPremium13)
+(putOptionVolume14*putOptionPremium14)+(putOptionVolume15*putOptionPremium15)+(putOptionVolume16*putOptionPremium16)
+(putOptionVolume17*putOptionPremium17)+(putOptionVolume18*putOptionPremium18)+(putOptionVolume19*putOptionPremium19)
+(putOptionVolume20*putOptionPremium20)+(putOptionVolume21*putOptionPremium21)+(putOptionVolume22*putOptionPremium22)
+(putOptionVolume23*putOptionPremium23)+(putOptionVolume24*putOptionPremium24)+(putOptionVolume25*putOptionPremium25)
+(putOptionVolume26*putOptionPremium26)+(putOptionVolume27*putOptionPremium27)+(putOptionVolume28*putOptionPremium28)
+(putOptionVolume29*putOptionPremium29)+(putOptionVolume30*putOptionPremium30)+(putOptionVolume31*putOptionPremium31)
+(putOptionVolume32*putOptionPremium32)+(putOptionVolume33*putOptionPremium33)+(putOptionVolume34*putOptionPremium34)
+(putOptionVolume35*putOptionPremium35)+(putOptionVolume36*putOptionPremium36)+(putOptionVolume37*putOptionPremium37)
+(putOptionVolume38*putOptionPremium38)+(putOptionVolume39*putOptionPremium39)+(putOptionVolume40*putOptionPremium40)
+(putOptionVolume41*putOptionPremium41)+(putOptionVolume42*putOptionPremium42)+(putOptionVolume43*putOptionPremium43)
+(putOptionVolume44*putOptionPremium44)+(putOptionVolume45*putOptionPremium45)+(putOptionVolume46*putOptionPremium46)
+(putOptionVolume47*putOptionPremium47)+(putOptionVolume48*putOptionPremium48)+(putOptionVolume49*putOptionPremium49)
+(putOptionVolume50*putOptionPremium50) ;
### Total Put Premium
def totalCallPremium = (callOptionVolume*callOptionPremium)+(callOptionVolume1*callOptionPremium1) +(callOptionVolume2*callOptionPremium2)+(callOptionVolume3*callOptionPremium3)+(callOptionVolume4*callOptionPremium4)
+(callOptionVolume5*callOptionPremium5)+(callOptionVolume6*callOptionPremium6)+(callOptionVolume7*callOptionPremium7)
+(callOptionVolume8*callOptionPremium8)+(callOptionVolume9*callOptionPremium9)+(callOptionVolume10*callOptionPremium10)
+(callOptionVolume11*callOptionPremium11)+(callOptionVolume12*callOptionPremium12)+(callOptionVolume13*callOptionPremium13)
+(callOptionVolume14*callOptionPremium14)+(callOptionVolume15*callOptionPremium15)+(callOptionVolume16*callOptionPremium16)
+(callOptionVolume17*callOptionPremium17)+(callOptionVolume18*callOptionPremium18)+(callOptionVolume19*callOptionPremium19)
+(callOptionVolume20*callOptionPremium20)+(callOptionVolume21*callOptionPremium21)+(callOptionVolume22*callOptionPremium22)
+(callOptionVolume23*callOptionPremium23)+(callOptionVolume24*callOptionPremium24)+(callOptionVolume25*callOptionPremium25)
+(callOptionVolume26*callOptionPremium26)+(callOptionVolume27*callOptionPremium27)+(callOptionVolume28*callOptionPremium28)
+(callOptionVolume29*callOptionPremium29)+(callOptionVolume30*callOptionPremium30)+(callOptionVolume31*callOptionPremium31)
+(callOptionVolume32*callOptionPremium32)+(callOptionVolume33*callOptionPremium33)+(callOptionVolume34*callOptionPremium34)
+(callOptionVolume35*callOptionPremium35)+(callOptionVolume36*callOptionPremium36)+(callOptionVolume37*callOptionPremium37)
+(callOptionVolume38*callOptionPremium38)+(callOptionVolume39*callOptionPremium39)+(callOptionVolume40*callOptionPremium40)
+(callOptionVolume41*callOptionPremium41)+(callOptionVolume42*callOptionPremium42)+(callOptionVolume43*callOptionPremium43)
+(callOptionVolume44*callOptionPremium44)+(callOptionVolume45*callOptionPremium45)+(callOptionVolume46*callOptionPremium46)
+(callOptionVolume47*callOptionPremium47)+(callOptionVolume48*callOptionPremium48)+(callOptionVolume49*callOptionPremium49)
+(callOptionVolume50*callOptionPremium50) ;
plot zero = 0;
zero.SetDefaultColor(Color.cyan);
zero.HideTitle();
#AddLabel(yes, "DTE:" + optionSeriesPrefix, Color.gray);
#AddLabel(yes, "Strike:" + strike, Color.gray);
#AddLabel(yes, ("Put Premium: $" + round(totalputPremium,0) ), Color.light_orange);
#AddLabel(yes, ("Call Premium: $" + round(totalCallPremium,0) ), Color.light_green);
#plot PC_ratio = -totalputPremium + totalCallPremium;
#PC_ratio.setPaintingStrategy(PaintingStrategy.Histogram);
#PC_ratio.AssignValueColor(if PC_ratio < 0 then color.pink else color.cyan);
#def PCRatio = round(totalputPremium/ totalCallPremium,2);
#AddLabel(yes, ("PC Diff: " + PC_ratio ), color.white);
#AddLabel(yes, ("PC ratio: " + PCRatio), color.gray);
plot TPOP = -totalPutPremium;
TPOP.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TPOP.SetDefaultColor(Color.light_orange);
TPOP.SetLineWeight(3);
TPOP.HideTitle();
TPOP.HideBubble();
AddLabel(yes, "DTE:" + optionSeriesPrefix, Color.gray);
AddLabel(yes, "Strike:" + strike, Color.gray);
AddLabel(yes, ("Put Premium:$ " + round(TPOP,0) ), Color.light_orange);
plot TCOP = totalCallPremium;
TCOP.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TCOP.SetDefaultColor(Color.light_green);
TCOP.SetLineWeight(3);
TCOP.HideTitle();
TCOP.HideBubble();
AddLabel(yes, ("Call Premium:$ " + round(TCOP,0) ), Color.light_green);
def PC_ratio = round(-totalPutPremium + totalCallPremium,0);
AddLabel(yes, ("Prem Diff: " + PC_ratio ), color.white);
AddLabel(yes, ("Prem ratio: " + round(totalputPremium/totalCallPremium,2) ), color.gray);
Last edited by a moderator: