Login Page - Create Account

Support Board


Date/Time: Thu, 26 Jun 2025 13:18:33 +0000



TimeScaleAdjustment doesn't work as expected

View Count: 1256

[2017-04-19 17:57:30]
Usermb - Posts: 126
Using SC 1540.

Global (DTS) Timezone is set to Brussels.
Chart Timezone is set to New York.
I have a study on this chart that accesses the Time and Sales records and tries to match them to the bars of the chart based on their time.

Assume tsEntry is a s_TimeAndSales variable containing a valid value for the a record with the time 13:41:40.000, as displayed by Time and Sales window.
Here's what the output of tsEntry.DateTime according to the study looks like: 17:41:40.000 (as expected, the time is not adjusted)
The same output for (tsEntry.DateTime + sc.TimeScaleAdjustment) is: 19:41:40.000 (NOT as expected, this is my global timezone, but that's not what the chart uses)

PS: if you have a better idea on how to match these entries, please let me know. Nonetheless, I think the above behavior is a bug.
PS2: I believe the second example from
ACSIL Interface Members - Variables and Arrays: sc.TimeScaleAdjustment
is obsolete.
[2017-04-20 04:07:00]
Sierra Chart Engineering - Posts: 104368

PS: if you have a better idea on how to match these entries, please let me know. Nonetheless, I think the above behavior is a bug.
PS2: I believe the second example from
ACSIL Interface Members - Variables and Arrays: sc.TimeScaleAdjustment
is obsolete.

Both of the above are now resolved. The change will be out in the next release.
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
[2017-04-20 13:26:23]
Usermb - Posts: 126
Great job, thank you!
[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.
[2021-11-19 17:50:05]
Sierra_Chart Engineering - Posts: 20003
Would seem doubtful there is any real problem but we will test.
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
[2021-11-19 18:34:44]
Sierra_Chart Engineering - Posts: 20003
We are not seeing any issue with this ACSIL variable. We need a code example from your side.
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

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

Login

Login Page - Create Account