Support Board
Date/Time: Tue, 22 Apr 2025 11:46:39 +0000
[User Discussion] - bid ask ratio
View Count: 316
[2025-01-21 21:33:19] |
SafSaf - Posts: 126 |
i'm trying to achieve a volume cross... The CQG have a study called 'Bid/Ask Volume Cross' study displaying two lines (attached screenshot (the study below the price chart)). The green line is a five-bar running sum of the ask volume, which represent buying. The red line is a five-bar running sum of the bid volume, which represent selling. The Bid/Ask Volume Cross Oscillator is simply the difference between the green and red lines. it's important i am able to change the bar period. how can i achieve this on sierra please? ref: https://news.cqg.com/workspaces/2016/03/cqg-bidask-volume-oscillators |
![]() |
[2025-01-21 23:36:25] |
Sawtooth - Posts: 4209 |
how can i achieve this on sierra please?
Try this:For the BAVolCr: 1. Add the Spreadsheet Formula study, and use this formula in its Formula field: =SUM(AV[0:-5]) - On the Subgraphs tab, set the Line color to Green. 2. Duplicate the above Spreadsheet Formula study, and use this formula in its Formula field: =SUM(BV[0:-5]) - On the Subgraphs tab, set the Line color to Red. For the BAVolCrOsc: 3. Add another Spreadsheet Formula study, and use a formula like this in its Formula field: =ID6.SG1-ID7.SG1 where ID6 is the first Spreadsheet Formula study, and ID7 is the second Spreadsheet Formula study. Edit as needed to match yours. - On the Subgraphs tab, set the Draw Style to Bar, and the Width/Size to your requirements. - Optional: Set the Auto-Coloring to Based On +/- and choose two colors. Study/Chart Alerts And Scanning: Available Main Price Graph Identifiers/Variables Study/Chart Alerts And Scanning: Referencing A Range of Data Date Time Of Last Edit: 2025-01-21 23:39:08
|
[2025-01-22 08:10:07] |
SafSaf - Posts: 126 |
thanks mate, i'll give this a go and see what happens!
|
[2025-01-22 10:07:35] |
SafSaf - Posts: 126 |
i'm not sure that's worked for me. see screen shot. what i'm looking for is as per study in second screen shot.
|
![]() ![]() |
[2025-01-22 14:18:50] |
Sawtooth - Posts: 4209 |
what i'm looking for is as per study in second screen shot.
The BAVolCrOsc goes in its own Chart RegionSee attached screenshot of what it looks like for me. |
![]() |
[2025-01-22 14:33:56] |
SafSaf - Posts: 126 |
i'm an idiot. this is what mine looks like with those settings...
|
![]() ![]() ![]() |
[2025-01-22 14:34:22] |
SafSaf - Posts: 126 |
last screen shot of settings
|
![]() |
[2025-01-22 16:08:21] |
cmet - Posts: 690 |
Here's both studies. Compile the .cpp files in Custom Studies. BidAskX = Crossover BidAskO = Oscillator Can modify Rolling Period. |
![]() ![]() ![]() |
[2025-01-22 16:49:54] |
SafSaf - Posts: 126 |
thank you. done exactly as you've instructed and here's a screenshot of what my screen looks like. where am i going wrong?
|
![]() |
[2025-01-22 17:01:16] |
SafSaf - Posts: 126 |
and this is what is looks like when i base the cross over study on the oscillator and screen shot of the settings too...
|
![]() ![]() ![]() |
[2025-01-22 17:41:15] |
cmet - Posts: 690 |
These are just based on the original formulas. The crossover is converging because you are aggregating a sum over a long time frame. Plot using a 10,000 volume or faster chart. Would likely need to normalize to prevent convergence. Original Formulas: The Cross study displays two lines: the rolling 5-bar sum of traded volume at the ask price (buying) and rolling 5-bar sum of traded volume into the bid (selling). The Oscillator study displays the difference between two lines of the Bid Ask Volume Cross. Date Time Of Last Edit: 2025-01-22 17:42:34
|
[2025-01-22 18:23:28] |
SafSaf - Posts: 126 |
what do you mean by normalize? i'm using time based charts
|
[2025-01-22 18:35:09] |
cmet - Posts: 690 |
Normalize it against total volume. Could probably reset after the each rolling period too. Otherwise, with rolling sum, you're going to get that type of plot on longer time frames/slower charts. Since the Oscillator uses difference, you don't have this problem. Do you have an example from CQG showing the crossover plotted on time based bars? Pretty sure they use a 5 tick chart in their examples for a reason. (Using Bid/Ask in this way over long periods has no value if you want my 2 cents). Date Time Of Last Edit: 2025-01-22 18:36:58
|
To post a message in this thread, you need to log in with your Sierra Chart account: