Login Page - Create Account

Support Board


Date/Time: Fri, 04 Dec 2020 13:46:10 +0000



[Sticky] [Locked] - Required SCDateTime Changes for ACSIL

[2020-03-08 06:23:18]
Sierra_Chart Engineering - Posts: 861 | Ending Date: 2021-01-22
ACSIL functions which use these constants:

static const double YEARS = 365.25; // 1 year in days (approx.)
static const double WEEKS = 7.0; // 1 week in days

static const double DAYS = 1.0; // 1 day in days
static const double HOURS = 1.0 / HOURS_PER_DAY; // 1 hour in days
static const double MINUTES = 1.0 / MINUTES_PER_DAY; // 1 minute in days
static const double SECONDS = 1.0 / SECONDS_PER_DAY; // 1 second in days
static const double MILLISECONDS = 1.0 / MILLISECONDS_PER_DAY; // 1 millisecond in days

static const double HALF_MILLISECOND_IN_SECONDS = (1.0 / MILLISECONDS_PER_SECOND) * 0.5; // = 0.0005

static const double HALF_SECOND = 0.5*SECONDS; // Half a second
static const double HALF_MILLISECOND = 0.5*MILLISECONDS; // Half a millisecond
static const double SCDATETIME_UNIX_EPOCH = 25569.0; // 1970-01-01 00:00:00


need to be updated to use these new static SCDateTime functions:
SCDateTime DAYS(const int Days);
SCDateTime YEARS(const int Years);
SCDateTime HOURS(const int Hours);
SCDateTime MINUTES(const int Minutes);
SCDateTime SECONDS(const int Seconds);


These functions will be fully available in version 2064.

These changes will be required in the upcoming version which supports true millisecond timestamping for trades. We expect this will be out in May 2020. This version will use a new type called SCDateTimeUnix which contains internally a 64 bit integer with microsecond precision. It has the capacity for nanosecond precision but that will not be used.

As we have said in another thread, custom studies will need to be recompiled to work on the version that supports the SCDateTimeUnix type. In that version the actual named type will be SCDateTime but there will be a typedef which maps it to a SCDateTimeUnix.

The external interface of SCDateTimeUnix supports the double DateTime format of SCDateTime. So it is fully back compatible. The reason for the required changes above are to ensure maximum performance. We do expect some performance benefits with the DateTime changes being worked on because the new type uses integers.

As part of this update, and actually in an earlier version, there will be a new high performance and fast chartbook format. This will not cause an impact to users, but chartbooks saved in this version will not be compatible with older versions.

For example the following:
SCDateTime DateValue = DAYS * 1;

Needs to be changed to:

SCDateTime DateValue = SCDateTime::DAYS(1);

The above code returns a SCDateTime object with a value equal to 1 day.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation
Date Time Of Last Edit: 2020-03-08 23:13:14
[2020-03-08 23:10:25]
Sierra Chart Engineering - Posts: 91805 | Ending Date: 2021-04-05
Above post has been updated with a code example.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. If possible please keep your questions brief and to the point. Please be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

If your question/request has been answered and you do not have anything further, then it is easiest for us if you do not reply again to say thank you.

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

Login

Login Page - Create Account