Login Page - Create Account

Support Board


Date/Time: Tue, 16 Apr 2024 23:57:56 +0000



Refencing previous bar on another time frame with study overlay

View Count: 264

[2022-11-22 16:36:50]
Tahir - Posts: 35
Hi, is there a way to reference previous bar on higher time frame when using trading system based on alert?
For example, when I write the formula ID1.SG3[-1], it is looking at the study/price overlay indicator but looking at the bar on the current chart.
Thank you
[2022-11-22 18:23:44]
John - SC Support - Posts: 30907
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
[2022-11-22 18:29:14]
Tahir - Posts: 35
Thanks for the response I have already considered that but the issue is I am not using a time-based chart at the lower time frame. I'm using a range chart for my entry and I use a higher timeframe candlestick pattern for confirmation.
I have tried using the period OHLC indicator which kind of works to get the data for the previous candle but then you cannot go back further than that.
[2022-11-22 21:17:12]
John - SC Support - Posts: 30907
Since you are using a non-time-based chart, it would probably be easiest to use the Spreadsheet Study to view the data and find a way to reference the bar prior to the current higher time-frame bar. You would need to do some work with the Times of the bars, so refer to the following information on working with Date-Times in Spreadsheets:
Spreadsheet Functions: Serial DateTime Values
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