Login Page - Create Account

Support Board


Date/Time: Fri, 19 Apr 2024 19:58:35 +0000



How to reference study value from N days back same time?

View Count: 639

[2021-01-11 15:19:40]
User311344 - Posts: 136
Hey,

How can I get study value from N days back using formula or some other study? Of course I can use offset reference as ID1.SG1[-1440] on 1min chart, but maybe theres some more universal and obvious way. Thanks!
[2021-01-11 17:52:51]
John - SC Support - Posts: 30973
Within Alerts and the Spreadsheet Formula, the best way to do what you want, assuming a fixed N days back, is the option you listed, using the offset within square brackets (ID1.SG1[-1440]).

There are options to specify a particular date and/or time if you are wanting to reference a specific date and/or time. Refer to the BARDATE and BARTIME and related functions here:
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
[2021-01-11 20:25:44]
User311344 - Posts: 136
Thanks John!

Unfortunately that easy task is little more complicated :-) Reference using [-1440] shows study value 24h back on 1min chart but... the session is not 24h but 23h so it whould be 1380 bars back. Then there are weekends where there is not full day traded so -1380 doesnt work well too.

I want to reference study values from each of past 10 days at the same time. Sound easy and I feel silly I cant do this in 15sec and although I could do it quite easy in ACSIL I tought Id ask if theres some formula/study based way.

I tought about some hack like using Period OHLC-Variable Period study but with no luck.
[2021-01-11 20:32:00]
John - SC Support - Posts: 30973
The only possible way without programming it in ACSIL would be to try the Spreadsheet Study. But you will have to load a lot of data and it may slow down Sierra Chart with that many rows.

In the end, programming this in ACSIL would be the best way.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2021-01-11 20:59:32]
User311344 - Posts: 136
OK will do. Thanks!

But maybe thats a good idea for a native study? I guess thats how people look at volume - comparing it as relative value to values from N days back. Also many other ideas.
Date Time Of Last Edit: 2021-01-11 20:59:55
[2021-01-11 23:03:44]
John - SC Support - Posts: 30973
Sorry, we should have mentioned this before. Refer to this study, and note that it can be used for things other than volume by setting the Based On:
Relative Volume
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-01-11 23:04:09

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

Login

Login Page - Create Account