Login Page - Create Account

Support Board


Date/Time: Mon, 25 Nov 2024 08:54:19 +0000



Post From: GetContainingIndexForSCDateTime function wrongly assign index

[2024-03-17 21:19:59]
Sierra_Chart Engineering - Posts: 17172
The function you are referring to is a core Sierra Chart function used in charts. It would be very unlikely to have the problem you describe.

As we suspected, we ran a test and there is no issue.

This is the ACSIL test function call we used:
    int BarIndex = sc.GetContainingIndexForSCDateTime(sc.ChartNumber, SCDateTime(2024, 3, 15, 16, 59, 0, 0));

The returned index is zero-based and if you use the Bar Numbering study set to not reset every day and to label every bar, you will find that this index returned by sc.GetContainingIndexForSCDateTime, matches with what you see with Bar Numbering -1.
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