Login Page - Create Account

Support Board


Date/Time: Sat, 23 Nov 2024 17:29:39 +0000



Sum Number Bars volume horizontally at price

View Count: 155

[2024-08-07 10:29:39]
User480109 - Posts: 36
Please refer to the attached pic, how can one sum up the volume at price for Number Bars for x number of periods? So for example, at the price of -19.50, how can one get look back to 5 volume bars with volume of 1194, 9200, 67, 22, and 2109 summed up all for the price at -19.50?
imageSC_sumExample.JPG / V - Attached On 2024-08-07 10:29:32 UTC - Size: 56.8 KB - 44 views
[2024-08-07 15:28:17]
John - SC Support - Posts: 36238
You need to use the "Spreadsheet Formula" study along with the VAP() function for Alerts. Despite its name, the Spreadsheet Formula uses the Alert syntax. Refer to the following:
Spreadsheet Formula

Study/Chart Alerts And Scanning: Special Functions

Therefore, to sum the last 2 total volumes for the price of -19.50, your formula would be the following:
=VAP(-19.50, 0) + VAP(-19.50, -1)

We'll let you work out the full formula for 5 bars.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-08-07 16:31:04]
User480109 - Posts: 36
John, for the VAP() function, is there syntax where it can reference last traded price or current price + / - 2 prices or does it need specific price input
[2024-08-07 16:40:58]
John - SC Support - Posts: 36238
You can use any of the Alert options that reference to a price point and nest them. So for instance, to get the volume at the Last traded price of the current bar, you can enter the following formula in your Spreadsheet Formula study:
=VAP(C, 0)

Where C is the Close (last).

If you want to offset from that value, then you can use the "TICKSIZE" variable with this. For example, if you want the Total Volume at two ticks above the Last price of the current bar, the formula would be the following:
=VAP(C + 2 * TICKSIZE, 0)
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-08-07 16:47:04]
User480109 - Posts: 36
got it, thanks for that. Follow up question: in addition to the total volume, is there a call to get separate crossing buy or crossing sell volume in the same way?
[2024-08-07 19:57:16]
John - SC Support - Posts: 36238
You can only get the "Bid" and "Ask" volumes individually, as is done with the VAP, by using AVAP and BVAP. Refer to the following:
Study/Chart Alerts And Scanning: Special Functions

You can then manipulate that data as you want.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2024-08-09 14:20:22]
User480109 - Posts: 36
hey John- are there any other functions one can use for the formula like above? Is there documentation for all available functions to explore?
[2024-08-09 15:10:34]
John - SC Support - Posts: 36238
The Alert functions are all listed at the following:
Study/Chart Alerts And Scanning: Alert Condition Formula Format

Some of the Spreadsheet Functions also work with Alerts. The full list of spreadsheet functions is here:
Spreadsheet Functions

As to which work and which do not, you would just need to try. But the most obvious items like AND, OR, CROSSOVER, CROSSFROMBELOW, etc. will work. Items that are very spreadsheet oriented, will not - such as ADDRESS, and CELL.

We know we should mark the functions that work in both, but it takes time to get to everything and this is just one of those things that we have not had time to get to.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

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

Login

Login Page - Create Account