Login Page - Create Account

Support Board


Date/Time: Mon, 06 May 2024 00:56:39 +0000



Referencing other timeframes

View Count: 766

[2016-10-05 21:59:16]
Sean Beebe - Posts: 10
I want to get the index in another chart that is the closest bar with an Ending DateTime equal to or before a DateTime.

I see that there are functions for GetNearestMatchForSCDateTime, GetContainingIndexForSCDateTime and GetExactMatchForSCDateTime.

It seems that GetNearestMatchForSCDateTime will give me the index with a Starting DateTime equal to or before a DateTime.

And GetContainingIndexForSCDateTime will give me the index that will contain my DateTime, but it may end after which I don't want.

How can I get the index with an Ending DateTime equal to or before a DateTime?
[2016-10-06 05:22:52]
Sierra Chart Engineering - Posts: 104368
All timestamps for bars in Sierra Chart are the starting Date-Time.

Working with the ending Date-Time of a bar, is inherently not properly supported.

To answer the question, we would think that once you get the resulting index, then you can either increment it or decrement it to achieve what you want.

This will require that you access the Date-Time array from the other chart:
sc.GetChartDateTimeArray()
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2016-10-06 05:26:30
[2016-10-06 05:25:26]
Sierra Chart Engineering - Posts: 104368
The prior post has been updated.
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-06 15:26:32]
Sean Beebe - Posts: 10
Yes, I think that will work. But in addition to the date-time array from the other chart I think I will need to get the interval from the other chart so I know when the bar ends.

I know that the chart will always be a fixed interval chart and I will be evaluating this for closed bars only.

Is there any way to get the interval from the other chart?
[2016-10-07 17:00:07]
Sierra Chart Engineering - Posts: 104368
In order to solve this, the following function is going to be added to the next release:
sc.GetEndingDateTimeForBarIndexFromChart(int ChartNumber, int BarIndex)
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, *change* to the Teton service:
Sierra Chart Teton Futures Order Routing
[2016-10-07 17:37:40]
Sean Beebe - Posts: 10
Great! Thank you.

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

Login

Login Page - Create Account