NexusFi: Find Your Edge


Home Menu

 





Buying/Selling Pressure...


Discussion in ThinkOrSwim

Updated
    1. trending_up 12,998 views
    2. thumb_up 6 thanks given
    3. group 7 followers
    1. forum 24 posts
    2. attach_file 0 attachments




 
Search this Thread

Buying/Selling Pressure...

  #1 (permalink)
netarchitech
NY, NY
 
Posts: 68 since Dec 2011
Thanks Given: 27
Thanks Received: 19

Hi All,

I'm trying to incorporate a meaningful, yet simple Volume analysis into my setup, if possible. As a result, I came across the following indicator.
 
Code
input period = AggregationPeriod.HOUR;

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 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 SV = -V * (H - C) / (H - L);
def BV = V1 * (C1 - L1) / (H1 - L1);


AddLabel(yes, "Buy ", if BV > SV then Color.GREEN else color.GRAY);

AddLabel(yes, "Sell", if SV > BV then Color.RED else color.GRAY);

I've been playing around with it on various charts, however, no matter what chart/time frame I select, the indicator shows a green signal for buying pressure and a gray signal for selling pressure...

Any thoughts/ideas? Thanks in advance

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Cheap historycal L1 data for stocks
Stocks and ETFs
ZombieSqueeze
Platforms and Indicators
REcommedations for programming help
Sierra Chart
MC PL editor upgrade
MultiCharts
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
  #2 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,534 since Aug 2011
Thanks Given: 2,069
Thanks Received: 9,556

Are you trying to change the color? You don't like grey for sell?

Or are you saying that a continuous signal is displayed that does not make sense?

Also, a picture of the chart would also be very helpful.

Dan

Visit my NexusFi Trade Journal Reply With Quote
  #3 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,534 since Aug 2011
Thanks Given: 2,069
Thanks Received: 9,556


this might be the second coding question that I have EVER been able to help with.

I'd be interested to know what you are trying to do with the volume indicator and how it fits into a series or confluence.

Dan

Visit my NexusFi Trade Journal Reply With Quote
  #4 (permalink)
netarchitech
NY, NY
 
Posts: 68 since Dec 2011
Thanks Given: 27
Thanks Received: 19


wldman View Post
this might be the second coding question that I have EVER been able to help with.

I'd be interested to know what you are trying to do with the volume indicator and how it fits into a series or confluence.

Dan

wldman,

Thanks for your posts. Since price and volume are the only leading indicators (maybe valid divergence is one more), I'm trying to get a sense of what the underlying sentiment is with a given stock/etf...

Hope this clarifies things a bit...

Regards,

netarchitech

Reply With Quote
Thanked by:
  #5 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,534 since Aug 2011
Thanks Given: 2,069
Thanks Received: 9,556

and I have connection issues.

I do not know what that indicator is supposed to show. Can you post a picture?

Is your issue the color change of something else?

Google Klinger Volume Oscilator. The study is on ToS and I believe in the further info section a link to a magazine article from 2008 explaining the idea.

IMO the KVO is the best and most effective way to spot selling volume and buying volume through what he calls volume force. Divergences of KVO and price are almost trade able stand alone.

I will post again when my connection is working.

Dan

Visit my NexusFi Trade Journal Reply With Quote
  #6 (permalink)
netarchitech
NY, NY
 
Posts: 68 since Dec 2011
Thanks Given: 27
Thanks Received: 19


wldman View Post
and I have connection issues.

I do not know what that indicator is supposed to show. Can you post a picture?

Is your issue the color change of something else?

Google Klinger Volume Oscilator. The study is on ToS and I believe in the further info section a link to a magazine article from 2008 explaining the idea.

IMO the KVO is the best and most effective way to spot selling volume and buying volume through what he calls volume force. Divergences of KVO and price are almost trade able stand alone.

I will post again when my connection is working.

Dan

Hi Dan,

Thanks for following up and pointing out the Klinger Volume Oscillator. It looks promising

Below is what I'm looking at...no matter what timeframe or security it's the same



Sorry to hear about your connection...

Thanks again for your time and assistance. It is greatly appreciated!

Matt

Reply With Quote
  #7 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,534 since Aug 2011
Thanks Given: 2,069
Thanks Received: 9,556

Late start for me today so I am behind. I will look forward to hashing this out with you after the desk is clear...I should say clearer.

We can take a look at that piece of code and figure out what the calculation is, determine if that calc is valuable, and then see if we can get it to display as you'd like.

Have you tried the thinkScript lounge on ToS. If you show that you are trying and bend the knee those guys will help you. I don't go there much cause I don't bend the knee...lol

I will also show how I use the KVO and see if I can find the article that inspired my use. I do believe that your piece of code might be buy/sell buttons based on that original script.

Dan

Visit my NexusFi Trade Journal Reply With Quote
  #8 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,534 since Aug 2011
Thanks Given: 2,069
Thanks Received: 9,556

I think there is a problem with the math:

def SV = -V * (H - C) / (H - L);
def BV = V1 * (C1 - L1) / (H1 - L1);

On the face of it why is sell volume and buy volume calculated using different formulas, not values but a different calc?

I think what you or what anyone looking at volume would want to see is show me accumulation (buying) and show me distribution (selling). What reliable mantra can we accept as a given to build that notion on (acc/dist).

Based on what we know about structure and price action I think this is fair:

where the H+L+C > H1+L1+C1 accumulation has occurred and we assign a positive value of 1. The code above is looking at current bar for SV and one bar ago for BV and it is doing so by looking at different values, using a different metric. Is it possible that someone is jacking with you?

So, H+L+C < H1+L1=C1 would represent distribution. We assign that a value of negative 1. The only difference in the calc is the < instead of >. Uniformity of the construct is essential.

This determines the periodic measurement, be that daily, hourly, three minute...what ever period you are looking at. Now what you need is a cumulative measurement of the periodic measurements. This is usually done via moving average.

So from here a lot should be coming into focus. If we use volume in a specific period (bar) and compare it to recent history you can see the force of recent buying and selling. How does that look versus the last X number of periods?



So it would seem (correct me if Im wrong) that the thing you were asking about would show something similar to the color change of the signal line (smoother one) above or the requirement that both lines be the same or when trigger crosses signal or whatever?

I'll copy and paste on my journal page. We might get more or different traffic there.

Dan

Visit my NexusFi Trade Journal Reply With Quote
  #9 (permalink)
netarchitech
NY, NY
 
Posts: 68 since Dec 2011
Thanks Given: 27
Thanks Received: 19


wldman View Post
Late start for me today so I am behind. I will look forward to hashing this out with you after the desk is clear...I should say clearer.

We can take a look at that piece of code and figure out what the calculation is, determine if that calc is valuable, and then see if we can get it to display as you'd like.

Have you tried the thinkScript lounge on ToS. If you show that you are trying and bend the knee those guys will help you. I don't go there much cause I don't bend the knee...lol

I will also show how I use the KVO and see if I can find the article that inspired my use. I do believe that your piece of code might be buy/sell buttons based on that original script.

Dan

Thanks, Dan... I really appreciate your insights, time and assistance The screenshot you provided really helped to illustrate the divergence capabilities of the KVO. The colorization of the KVO looks like it doesn't necessarily provide actionable information though. I guess that's why I was looking to just implement the two "buttons" in the upper left corner of the chart, as I illustrated with the screenshot from my last post.

Just wondering about the "distribution" code...should this:
 
Code
H+L+C < H1+L1 = C1
be this:
 
Code
H+L+C < H1+L1 + C1

Thanks also for the pointer to the thinkscript lounge. I'll definitely check it out. With that said, I also don't "bend the knee"...hahaha

One last thing...could you provide the URL to your journal or is it for Elites only? I would enjoy the chance to read it, if possible...

Have a great day!

Matt

Reply With Quote
  #10 (permalink)
 
wldman's Avatar
 wldman 
Chicago Illinois USA
Legendary Market Wizard
 
Experience: Advanced
Broker: IB, ToS
Trading: /ES, US Equities/Options
Frequency: Several times daily
Duration: Hours
Posts: 3,534 since Aug 2011
Thanks Given: 2,069
Thanks Received: 9,556


are elite.



No, that is not what I am saying. I am saying that the code snippet that you posted does not make any sense to me. The context that I have from you is still unclear. The tiny little pic does not describe what you are trying to look at.

I digress when I assume that your ideas about volume are consistent with mine...or even valid at all. Buy when volume is taking offers in other words buy when buying is the way and the opposite are not things that require an indicator.

Yes that is a typo, the + sign in the bottom statement is correct. The equals is a typo.

The mystery is why in the element you ask about that the calc is different for + and -. You can use a derivative for the calc depending on what you want to view specifically, but to use different calc methods in the same statement does not work.

I was asking about that in case you knew the reason (I do not) or to prompt you to do the math/code work, rather than me to divide the day to figure out the why of that snippet of code.

I'm still unsure of what you are looking at or for and I'm not sure anymore that you know. When I ask you to describe it or show it, you seem reluctant. Is this a secret or are you not sure? Either is fine. I'm just looking for the info that I would need to help or to point you to someone on FIO that might know and care.

Go through the code snippet and determine what that equation is showing. Is that what you want to show? Why? Or, if not, what is it that you want to show? Why? This is how to diagram a view that can be specified to someone (not named Dan) that knows how to code.

I do not mean to go wldman on you but I won't use my understanding of what you are looking for, because I think mine is better. So I'm asking you to take a look and then say wait...mine does this calc and it is important because it shows this. If I do that work I might solve a problem with how something displays but I dont help you. Its a right path wrong mountain kind of thing.

Take a look at the full chart that I shared and the brief notes. Those explain and invite questions. Those tiny little buttons in the fractional chart that you showed dont do anything for the viewer because they still have to guess at context and method. I don't mean to be terse, but I keep asking what this is and how you consider it and you bid me back rather than answer. My time is extremely valuable. I'm trying to help/share because others have done so with me. Past that I would perfect my application of a volume/price indicator based on accumulated knowledge of others. Peace man.

Dan

Visit my NexusFi Trade Journal Reply With Quote
Thanked by:




Last Updated on February 17, 2018


© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts