Volume Buy Sell Indicator with Hot Percent for ThinkorSwim

MerryDay

Administrative
Staff member
Staff
VIP
@ChristianS @iselloptions
Sorry, I am not sure what you are asking. But perhaps post#3 will help
Buy / Sell Volume Pressure w/ volumes and percentages
b1.png
 
Last edited:

renydiver

New member
Hello guys,

I am looking for some help with the code on this volume indicator, it works alright on time charts but I haven't been able to make it work on a range chart. If anybody have an idea on how to make it work on a range chart please help.
Ruby:
declare lower;

input period = AggregationPeriod.DAY;
input lengthB = 9;
input lengthS = 9;
input averageType = AverageType.EXPONENTIAL;

# Buying Volume

def O1 = open(period = period);
def H1 = high(period = period);
def C1 = close(period = period);
def L1 = low(period = period);
def V1 = volume(period = period);
def BV = V1 * ((C1 - L1) / (H1 - L1));
def Buy = MovingAverage (averageType, BV,lengthB);
plot BuyVol = ExpAverage (Buy, LengthB);

# Selling Volume

def O = open(period = period);
def H = high(period = period);
def C = close(period = period);
def L = low(period = period);
def V = volume(period = period);
def SV = -V * ((H - C) / (H - L));
def Sell = MovingAverage (averageType, -SV, lengthS);
plot SellVol = ExpAverage (Sell, LengthS);

# Signal

input showBreakoutSignals = no;

plot UpSignal = BuyVol+1 crosses above SellVol;
plot DownSignal = BuyVol-1 crosses below SellVol;

UpSignal.SetHiding(!showBreakoutSignals);
DownSignal.SetHiding(!showBreakoutSignals);

UpSignal.SetDefaultColor(Color.UPTICK);
UpSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
DownSignal.SetDefaultColor(Color.DOWNTICK);
DownSignal.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
 
Last edited by a moderator:

rad14733

Well-known member
VIP
@renydiver The issue is that Range Charts don't support Secondary Aggregations... The reason being that Range Bars are not based on time but, rather, price movement, just as tick based charts rely on trade transaction counts... There is no remedy for this inherent constraint...
 

rlohmeyer

Active member
I was looking at volume indicators and came across this thread. Made a closeup comparison of the Volume indicator in post #1 and the @horserider Volume Indicator referred to with a link in post #4. I pared down both indicators to show just the histograms and a 390 minute simple moving average on a 1 minute chart so you are comparing apples to apples. The @horserider Volume Indicator is clearly superior in seeing the variance of Total Volume relative to Moving Average. This is a function of the fact that in thinkscript coding you are not able to stack values in a histogram as you could in Excel or Google sheets. This is information you want to have to evaluate accurately. Image below. @horserider volume indicator is the one below the Enhanced Volume indicator from post #1.


mLnmPUC.jpg
 
this question is pertaining to the last big volume bar in the picture.

i just found the volume buy sell pressure indicator today but i am having trouble discerning why the volume bar color is different from the stock thinkorswim volume bar color? if the stock thinkorswim volume bar is RED, that means there was more sellers than buyers right? but the volume-buy-sell-pressure indicator is showing that the seller is only a small portion of the volume. can someone please help me out? thanks

GaPbre7


 
Last edited:

Similar threads

Top