Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 08:28:44 +0000



Post From: Refencing previous bar on another time frame with study overlay

[2022-11-22 18:23:44]
John - SC Support - Posts: 30976
If we are understanding what you are wanting to do correctly, then you would need to look back the number of bars for which the lower time frame goes into the higher time frame.

For example, if you have a 1 minute chart and you overlay a study from a 5 minute chart, then you will get the same value for the 5 1-minute bars on the 1 minute chart in the overlay. Therefore, you would need to look back 5 bars in order to ensure that you are into the previous set of "5 minute bars".

Here is a visual

1 2 3 4 5 6 7 8 9 10
1 1 1 1 1 2 2 2 2 2

Where the top row is the 1 minute bars and the bottom is the overlay from the 5 minute bars. In order to access the 1's you need to use IDx.SGy[-5]. This way, regardless of whether the current bar is #6 or #10, you will be looking at the previous bar data.

You would need to work out the exact amount you need to look back based on your particular values. For instance 1 minute bars with a 60 minute study would require an offset of -60.
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing