Mixed Volume Indicator for ThinkorSwim

Shinthus

Member
2019 Donor
Here is mixed volume that shows the buying/selling in each individual volume bar. Be careful adding any more volume indicators on top of this one, like VolumeAvg. Everything else tends to cancel it out. Best used alone in the "volume" section of the studies.

I typically use this to refine my decisions whether to go long or short. It also helps to determine whether to stay in a trade or get out if you see red volume increasing in a long position or green volume while holding a short position. Please note: a candlestick can be green but the bar can be mostly red, and vice versa. It's a true, leading indicator of which side is taking control.

QBSuS7e.png


https://tos.mx/H582pK
 

webtolight

New member
I was thinking maybe if the indicator could possibly plot the volume average as a line across the indicator, that would be great!
 

markos

Well-known member
VIP
I was thinking maybe if the indicator could possibly plot the volume average as a line across the indicator, that would be great!
that is a built in indicator. get acquainted with the manual, there are over 400 baked in indicators.
Code:
#
# TD Ameritrade IP Company, Inc. (c) 2007-2019
#

declare lower;
declare zerobase;

input length = 50;

plot Vol = volume;
plot VolAvg = Average(volume, length);

Vol.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Vol.SetLineWeight(3);
Vol.DefineColor("Up", Color.UPTICK);
Vol.DefineColor("Down", Color.DOWNTICK);
Vol.AssignValueColor(if close > close[1] then Vol.color("Up") else if close < close[1] then Vol.color("Down") else GetColor(1));
VolAvg.SetDefaultColor(GetColor(8));
#end
 

tomsey

New member
VIP
Hello Everyone,

I have the colored volume bars (green & red) in the upper area from the study/script (in place of the "built-in" blue bars) with my price candles, is there any way to move them "behind" the price candles?

When I have volume spikes for a particular candle, the green/red volume bars will cover the price candle.... 🤔

If I was in PowerPoint, I would use the "Send to back" function... 😁
 

Fluideng

New member
Agreed. I can't code, though. Someone would have to do that for us.
I cant code yet either but I added the Average line to the Mixed Volume from the Code markos posted. I think it plots correctly.

Code:
declare on_volume;

def O = open;
def H = high;
def C = close;
def L = low;
def V = volume;
def Buying = V*(C-L)/(H-L);
def Selling = V*(H-C)/(H-L);

# Selling Volume
Plot SV = selling;
SV.setPaintingStrategy(PaintingStrategy.Histogram);
SV.SetDefaultColor(Color.Red);
SV.HideTitle();
SV.HideBubble();
SV.SetLineWeight(5);

# Buying Volume
# Plot BV = Buying;
# Note that Selling + Buying Volume = Volume.
input length = 50;
Plot BV = volume;
plot VolAvg = Average(volume, length);
BV.setPaintingStrategy(PaintingStrategy.Histogram);
BV.SetDefaultColor(Color.Dark_Green);
BV.HideTitle();
BV.HideBubble();
BV.SetLineWeight(5);
VolAvg.SetDefaultColor(GetColor(8));
 

rad14733

Well-known member
VIP
Thank you for posting this... 👍

Unfortunately, in this particular case, I can't get the colored volume bars behind the price candles... and I've moved the study to every position in the "Price" and "Volume" sections... when I "Edit" the studies.... 🤔

No, I don't think that is possible on a chart... You can change Study layer priority but the Candles are layer zero with all other layers on top...
 
Here is mixed volume that shows the buying/selling in each individual volume bar. Be careful adding any more volume indicators on top of this one, like VolumeAvg. Everything else tends to cancel it out. Best used alone in the "volume" section of the studies.

I typically use this to refine my decisions whether to go long or short. It also helps to determine whether to stay in a trade or get out if you see red volume increasing in a long position or green volume while holding a short position. Please note: a candlestick can be green but the bar can be mostly red, and vice versa. It's a true, leading indicator of which side is taking control.

QBSuS7e.png


https://tos.mx/H582pK
Hi - I placed this 'alone' in the volume section per your instruction above - and the indicator did not appear on the chart - Please see screenshot -

xeEwFRE.png


So I then moved it into 'Lower' section and then the indicator appeared - Please see screenshot

b7Y5yd7.png


eoPUJdx.png


Looks to be very useful indicator - thank you!
 

Similar threads

Top