Login Page - Create Account

Support Board


Date/Time: Fri, 10 Jan 2025 16:22:44 +0000



Get day session start time in ASCIL

View Count: 1975

[2016-09-22 04:55:52]
User763472 - Posts: 22
Dear Sir or Madam,

How can I get the day session start time directly from ASCIL code? I tried the following but none work properly. Thanks!

1)
SCDateTime StartingTime;
StartingTime.SetTime(sc.StartTimeOfDay);
int CurrentBarDate = DATE_PART(sc.BaseDateTimeIn[sc.Index]);
SCDateTime StartingDateTime = COMBINE_DATE_TIME(CurrentBarDate, StartingTime);

(Only work for Index future but not for currencies)

2)
SCDateTime StartingDateTime = sc.GetTradingDayStartDateTimeOfBar(sc.BaseDateTimeIn[sc.Index]);

3)
int StartingTime = sc.SessionStartTime();
int CurrentBarDate = DATE_PART(sc.BaseDateTimeIn[sc.Index]);
SCDateTime StartingDateTime = COMBINE_DATE_TIME(CurrentBarDate, StartingTime);
[2016-09-22 06:01:36]
Sierra Chart Engineering - Posts: 104368
You need to use this ACSIL member:
ACSIL Interface Members - Variables and Arrays: sc.StartTime1
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
[2016-09-22 07:30:52]
User763472 - Posts: 22
I replaced it with sc.StartTime1 and the result is the same as using sc.StartTimeofDay:

SCDateTime StartingTime;
StartingTime.SetTime(sc.StartTime1);
int CurrentBarDate = DATE_PART(sc.BaseDateTimeIn[sc.Index]);
SCDateTime StartingDateTime = COMBINE_DATE_TIME(CurrentBarDate, StartingTime);

It only works for Index futures but not for currencies.
[2016-09-22 16:50:15]
Sierra Chart Engineering - Posts: 104368
Why do you say that it only works for index futures and not currencies?

sc.StartTime1 is from the Session Times settings in Chart >> Chart Settings.
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
[2016-09-23 01:58:10]
User763472 - Posts: 22
Problem is solved. Need to add:

SCDateTime StartingTime1;
StartingTime1.SetTime(sc.StartTime1);
int StartingTime = StartingTime1.GetTime();

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

Login

Login Page - Create Account