Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 09:05:26 +0000



Post From: Python for Sierra Chart

[2021-06-19 11:46:40]
Kiwi - Posts: 374
Its old code and it was working early 2020 but I notice it doesn't work on current data so SC presumably changed how they stored times. I will have a look at it and figure it out but it might take a week.

I assume it relates to the 2151 change so it might be quite simple. I'll look tomorrow & if its easy I'll update, otherwise it could take a while.


DateTime
[Link] - [Top]
The DateTime member variable is a SCDateTimeMS variable.

This is a 64-bit integer. It represents the number of microseconds since the SCDateTime epoch of December 30, 1899.

Versions prior to 2151, use a double precision floating point type variable to represent Date-Time values. For a complete explanation of the Date component of this value, refer to Date Value. The date value is the integer portion of the double. The fractional portion is the Time value which is represented as a fraction of one day where 1/86400000 is 1 ms. 86400000 is the number of milliseconds in a day.

This Date and Time value is and must be in the UTC time zone.

In Sierra Chart, if the Intraday Data Storage Time Unit in Global Settings >>Data/Trade Service Settings is set to a value greater than 1 Second like 1 Minute and the first trade within a new minute begins at a time after the beginning of the minute, for example 9:28:22, the time value part of the DateTime member in the record will be set to this time.

A new record will begin if there is any trading on or after 9:29:00 and not 9:29:22. The data is aligned on time boundaries which are multiples of the Intraday Data Storage Time Unit.

When writing tick by tick data to an Intraday data file, where each tick is a single record in the file, and multiple ticks/trades have the same timestamp, then it is acceptable for the Date-Time of the record to be the same timestamp as prior records. What Sierra Chart itself does in this case, is increment the microsecond portion of the Date-Time to create unique timestamps for each trade within a millisecond.

Sierra Chart provides the /ACS_Source/SCDateTime.h file with various functions for working with these Date-Time values.

Date Time Of Last Edit: 2021-06-19 11:51:54