Login Page - Create Account

Support Board


Date/Time: Tue, 04 Mar 2025 09:09:43 +0000



Is there a way to access Number Bars Calc Values:SG30 (Bar Duration)

View Count: 735

[2021-11-30 19:32:44]
User277997 - Posts: 22
I'm trying to pull down the bar duration (SG30) on a range chart into a spreadsheet formula Study. Is there a trick to getting the time values to be accessible ? Thanks.
Date Time Of Last Edit: 2021-11-30 19:33:23
[2021-11-30 21:09:40]
Sawtooth - Posts: 4179
Try this in the Spreadsheet Formula study's Formula field:
=ID1.SG30*1440
where ID1 is the Numbers Bars Calculated Values study.
This will return the bar duration in minutes.

This will return the bar duration in seconds:
=ID1.SG30*86400

SG30 of that study outputs the bar duration in a decimal portion of one day.
There are 1440 minutes in one day.
There are 86400 seconds in one day.

Spreadsheet Example Formulas and Usage: Using Date Time
Date Time Of Last Edit: 2021-12-01 15:53:37
[2021-11-30 21:48:19]
John - SC Support - Posts: 38341
In order to do what tomgilb suggests above, you first need to change the Input for the Numbers Bars Calculated Values study for Use Default Number Formatting for All Subgraphs to Yes. Refer to the following:
Numbers Bars: Numbers Bars Calculated Values Input Descriptions

Then you will need to change the Value Format for the Numbers Bars Calculated Values Study to the maximum precision (0.00000001). Refer to the following:
Chart Studies: Settings and Inputs Tab >> Value Format

You will then be able to actually access the numbers as Serial Date/Time values.

We have also updated the documentation for this here:
Numbers Bars: Referencing Numbers Bars Calculated Values Subgraphs in Alert Formulas
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: 2021-11-30 21:58:00
[2021-11-30 22:37:32]
User277997 - Posts: 22
Default number formatting for all subgraphs in Numbers Bars Calculated Values Study = yes (check)
value format for nNumbers Bars Calculated Values Study = 0.00000001 (check)
spreadsheet formula =ID#.SG30*86400 (check)
Value Format for the spreadsheet formula is 0.00000001
Result subgraph in the spreadsheet includes "value label" box checked.
Gives me a NaN value for the region and no result line. Spreadsheet formula is the only study in the region.

Market's closed now...is there something about this study setup that only prints in real time as data flows in ?

I'm obviously missing something....any ideas ?
[2021-11-30 23:33:19]
John - SC Support - Posts: 38341
What kind of chart are you using this on? and what is the typical duration of a bar?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-12-01 00:08:19]
User277997 - Posts: 22
I'm using it on a 1.25tick range bar on ES. I get a bar duration in the numbers chart under each bar.
[2021-12-01 15:50:26]
John - SC Support - Posts: 38341
It looks like the time is just too small to use the method we gave you. Rather, enter the following formula in your Spreadsheet Formula study to get the bar duration in seconds(and you can get rid of the Numbers Bars Calculated Values, unless you want to the see the information in there as well):
=FRACTIME(BARDATETIME - BARENDDATETIME) * 86400
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-12-01 18:33:17]
User277997 - Posts: 22
cut and past that formula and still get an NaN value with no line. Any other ideas ?
[2021-12-01 19:21:31]
John - SC Support - Posts: 38341
We just tried it and it worked fine. You are entering it on the Formula Input for the Spreadsheet Formula, correct?
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-12-01 20:33:06]
User277997 - Posts: 22
Correct. Here's the study settings window and the chart settings window.
imageScreenshot 2021-12-01 152917.png / V - Attached On 2021-12-01 20:32:23 UTC - Size: 68.51 KB - 141 views
imageScreenshot 2021-12-01 152946.png / V - Attached On 2021-12-01 20:32:31 UTC - Size: 108.04 KB - 136 views
[2021-12-01 22:05:38]
John - SC Support - Posts: 38341
Here is what we see when we do the setup that you have:
https://www.sierrachart.com/image.php?Image=1638396280451.png

Get us a copy of that chart in it's own chartbook so we can take a look. The instructions for this can be found here:
Support Board Posting Information: Providing Chartbook with Only a Single Chart
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-12-01 22:42:12]
User277997 - Posts: 22
Here's the basic chart. I pulled off all the other studies, checking after each removal if (for some weird reason) the issue resolved when I pulled a study. No changes as I removed studies. I did leave the chart as a numbers chart since that's what I'm using and it appears to be different from you guys using a bar chart.

Thanks for the help
attachmentSC_Support_Chart_BarDuration_SpreadsheetFormula_Issue.Cht - Attached On 2021-12-01 22:40:17 UTC - Size: 5.94 KB - 236 views
Attachment Deleted.
[2021-12-01 23:11:49]
John - SC Support - Posts: 38341
There is something weird about your Region 3. Once we removed the Spreadsheet Study and the Numbers Bars Calculated Values that is in Region 3 (the one with just the Bar Duration on), then put the Spreadsheet Study back on, everything was working properly.

Without the above, we could not get even a simple calculation to show in the Spreadsheet Formula (we just tried "=H", which is the high of the bar and it did not work).
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-12-01 23:41:37]
User277997 - Posts: 22
yep - not sure where that weirdness came from but that did the trick. deleted the bar duration only calc values and the spreadsheet formula...added spreadsheet back and voila...just like I was hoping for. Again - thanks for the persistence on this one.

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

Login

Login Page - Create Account