Login Page - Create Account

Support Board


Date/Time: Thu, 26 Jun 2025 13:32:51 +0000



Post From: TimeScaleAdjustment doesn't work as expected

[2021-11-18 00:44:55]
User36703 - Posts: 29
I have found similar issue with the new versions of Sierra Chart, currently using the version 2325.

I am also working with a study on the chart that accesses the Time and Sales records and tries to match them to the bars of the chart based on their time.

It is working ok, unless I change the Chart Time Zone Settings or the Global Time Zone Settings. Simply when the time zone offset is changed, the bars time values got by sc.BaseDateTimeIn function are not longer corresponding with the DataTime elements adjusted by += sc.TimeScaleAdjustment of the object c_SCTimeAndSalesArray gathered by sc.GetTimeAndSales().
I build this method last year and it was working correctly so I believe that there have been done some major shifts of the processing time within Sierra Chart platform during the year.

It seems that’s a Sierra Chart bug with SCDateTime Arrays because it also affects the native function sc.GetTimeSalesArrayIndexesForBarIndex() - method returns the correct beginning and ending index when there is no time zone offset setting, but once the time zone is set with a specific time zone offset, the function always returns value -1 for the both indexes – there is no element found in the time and sales array contained within the bar specified by BarIndex .

I tried debugging this founding and it confirmed the idea of the bug, for example settings for -6 hours time zone offset, SCDateTimeMS shifted -21600000000 via sc.TimeScaleAdjustment on the chart with 5 minute bar period, the bar time value gathered by sc.BaseDateTimeIn shifted only by -18000000000 → once the time zone changed from the default, both time arrays shifted differently.

I got the same request, if you have a better idea on how to match these entries, please let me know. At the moment I do not know any other method how I can match the time of T&S and the bar time when the specific time zone offset is set.