• Get $30 off VIP with code SUMMER30. Ends July 27. Happy trading!

Volume Buy Sell Indicator with Hot Percent for ThinkorSwim

solaris

Member
Is there a way to modify the script so i can use it in a watch list so i can watch the current buy bar and sell bar over multiple timeframes.
 

ShinJ

New member
@horserider Thank you for your work! I was wondering if you could add Relative Volume Standard Deviation, as a filter that will hide the candles that are below a given level.

As a reference, this is the code of RelativeVolumeStDev with Spikes threshold

Code:
declare lower;
declare zerobase;

input length = 60;
input numDev = 2.0;
input allowNegativeValues = no;

def rawRelVol = (volume - Average(volume, length)) / StDev(volume, length);
def RelVol = if allowNegativeValues then rawRelVol else Max(0, rawRelVol);

plot StDevLevel = numDev;
plot RV = if RelVol > numDev then RelVol else Double.NaN;

RV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
RV.SetLineWeight(3);
RV.DefineColor("Above", GetColor(0));
RV.DefineColor("Below", GetColor(2));
RV.AssignValueColor(if RelVol >= numDev then RV.Color("Above") else RV.Color("Below"));
StDevLevel.SetDefaultColor(GetColor(7));
StDevLevel.SetStyle(Curve.SHORT_DASH);
# End Code
 
I posted this on the thread for the older version but i'll ask it here as well...



I've been using this indicator or a version of it for awhile now.

Is there anyway to get the hourly vol labels and/or the hist on a 2 min chart?


So instead of on a 2min chart, seeing the 2 min bar vol, I want to see the hourly levels instead.

Thanks for any help
 

thebewb

Member
I posted this on the thread for the older version but i'll ask it here as well...



I've been using this indicator or a version of it for awhile now.

Is there anyway to get the hourly vol labels and/or the hist on a 2 min chart?


So instead of on a 2min chart, seeing the 2 min bar vol, I want to see the hourly levels instead.

Thanks for any help
volume(period = aggregationperiod.hour);
 
I reconfigured it to correctly to show the hourly stats on a 2min chart except It still shows all the 2 min vol histogram bars.

Is there anyway to have it show only the hourly bars on a 2min chart?

Thanks
 

Rojo Grande

Member
VIP
@zeek

Code:
declare lower;

#Inputs

input ShowSellVolumePercent = yes;

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);

#Volume Data


def today = volume(period = "DAY");

def curVolume = volume;

def SellVolPercent = Round((Selling / Volume) * 100, 0);

# Labels

AddLabel(ShowSellVolumePercent, "Cur Bar Sell %: " + SellVolPercent, (if SellVolPercent > 51 then Color.RED else if SellVolPercent < 49 then Color.GREEN else Color.ORANGE));
Hello Horserider, can this be modified so I can have SellVolPercent labels for different tickers on one chart? Thanks for your time.
 

Thomas

Active member
VIP
Hi Horse, nice indicator wonder if you can make it go round, and signal when to go long with some bells and whistles and make it scan with columns...........:) Seriously I like the label, very helpful and use with "Hi_Low," candles.......I assume if it's green and the candles are bullish,
not much selling so look for it to move higher? Nice....
 
Anyone know how to make this work on range bar charts?

When I apply it to the chart, nothing appears. I can add the regular tos vol indicator on range charts
 
Last edited:

Moose

Member
@zeek

Code:
#Advanced Volume Study
#[email protected]
#v5.22.2020
declare upper;
input ShowBuySellStrength = yes;
input TickLevel = 1000;
input ShowTickLabel = yes;


def NA = Double.NaN;
def PriceRange = high - low;

#Current Candle Buy and Sell Strength
def BuyStr = ((close - low) / PriceRange) * 100;
def SellStr = ((high - close) / PriceRange) * 100;


#$TICK Vertical Lines
def tickc = close("$TICK");
def tickh = high("$TICK");
def tickl = low("$TICK");

#$TICK Label
AddLabel(if ShowTickLabel then 1 else 0,"$TICK: " + tickc, if tickc > 0 then Color.GREEN else Color.RED);

def trinRatio = Round(close(symbol="$TRIN"),2);
def trinOverlyBearish = if trinRatio >= 2 then 1 else 0;
def trinOverlyBullish = if trinRatio <= 0.5 then 1 else 0;
AddLabel(yes, "$TRIN: "+trinRatio, if trinOverlyBearish then color.green else if trinOverlyBullish then color.red else color.gray);

def pcallRatio = Round(SimpleMovingAvg(close(symbol="$PCALL"),10),2);
def pcallOverlyBearish = if pcallRatio >= 1 then 1 else 0;
def pcallOverlyBullish = if pcallratio <= 0.85 then 1 else 0;
AddLabel(yes, "$PCALL: "+pcallRatio, if pcallOverlyBearish then color.green else if pcallOverlyBullish then color.red else color.gray);

#current candle Buy/Sell strength labels
#AddLabel(if ShowBuySellStrength then 1 else 0, " ", Color.black);
#AddLabel(if ShowBuySellStrength then 1 else 0, "1", Color.GRAY);
AddLabel(if ShowBuySellStrength then 1 else 0, "Sell " + Round(SellStr, 2) + "%", if SellStr > BuyStr then Color.RED else Color.DARK_RED);
AddLabel(if ShowBuySellStrength then 1 else 0, "Buy " + Round(BuyStr, 2) + "%", if BuyStr > SellStr then Color.GREEN else Color.DARK_GREEN);
 

Sneaky_Swings

Member
VIP
Hello @horserider! I am blown away by the work you have done on this forum. I was wondering if you could share your upper studies in this chart? The thing that caught my eye first was the VWAP with fractal energy script you have.
 
@zeek

Code:
#Advanced Volume Study
#[email protected]
#v5.22.2020
declare upper;
input ShowBuySellStrength = yes;
input TickLevel = 1000;
input ShowTickLabel = yes;


def NA = Double.NaN;
def PriceRange = high - low;

#Current Candle Buy and Sell Strength
def BuyStr = ((close - low) / PriceRange) * 100;
def SellStr = ((high - close) / PriceRange) * 100;


#$TICK Vertical Lines
def tickc = close("$TICK");
def tickh = high("$TICK");
def tickl = low("$TICK");

#$TICK Label
AddLabel(if ShowTickLabel then 1 else 0,"$TICK: " + tickc, if tickc > 0 then Color.GREEN else Color.RED);

def trinRatio = Round(close(symbol="$TRIN"),2);
def trinOverlyBearish = if trinRatio >= 2 then 1 else 0;
def trinOverlyBullish = if trinRatio <= 0.5 then 1 else 0;
AddLabel(yes, "$TRIN: "+trinRatio, if trinOverlyBearish then color.green else if trinOverlyBullish then color.red else color.gray);

def pcallRatio = Round(SimpleMovingAvg(close(symbol="$PCALL"),10),2);
def pcallOverlyBearish = if pcallRatio >= 1 then 1 else 0;
def pcallOverlyBullish = if pcallratio <= 0.85 then 1 else 0;
AddLabel(yes, "$PCALL: "+pcallRatio, if pcallOverlyBearish then color.green else if pcallOverlyBullish then color.red else color.gray);

#current candle Buy/Sell strength labels
#AddLabel(if ShowBuySellStrength then 1 else 0, " ", Color.black);
#AddLabel(if ShowBuySellStrength then 1 else 0, "1", Color.GRAY);
AddLabel(if ShowBuySellStrength then 1 else 0, "Sell " + Round(SellStr, 2) + "%", if SellStr > BuyStr then Color.RED else Color.DARK_RED);
AddLabel(if ShowBuySellStrength then 1 else 0, "Buy " + Round(BuyStr, 2) + "%", if BuyStr > SellStr then Color.GREEN else Color.DARK_GREEN);
does this not work on tick chart? also I'm assuming this is the one that shows how much is being sold on the bid and how much is bought on the offer?
 

Asimpleman

New member
@horserider -Thank you for this. I'm a little lost in all this code to isolate it out on my own. I'm wondering if there is a way scan for stocks that are hitting over the average line. Basically, I'm looking for a scan to a watch list that will show me stocks that are painting those triangles on the 5 min throughout the day. Would you help me develop that?
 

Bugs_Munny

New member
I am looking for a script that show volume on the buy and sell side as well as percentages. Can anyone point me in the right direction?

unknown.png
 

Similar threads

Top