Login Page - Create Account

Support Board


Date/Time: Fri, 18 Apr 2025 06:47:27 +0000



Calculating a different VOLD ratio

View Count: 774

[2024-04-08 17:53:31]
rkg - Posts: 12
I want to calculate the NYSE volume up to volume down and plot it as a ratio that can be positive or negative.

If buy volume = 10, sell volume = 5, I would like to see a ratio of 2

If buy volume = 5, sell volume = 10, I would like to see a ratio of -2

UDVR-NYSE calculation only fits the criteria when buy volume > sell volume as UDVR will never be negative.


Any suggestions on how I can make this work? I have tried messing around with UVOL / DVOL and the ratio study but I cannot figure out a solution.
[2024-04-08 19:11:46]
John - SC Support - Posts: 39353
You could use the "Spreadsheet Formula - Bar" to create bars that are the way you want, you would just have to decide on which item (Open/High/Low/Close) you would actually make the switch. For example, to change the bar High when the Close is less than 1, you would have the following formula:
=IF(C < 1, -1/H, H)

You can work out the rest from this.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-03-27 02:14:24]
ameetmedi - Posts: 34
John I wanted to reply on this thread as I have been trying to get the uVOL/dVOL ratio working so I can create the ratio and then use the one of the other studies you have referenced on another thread to color based on +/-.

Using this above SpreadSheet Formula Bar, it only seems to be work on the main graph and not on a ratio created by the Study Subgraph Divide/Ratio.

So far I have been able to chart the NVOL, add additional symbols for UVOL, DVOL and then use the Subgraph Divide.Ration study to get the UVOL/DVOL.

I tried using the SpreadSheet Formula Bar to use the above study for the Ratio but not able to get it to work.

Can you please advise on how I can get this to work so I get an inverse of the number provided by the divide/ration study and convert .578 to -1.73 and then using the study Subgraph Reference to color it based on +/-


Thanks. BTW if anyone else has a study already to get the NYSE/NASDAQ/RUSSELL Ratio, please point me to it as well.
[2025-03-27 08:18:46]
Sierra_Chart Engineering - Posts: 19259
For the up volume/down volume ratio, use the symbol:
UDVR-NYSE

Refer to:
Sierra Chart Market Statistics
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2025-03-27 08:19:45
[2025-03-27 11:45:24]
ameetmedi - Posts: 34
Isn’t that 24h volume ? And not the same as Uvol during trading session ?
[2025-03-27 14:02:21]
Sierra_Chart Engineering - Posts: 19259
Yes the up down volume ratio does use 24 hour volume.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-03-27 14:19:27]
ameetmedi - Posts: 34
So then I'm better off doing a ratio (bar) of the UVOL and DVOL and then need a solution on how to convert into a true ratio?
[2025-03-27 15:08:23]
John - SC Support - Posts: 39353
There are any number of ways to calculate the ratio, with the "Ratio - Bar" study being one of them.

What do you mean by "then need a solution on how to convert into a true ratio"?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-03-27 15:14:52]
ameetmedi - Posts: 34
SO using the Ratio-Bar or the Spreadsheet Formula Bar I'm able to get uVol/Dvol. What I'm looking to get if its its below 0, convert .827 (Uvol/Dvol) to -1.20 and then I I guess I would be able to use the Study Subgraph Reference so color based on + or -ve value to display the text on the chart

I want to be able to add Market Breadth Text on my chart for NYSE and NASDAQ color coded as -1.20:1 NYSE or 2.48:1 NASDAQ

I know you had some other threads where you mentioned it but I was not able to get the study you mentioned Spreadsheet bar and use formula = If(C < 0, -1/C, C) to work. I was able to get it to work in the UDVR-NYSE but that's 24 hours volume
[2025-03-27 16:02:07]
John - SC Support - Posts: 39353
Do you mean if the value is below 1 (you state "below 0") then you want to invert and multiply by -1?

And are you just wanting to do this on the Close of the bars?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-03-27 16:11:40]
ameetmedi - Posts: 34
Yes, sorry below 1. I'm not 100% sure if I just need closing calculation, maybe you can point me to it. Attached is my screen shot from the Ratio I have calculated. I have the main Symbol as NVOL-NYSE. I also have added additional symbols UVOL and DVOL. and added Subgraph ratio/divide study. As you can see the volume is -ve and ratio is below 1. Taking inverse of this would be yield the -1.58. I'm trying to get to a point where I can either See the this value 1.58 in a Red Box showing -ve volume or a Green box value for a +ve volume.

as I mentioned I have tried using studies you mentioned on another thread where the chart was UDVR-NYSE and it worked fine but I haven't been able to reproduce it when using a study
Date Time Of Last Edit: 2025-03-27 16:13:44
imageScreenshot 2025-03-27 at 11.06.56 AM.png / V - Attached On 2025-03-27 16:11:32 UTC - Size: 574.31 KB - 10 views
[2025-03-27 16:45:28]
John - SC Support - Posts: 39353
We see you used the "Study Subgraphs Divide/Ratio", so that gives you a single value. In this case, to change that value to the negative inverse when it is below zero, use the "Spreadsheet Formula" study and enter the following formula:
=IF(ID1.SG1 < 1.0, -1/ID1.SG1, ID1.SG1)

Where ID1 is the ID of the Study Subgraphs Divide/Ratio study and SG1 is the Ratio Subgraph of the Study Subgraphs Divide study.

There is not a way to display a large text item that is colored red for negative and green for positive, as the "Text Display for Study" uses a drawing tool in the end to draw the information to the screen and this does not have the ability to select colors based on value. You can modify the study itself to get what you want if you are comfortable with this. Refer to the following:
Text Display For Study

How to Build an Advanced Custom Study from Source Code

https://www.sierrachart.com/index.php?page=doc/SierraChartStudyAndSystemProgrammers.php
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-03-27 17:00:03]
ameetmedi - Posts: 34
Thanks so much. That gets me where I'm able to use the Spreadsheet formula to display the value in the +/- Auto coloring and serves my purpose for a glance view.

I'll review the customizing the study for future use.

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account