Option Volume/Open Interest Indicator for ThinkorSwim

B

blackbeard12

New member
Came across this option volume indicator that shows you the volume/open interest of whatever option contract for ETF/Stock youre looking at. Its a lower study under the chart that I use for SPY.

Right click on an option for analysis and hit "Copy"
Paste it into the Edit Studies "Option Series Prefix"

So if I want to look at SPY calls, I right click the July 12 Spy 290 Calls and hit copy.
I then go into the Edit Studies section and paste which gives me "SPY190712C290"

Then, I'll remove the C290 at the end and am left with only the prefix. And you will put that at the "optionseriesprefix" on line 02

Let me know what yall think.

Code:
declare lower;
input optionSeriesPrefix = ".SPY190712";
input strike = 260.0;
input strikeSpacing = 10.0;
input mode = {default volume, totalVolume, openInterest, volumePercentOI};
input totalStrikes = {default Five, Three, One};

def showThree = if mode == mode.volume and totalStrikes == totalStrikes.Three then 1 else 0;
def showFive = if  mode == mode.volume and totalStrikes == totalStrikes.Five then 1 else 0;

AddLabel(yes, optionSeriesPrefix, Color.WHITE);
AddLabel(yes, Concat(strike, "P"), Color.RED);
AddLabel(showThree or showFive, Concat(strike - strikeSpacing, "P"), Color.MAGENTA);
AddLabel(showThree or showFive, Concat(strike + strikeSpacing, "P"), Color.ORANGE);
AddLabel(showFive, Concat(strike - strikeSpacing - strikeSpacing, "P"), Color.PINK);
AddLabel(showFive, Concat(strike + strikeSpacing + strikeSpacing, "P"), Color.GRAY);
AddLabel(yes, Concat(strike, "C"), Color.GREEN);
AddLabel(showThree or showFive, Concat(strike - strikeSpacing, "C"), Color.CYAN);
AddLabel(showThree or showFive, Concat(strike + strikeSpacing, "C"), Color.BLUE);
AddLabel(showFive, Concat(strike - strikeSpacing - strikeSpacing, "C"), Color.LIME);
AddLabel(showFive, Concat(strike + strikeSpacing + strikeSpacing, "C"), Color.WHITE);

def putOptionVolume =  if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike)));
rec cumPutVolume = cumPutVolume[1] + putOptionVolume;
def totalputOptionVolume = volume(Concat(optionSeriesPrefix, Concat("P", strike)), "DAY");
def putOptionOI = open_interest(Concat(optionSeriesPrefix, Concat("P", strike)), "DAY");
def callOptionVolume = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike)));
rec cumCallVolume = cumCallVolume[1] + callOptionVolume;
def totalcallOptionVolume = volume(Concat(optionSeriesPrefix, Concat("C", strike)), "DAY");
def callOptionOI = open_interest(Concat(optionSeriesPrefix, Concat("C", strike)), "DAY");

def putOptionVolume1 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing)));
rec cumPutVolume1 = cumPutVolume1[1] + putOptionVolume1;
def totalputOptionVolume1 = volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing)), "DAY");
def putOptionOI1 = open_interest(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing)), "DAY");
def callOptionVolume1 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing)));
rec cumCallVolume1 = cumCallVolume1[1] + callOptionVolume1;
def totalcallOptionVolume1 = volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing)), "DAY");
def callOptionOI1 = open_interest(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing)), "DAY");

def putOptionVolume2 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing)));
rec cumPutVolume2 = cumPutVolume2[1] + putOptionVolume2;
def totalputOptionVolume2 = volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing)), "DAY");
def putOptionOI2 = open_interest(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing)), "DAY");
def callOptionVolume2 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing)));
rec cumCallVolume2 = cumCallVolume2[1] + callOptionVolume2;
def totalcallOptionVolume2 = volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing)), "DAY");
def callOptionOI2 = open_interest(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing)), "DAY");

def putOptionVolume3 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing - strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing - strikeSpacing)));
rec cumPutVolume3 = cumPutVolume3[1] + putOptionVolume3;
def totalputOptionVolume3 = volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing - strikeSpacing)), "DAY");
def putOptionOI3 = open_interest(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing - strikeSpacing)), "DAY");
def callOptionVolume3 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing - strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing - strikeSpacing)));
rec cumCallVolume3 = cumCallVolume3[1] + callOptionVolume3;
def totalcallOptionVolume3 = volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing - strikeSpacing)), "DAY");
def callOptionOI3 = open_interest(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing - strikeSpacing)), "DAY");

def putOptionVolume4 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing + strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing + strikeSpacing)));
rec cumPutVolume4 = cumPutVolume4[1] + putOptionVolume4;
def totalputOptionVolume4 = volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing + strikeSpacing)), "DAY");
def putOptionOI4 = open_interest(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing + strikeSpacing)), "DAY");
def callOptionVolume4 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing + strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing + strikeSpacing)));
rec cumCallVolume4 = cumCallVolume4[1] + callOptionVolume4;
def totalcallOptionVolume4 = volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing + strikeSpacing)), "DAY");
def callOptionOI4 = open_interest(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing + strikeSpacing)), "DAY");

plot zero = 0;
zero.SetDefaultColor(Color.WHITE);
zero.HideTitle();

plot datap4;
plot datac4;
switch (mode){
case volume:
    datap4 = -putOptionVolume4 * showFive;
    datac4 = callOptionVolume4 * showFive;
case totalVolume:
    datap4 = Double.NaN;
    datac4 = Double.NaN;
case openInterest:
    datap4 = Double.NaN;
    datac4 = Double.NaN;
case volumePercentOI:
    datap4 = Double.NaN;
    datac4 = Double.NaN;
}
datap4.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac4.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datap4.SetDefaultColor(Color.GRAY);
datac4.SetDefaultColor(Color.WHITE);
datap4.SetLineWeight(3);
datac4.SetLineWeight(3);
datap4.HideTitle();
datac4.HideTitle();
datap4.HideBubble();
datac4.HideBubble();

plot datap3;
plot datac3;
switch (mode){
case volume:
    datap3 = -putOptionVolume3 * showFive - putOptionVolume4 * showFive;
    datac3 = callOptionVolume3 * showFive + callOptionVolume4 * showFive;
case totalVolume:
    datap3 = Double.NaN;
    datac3 = Double.NaN;
case openInterest:
    datap3 = Double.NaN;
    datac3 = Double.NaN;
case volumePercentOI:
    datap3 = Double.NaN;
    datac3 = Double.NaN;
}
datap3.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac3.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

datap3.SetDefaultColor(Color.PINK);
datac3.SetDefaultColor(Color.LIME);

datap3.SetLineWeight(3);
datac3.SetLineWeight(3);
datap3.HideTitle();
datac3.HideTitle();
datap3.HideBubble();
datac3.HideBubble();

plot datap2;
plot datac2;
switch (mode){
case volume:
    datap2 = -putOptionVolume2 * (showThree or showFive) - putOptionVolume3 * showFive - putOptionVolume4 * showFive;
    datac2 = +callOptionVolume2 * (showThree or showFive) + callOptionVolume3 * showFive + callOptionVolume4 * showFive;
case totalVolume:
    datap2 = Double.NaN;
    datac2 = Double.NaN;
case openInterest:
    datap2 = Double.NaN;
    datac2 = Double.NaN;
case volumePercentOI:
    datap2 = Double.NaN;
    datac2 = Double.NaN;
}
datap2.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac2.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datap2.SetDefaultColor(Color.ORANGE);
datac2.SetDefaultColor(Color.BLUE);
datap2.SetLineWeight(3);
datac2.SetLineWeight(3);
datap2.HideTitle();
datac2.HideTitle();
datap2.HideBubble();
datac2.HideBubble();

plot datap1;
plot datac1;
switch (mode){
case volume:
    datap1 = -putOptionVolume1 * (showThree or showFive) - putOptionVolume2 * (showThree or showFive) - putOptionVolume3 * showFive - putOptionVolume4 * showFive;
    datac1 = callOptionVolume1 * (showThree or showFive) + callOptionVolume2 * (showThree or showFive) + callOptionVolume3 * showFive + callOptionVolume4 * showFive;
case totalVolume:
    datap1 = Double.NaN;
    datac1 = Double.NaN;
case openInterest:
    datap1 = Double.NaN;
    datac1 = Double.NaN;
case volumePercentOI:
    datap1 = Double.NaN;
    datac1 = Double.NaN;
}
datap1.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac1.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datap1.SetDefaultColor(Color.MAGENTA);
datac1.SetDefaultColor(Color.CYAN);
datap1.SetLineWeight(3);
datac1.SetLineWeight(3);
datap1.HideTitle();
datac1.HideTitle();
datap1.HideBubble();
datac1.HideBubble();

plot datap;
plot datac;
switch (mode){
case volume:
    datap = -putOptionVolume - putOptionVolume1 * (showThree or showFive) - putOptionVolume2 * (showThree or showFive) - putOptionVolume3 * showFive - putOptionVolume4 * showFive;
    datac = callOptionVolume + callOptionVolume1 * (showThree or showFive) + callOptionVolume2 * (showThree or showFive) + callOptionVolume3 * showFive + callOptionVolume4 * showFive;
case totalVolume:
    datap = -totalputOptionVolume;
    datac = totalcallOptionVolume;
case openInterest:
    datap = -putOptionOI;
    datac = callOptionOI;
case volumePercentOI:
    datap = -putOptionVolume * 100 / putOptionOI;
    datac = callOptionVolume * 100 / callOptionOI;
}
datap.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datap.SetDefaultColor(Color.RED);
datac.SetDefaultColor(Color.GREEN);
datap.SetLineWeight(3);
datac.SetLineWeight(3);
datap.HideTitle();
datac.HideTitle();
datap.HideBubble();
datac.HideBubble();
 
H

horserider

Well-known member
VIP
Warehouse
Looks nice, how can one use it. Is not all the volume and open interest shown in the option chain? Please explain how this gives an advantage. I am no option expert so an explaination is needed. Thanks.
 
B

blackbeard12

New member
Looks nice, how can one use it. Is not all the volume and open interest shown in the option chain? Please explain how this gives an advantage. I am no option expert so an explaination is needed. Thanks.
lets you know active buying and selling of options, I use it on the 1min chart day trading so that I know the put/call ratio before I make a trade, helps as an extra confirmation per each trade.
 
J

jjttrader

New member
Hey @blackbeard12 I'm having a little trouble adding this script to TOS. It's just showing up as a straight horizontal line. Any chance you could help? Much appreciated.
 
markos

markos

Well-known member
VIP
Warehouse
Came across this option volume indicator that shows you the volume/open interest of whatever option contract for ETF/Stock youre looking at. Its a lower study under the chart that I use for SPY.

Right click on an option for analysis and hit "Copy"
Paste it into the Edit Studies "Option Series Prefix"

So if I want to look at SPY calls, I right click the July 12 Spy 290 Calls and hit copy.
I then go into the Edit Studies section and paste which gives me "SPY190712C290"

Then, I'll remove the C290 at the end and am left with only the prefix. And you will put that at the "optionseriesprefix" on line 02

Let me know what yall think.

Code:
declare lower;
input optionSeriesPrefix = ".SPY190712";
input strike = 260.0;
input strikeSpacing = 10.0;
input mode = {default volume, totalVolume, openInterest, volumePercentOI};
input totalStrikes = {default Five, Three, One};

def showThree = if mode == mode.volume and totalStrikes == totalStrikes.Three then 1 else 0;
def showFive = if  mode == mode.volume and totalStrikes == totalStrikes.Five then 1 else 0;

AddLabel(yes, optionSeriesPrefix, Color.WHITE);
AddLabel(yes, Concat(strike, "P"), Color.RED);
AddLabel(showThree or showFive, Concat(strike - strikeSpacing, "P"), Color.MAGENTA);
AddLabel(showThree or showFive, Concat(strike + strikeSpacing, "P"), Color.ORANGE);
AddLabel(showFive, Concat(strike - strikeSpacing - strikeSpacing, "P"), Color.PINK);
AddLabel(showFive, Concat(strike + strikeSpacing + strikeSpacing, "P"), Color.GRAY);
AddLabel(yes, Concat(strike, "C"), Color.GREEN);
AddLabel(showThree or showFive, Concat(strike - strikeSpacing, "C"), Color.CYAN);
AddLabel(showThree or showFive, Concat(strike + strikeSpacing, "C"), Color.BLUE);
AddLabel(showFive, Concat(strike - strikeSpacing - strikeSpacing, "C"), Color.LIME);
AddLabel(showFive, Concat(strike + strikeSpacing + strikeSpacing, "C"), Color.WHITE);

def putOptionVolume =  if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike)));
rec cumPutVolume = cumPutVolume[1] + putOptionVolume;
def totalputOptionVolume = volume(Concat(optionSeriesPrefix, Concat("P", strike)), "DAY");
def putOptionOI = open_interest(Concat(optionSeriesPrefix, Concat("P", strike)), "DAY");
def callOptionVolume = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike)));
rec cumCallVolume = cumCallVolume[1] + callOptionVolume;
def totalcallOptionVolume = volume(Concat(optionSeriesPrefix, Concat("C", strike)), "DAY");
def callOptionOI = open_interest(Concat(optionSeriesPrefix, Concat("C", strike)), "DAY");

def putOptionVolume1 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing)));
rec cumPutVolume1 = cumPutVolume1[1] + putOptionVolume1;
def totalputOptionVolume1 = volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing)), "DAY");
def putOptionOI1 = open_interest(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing)), "DAY");
def callOptionVolume1 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing)));
rec cumCallVolume1 = cumCallVolume1[1] + callOptionVolume1;
def totalcallOptionVolume1 = volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing)), "DAY");
def callOptionOI1 = open_interest(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing)), "DAY");

def putOptionVolume2 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing)));
rec cumPutVolume2 = cumPutVolume2[1] + putOptionVolume2;
def totalputOptionVolume2 = volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing)), "DAY");
def putOptionOI2 = open_interest(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing)), "DAY");
def callOptionVolume2 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing)));
rec cumCallVolume2 = cumCallVolume2[1] + callOptionVolume2;
def totalcallOptionVolume2 = volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing)), "DAY");
def callOptionOI2 = open_interest(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing)), "DAY");

def putOptionVolume3 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing - strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing - strikeSpacing)));
rec cumPutVolume3 = cumPutVolume3[1] + putOptionVolume3;
def totalputOptionVolume3 = volume(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing - strikeSpacing)), "DAY");
def putOptionOI3 = open_interest(Concat(optionSeriesPrefix, Concat("P", strike - strikeSpacing - strikeSpacing)), "DAY");
def callOptionVolume3 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing - strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing - strikeSpacing)));
rec cumCallVolume3 = cumCallVolume3[1] + callOptionVolume3;
def totalcallOptionVolume3 = volume(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing - strikeSpacing)), "DAY");
def callOptionOI3 = open_interest(Concat(optionSeriesPrefix, Concat("C", strike - strikeSpacing - strikeSpacing)), "DAY");

def putOptionVolume4 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing + strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing + strikeSpacing)));
rec cumPutVolume4 = cumPutVolume4[1] + putOptionVolume4;
def totalputOptionVolume4 = volume(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing + strikeSpacing)), "DAY");
def putOptionOI4 = open_interest(Concat(optionSeriesPrefix, Concat("P", strike + strikeSpacing + strikeSpacing)), "DAY");
def callOptionVolume4 = if IsNaN(volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing + strikeSpacing)))) then 0 else volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing + strikeSpacing)));
rec cumCallVolume4 = cumCallVolume4[1] + callOptionVolume4;
def totalcallOptionVolume4 = volume(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing + strikeSpacing)), "DAY");
def callOptionOI4 = open_interest(Concat(optionSeriesPrefix, Concat("C", strike + strikeSpacing + strikeSpacing)), "DAY");

plot zero = 0;
zero.SetDefaultColor(Color.WHITE);
zero.HideTitle();

plot datap4;
plot datac4;
switch (mode){
case volume:
    datap4 = -putOptionVolume4 * showFive;
    datac4 = callOptionVolume4 * showFive;
case totalVolume:
    datap4 = Double.NaN;
    datac4 = Double.NaN;
case openInterest:
    datap4 = Double.NaN;
    datac4 = Double.NaN;
case volumePercentOI:
    datap4 = Double.NaN;
    datac4 = Double.NaN;
}
datap4.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac4.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datap4.SetDefaultColor(Color.GRAY);
datac4.SetDefaultColor(Color.WHITE);
datap4.SetLineWeight(3);
datac4.SetLineWeight(3);
datap4.HideTitle();
datac4.HideTitle();
datap4.HideBubble();
datac4.HideBubble();

plot datap3;
plot datac3;
switch (mode){
case volume:
    datap3 = -putOptionVolume3 * showFive - putOptionVolume4 * showFive;
    datac3 = callOptionVolume3 * showFive + callOptionVolume4 * showFive;
case totalVolume:
    datap3 = Double.NaN;
    datac3 = Double.NaN;
case openInterest:
    datap3 = Double.NaN;
    datac3 = Double.NaN;
case volumePercentOI:
    datap3 = Double.NaN;
    datac3 = Double.NaN;
}
datap3.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac3.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);

datap3.SetDefaultColor(Color.PINK);
datac3.SetDefaultColor(Color.LIME);

datap3.SetLineWeight(3);
datac3.SetLineWeight(3);
datap3.HideTitle();
datac3.HideTitle();
datap3.HideBubble();
datac3.HideBubble();

plot datap2;
plot datac2;
switch (mode){
case volume:
    datap2 = -putOptionVolume2 * (showThree or showFive) - putOptionVolume3 * showFive - putOptionVolume4 * showFive;
    datac2 = +callOptionVolume2 * (showThree or showFive) + callOptionVolume3 * showFive + callOptionVolume4 * showFive;
case totalVolume:
    datap2 = Double.NaN;
    datac2 = Double.NaN;
case openInterest:
    datap2 = Double.NaN;
    datac2 = Double.NaN;
case volumePercentOI:
    datap2 = Double.NaN;
    datac2 = Double.NaN;
}
datap2.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac2.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datap2.SetDefaultColor(Color.ORANGE);
datac2.SetDefaultColor(Color.BLUE);
datap2.SetLineWeight(3);
datac2.SetLineWeight(3);
datap2.HideTitle();
datac2.HideTitle();
datap2.HideBubble();
datac2.HideBubble();

plot datap1;
plot datac1;
switch (mode){
case volume:
    datap1 = -putOptionVolume1 * (showThree or showFive) - putOptionVolume2 * (showThree or showFive) - putOptionVolume3 * showFive - putOptionVolume4 * showFive;
    datac1 = callOptionVolume1 * (showThree or showFive) + callOptionVolume2 * (showThree or showFive) + callOptionVolume3 * showFive + callOptionVolume4 * showFive;
case totalVolume:
    datap1 = Double.NaN;
    datac1 = Double.NaN;
case openInterest:
    datap1 = Double.NaN;
    datac1 = Double.NaN;
case volumePercentOI:
    datap1 = Double.NaN;
    datac1 = Double.NaN;
}
datap1.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac1.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datap1.SetDefaultColor(Color.MAGENTA);
datac1.SetDefaultColor(Color.CYAN);
datap1.SetLineWeight(3);
datac1.SetLineWeight(3);
datap1.HideTitle();
datac1.HideTitle();
datap1.HideBubble();
datac1.HideBubble();

plot datap;
plot datac;
switch (mode){
case volume:
    datap = -putOptionVolume - putOptionVolume1 * (showThree or showFive) - putOptionVolume2 * (showThree or showFive) - putOptionVolume3 * showFive - putOptionVolume4 * showFive;
    datac = callOptionVolume + callOptionVolume1 * (showThree or showFive) + callOptionVolume2 * (showThree or showFive) + callOptionVolume3 * showFive + callOptionVolume4 * showFive;
case totalVolume:
    datap = -totalputOptionVolume;
    datac = totalcallOptionVolume;
case openInterest:
    datap = -putOptionOI;
    datac = callOptionOI;
case volumePercentOI:
    datap = -putOptionVolume * 100 / putOptionOI;
    datac = callOptionVolume * 100 / callOptionOI;
}
datap.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datac.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
datap.SetDefaultColor(Color.RED);
datac.SetDefaultColor(Color.GREEN);
datap.SetLineWeight(3);
datac.SetLineWeight(3);
datap.HideTitle();
datac.HideTitle();
datap.HideBubble();
datac.HideBubble();
@blackbeard12
Hi, Please edit this to put the header in so everyone knows where it came from AND we give credit to it's creator. Thanks, Markos
 
O

Oscaromil

New member
VIP
Can you please show a picture of how to add it, I can't figure it out how to use it
 
S

soary

Member
My two cents on option interest. I find that using short interest and put/call ratio are more usefull information in trading so that I know the potential for a squeeze, and perhaps not overstay in a trade and get caught on the wrong side of the trade.
 
P

Phatrook

New member
Good point, Soary......
My two cents on option interest. I find that using short interest and put/call ratio are more usefull information in trading so that I know the potential for a squeeze, and perhaps not overstay in a trade and get caught on the wrong side of the trade.
 
S

San

Member
VIP
@blackbeard12, Is it possible to add more then one symbol in single screen. Example: Spy /aapl/amzn for October. OR is there way to show automatically the specific symbol chain on weekly based on lower screen instead of manually copy the option chain.
 
P

princesly

New member
Warehouse
This is nice--thanks for sharing. Is it possible to code it so that it corresponds to TOS color-coded linking? Or make it work depending on which stock is on the ticker.
 
2

2sureshk

Member
lets you know active buying and selling of options, I use it on the 1min chart day trading so that I know the put/call ratio before I make a trade, helps as an extra confirmation per each trade.
Do you use any strategy with put call ratio

Any rules to place buy/sell help with the indicator
Thx
 
I

igorzivt

New member
can you share any indicators for analyzing the optional volume? For example, like this one in the picture
 
S

spm009

New member
can you share any indicators for analyzing the optional volume? For example, like this one in the picture
First, thanks for this study, its cool but could use a little work. Wish it could automatically pull strikes and whatnot.

Also invested in any put/call volume studies like the one above.
 
P

Playstation

Member
Warehouse
Is there any scripts for the Put and Call Volume or Open interest that Igor above posted?
It would be great if the chart could be plotted in lower, and plot the results at each time frame. We could potentially identify sudden movement in either puts or calls.
 
Pipmonster

Pipmonster

New member
Really cool forum...

Wanted to know if anyone has created or know how to create an indicator that gives you a Short interest ratio etc.?
 

Top