Login Page - Create Account

Support Board


Date/Time: Tue, 14 Jan 2025 23:22:37 +0000



sc.IsDateTimeInSession always return 1

View Count: 834

[2017-05-12 22:31:16]
User612903 - Posts: 51
Hi,

I'm trying to use this function that I found in the doc.

I've set session time, for the test I even tried a session that start at 9.00 am and finish at 9.01am.

But this :


  int IsInSession = sc.IsDateTimeInSession(sc.BaseDateTimeIn[sc.Index]);

Always return 1. Should it not return 0/false when it's not in the se[/code]ssion time defined in the Chart Settings ?

Thanks for your help,

Regards
[2017-05-13 00:42:45]
Sierra Chart Engineering - Posts: 104368
This is always going to be true because the data loaded in the chart must be within the session times:

int IsInSession = sc.IsDateTimeInSession(sc.BaseDateTimeIn[sc.Index]);

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
Date Time Of Last Edit: 2017-05-13 00:42:59
[2017-05-13 13:50:11]
User612903 - Posts: 51
oh ok i got it.

It's now working with "sc.CurrentSystemDateTime".

But since I have 2 sierrachart on the same computer with 2 different timezone I'm stuck

Is there a function to get the current time of the sierra chart ?

Thanks for your help
[2017-05-13 18:10:03]
Sierra Chart Engineering - Posts: 104368
This is the current time in the Sierra Chart time zone:
ACSIL Interface Members - Variables and Arrays: sc.CurrentSystemDateTime
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
Date Time Of Last Edit: 2017-05-13 18:13:05

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

Login

Login Page - Create Account