Volume Buy Sell Pressure with Hot Percent for ThinkorSwim

@BenTen (or whoever can help me ) , can you help me by making a small modification to the script?

I'm trying to get it to show me the histogram as follows: https://ibb.co/qyBLsHb
(i cant insert images, i got this: "Something went grong. Please try again or contact the administrator.")


The logic would be:

If the current candle is larger than the previous one and "Buying" volume (according to the code published in this post) is greater than 60% of the total volume, then paint the candle green, otherwise it's gray.

The same for the Red candle.
If the current candle is Larger than the previous one and "Selling" volume (according to the code published in this post) is greater than 60% of the total volume, then paint the candle red, otherwise it's grey.

Thanks you!
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

@Regalo First understand in the study posted at top of the thread what is being defined as "Buying" volume. It is also plotting volume twice.
 
Great indicator. But what I don't like is that gray bar as the total volume for each bar. It is a bit confusing. Why is that necessary? Why not using only a red and green bar?
 

Hi horserider, I tried out this volume indicator and I like it. I'm new to ToS with no programming background and I'm trying to understand how this study is approximating Sell vs. Buy volume.

Looking at the pertinent thinkscript in the study:

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

It appears buying and selling volume is being approximated by taking the true candle volume and applying a ratio so that a close far removed from the low would equate to "strong buying" and conversely a close far removed from the high would equate to "strong selling".

The thing I don't understand is how the volume bar updates in real time as I'm using the study since a "C=close" is required in the formula? As trades keep coming in during say a 2 minute candle interval, does ToS keep dynamically updating the "C=close" value so that's why I see the volume bar updating the green and red portions in real time?

Also, I like to try to see as much information in the smallest amount of space so I swapped the "declare lower;" with "declare on_volume;" so that I could get this study showing in the chart window via the "Overlap volume" chart setting.

With "overlap volume", the normal/native ToS volume bars show behind the chart. However, with this study added, the volume bars are displaying in front of the chart. I tried to tinker with "input opacity = 50; " to see if I could get the volume bars to fade but that did not do anything. Would you happen to know if there is a way to enforce an opacity on the volume bars and/or make the volume bars display behind the candlestick chart?

I am thinking that if I apply a factor to the buying and selling plots (ie. Plot BuyVol = 0.4*buying; ), and have the ability to put the volume behind the candlestick chart or use an opacity, I could use this study quite well in the chart window via overlap volume. Thanks so Much --- Corpus.
 
I have a slight issue with this indicator, which is otherwise great. Basically this indicator overlaps the standard volume indicator. For some reason it seems to have an offset where the custom indicator starts at 25 instead of zero, so you see a little bit of the standard volume indicator below/behind it. How can I fix this?

Screen-Shot-2020-03-10-at-11-15-46-PM.png
 
@spm009 Drag the custom indicator to the lower study section. Don’t overlap them. If you need to remove the default volume section, then go to Settings > Equities > Disable Volume.
 
I have been thinking about an idea for a script that uses the methodology from the study in this thread, namely the analysis of buying vs. selling volume but instead analyzing each bar, i am interested to know if there is a way to analyze the whole trading day (intraday) and display this buying vs selling ratio in % as a chart label?

Basically, i want to know how much was bought vs sold of the total intraday volume and if the buying was above 50%, the label should be colored green and vice versa, if the selling volume was above 50%, then color the label red.

I would also be very interested to have a label showing this volume data for the last hour.

Do you think this would be possible to build? @horserider
 
@zeek It already shows volume for the day and what % that is of the 30 day average. It shows volume for last 30 bars so use a 2 min chart and that should be volume for last hour. Maybe that helps with some of what you want. Not sure.
What you want is most likely possible. I have no interest in it, sorry.
 
overlap.png

Hi guys. Is there any code to show the indicator behind the candlestick?
Reason for this is because I have only 2 small monitors to display few charts together.
Trying to google thinkscript but cant find any related solution.
 
@zeek That would be very very interesting, esp if that can be sorted out on hourly or 30m. How many shares were sold & bought & what % were offers/bids.

green label with white fonts: 51% vol 826392 1h -if offers executed 51% out of x amount of offers in 30m or 60m, # of shares, time range.
red label red white fonts: 51% vol 857331 1h - if bids executed 51% out of x amount of bids in 30m or 60m, # of shares. time range.

Something along these lines, I guess..I'm no coder..but I think I like the thought process behind it..
 
overlap.png

Hi guys. Is there any code to show the indicator behind the candlestick?
Reason for this is because I have only 2 small monitors to display few charts together.
Trying to google thinkscript but cant find any related solution.
On menu where you add the indicators, just click and drag it from the volume row up to the chart area. Scaling it to not overlap the the prices may be a problem though. Not looking at it atm
 
HI..I am a newbie here and am trying to learn how I can incorporate this study. Is there a place where I can find an explanation of how this study works and how to use it?
 
@abhibach All in post #1
# Show total volume in gray. Buying volume in green. Sell Volume in red.
# Volume average is gray line.
# Specified percent over average volume is cyan triangles.
 
@horserider Is there a section of the script that would just show grey volume line from the original script, I want to try to use grey line on regular chart with "volume overlap", please advise, thanks
 
Last edited:
Not sure what you were seeking. Total volume histogram is first code and volume average the second.

# Total Volume
plot TV = volume;

TV.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
TV.SetDefaultColor(Color.GRAY);
TV.SetLineWeight(1);


or
# Volume average

input length = 20;
plot VolAvg = Average(volume, length);

VolAvg.SetDefaultColor(GetColor(7));
 
@horserider - The volume label works great during regular hours (I am using labels alone and not the volume bars), is there a way to have volume label for pre-market as well? Thanks in advance
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
479 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top