Login Page - Create Account

Support Board


Date/Time: Fri, 02 May 2025 02:20:20 +0000



Create Ratio

View Count: 148

[2025-02-14 17:36:45]
Zazzgram91 - Posts: 5
Hi,

I need to create a simple ratio

for bearish candles the calculation is as follows starting from the top of the candle: second value ask column divided by first value of the same column

For bullish candlestick the calculation is as follows: starting from the bottom the penultimate bid column value divided last bid column value

I have followed the guides on the site but I cannot, which studies should I use?

I attach photo of what I would like to get
image1.jpg / V - Attached On 2025-02-14 17:36:09 UTC - Size: 254.67 KB - 37 views
image2.jpg / V - Attached On 2025-02-14 17:36:17 UTC - Size: 263.43 KB - 32 views
[2025-02-14 19:05:56]
John - SC Support - Posts: 39605
In general, the Volume At Price data is not directly accessible in studies. But, it can be referenced in the Alert Conditions, refer to the following:
Study/Chart Alerts And Scanning: Special Functions

And, since the "Spreadsheet Formula" study uses the Alert Syntax (despite its name) you can use this study to get access to the data. Refer to the following:
Spreadsheet Formula

Therefore, to do what you want, you would do the following:
- Add the Spreadsheet Formula study to the chart.
- Enter the following for the Formula Input of the Spreadsheet Formula:
=IF(C > O, AVAP(H - TICKSIZE, 0) / AVAP(H, 0), BVAP(L + TICKSIZE, 0) / BVAP(L, 0))

This assumes you just want the one value depending on whether the bar is Bearish or Bullish.

Also refer to the following:
Study/Chart Alerts And Scanning: Available Main Price Graph Identifiers/Variables
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-02-14 19:35:45]
Zazzgram91 - Posts: 5
Thank you john but i can not find the option to display the numbers below or above the candles
[2025-02-14 19:54:09]
John - SC Support - Posts: 39605
To display the result, you would use the "Study Subgraph Above/Below Bar As Text". Refer to the following:
Study Subgraph Above/Below Bar as Text

If you are wanting to display the Ask ratio above the bar and the Bid ratio below the bar, then you should use two copies of the "Spreadsheet Formula", one for the Bearish situation and one for the Bullish. This way you can also use two copies of the "Study Subgraph Above/Below Bar as Text" to place those values where you want them.

We leave it to you to work out the formulas for each situation, which should not be difficult give what we have already given you. Note that a value of 0 typically means to not draw something, so anywhere you do not want a value, you would have a result of zero.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2025-02-14 22:10:39]
Zazzgram91 - Posts: 5
Hi John, we are near to the solution, last step needed

I copy and paste your formula and this is what I see (I've uploaded screen from Sierra)

As concrete example: green candle at the center with 8.60 should displayed (23/7)=3,28 and red candle with 4.09 should display (29/6)=4,83

How can I fix the formula to obtain this?

https://www.sierrachart.com/image.php?Image=1739570886534.png


Thank you
[2025-02-14 22:49:30]
John - SC Support - Posts: 39605
Sorry - yes, we reversed the Bear and Bull candles. The formula should be the following:
=IF(C > O, BVAP(L + TICKSIZE, 0) / BVAP(L, 0), AVAP(H - TICKSIZE, 0) / AVAP(H, 0))
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