Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 08:32:32 +0000



[Programming Help] - How to keep historical data consistent with real-time when referencing other time Frames

View Count: 270

[2023-08-31 16:27:52]
User372608 - Posts: 3
Hello,

When using sc.GetContainingIndexForDateTimeIndex to obtain the corresponding index for data from another chart:
For example, if the current chart uses 1-minute bars and the other chart uses 1-hour bars, the corresponding index for the 1-hour bars always represents the ending data when driving indicators on historical bars in the 1-minute chart.
If it's real-time quotes, then the close of the 1-hour bar and the close of the 1-minute bar are consistent.
I want to be as consistent as I am with backtesting or live data, what should I do?
[2023-08-31 20:14:44]
Sierra_Chart Engineering - Posts: 17191
What is the timeframe per bar of the chart you are calling this function from?:
sc.GetContainingIndexForDateTimeIndex

Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2023-09-01 09:42:41]
User372608 - Posts: 3
I have placed indicators in the 1-minute bar chart (ChartNumber 1), and within the indicators, I called sc.GetContainingIndexForDateTimeIndex(2, sc.Index); ChartNumber 2 is a 1-hour bar chart.

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

Login

Login Page - Create Account