Login Page - Create Account

Support Board


Date/Time: Sat, 20 Apr 2024 10:21:36 +0000



Start - End time

View Count: 1144

[2014-09-16 04:33:19]
User120827 - Posts: 77
When you add certain trade hours to your code, how do you start at 18:00 on one day, and continue to the close of the next day at 5:15 ?

I have only been able to establish trading hours for the current day so far.

regards
shane
[2014-09-16 18:06:54]
Sierra Chart Engineering - Posts: 104368
Here is a code example:
if(sc.BaseDateTimeIn[sc.Index].GetTime() > HMS_TIME(18,0,0) ||
    sc.BaseDateTimeIn[sc.Index].GetTime() < HMS_TIME(5, 15,0))
  {

  }

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: 2021-01-10 09:00:58
[2021-01-10 08:46:02]
User719512 - Posts: 227
The && should be an || I believe.


if(sc.BaseDateTimeIn[sc.Index].GetTime() > HMS_TIME(18,0,0) ||
sc.BaseDateTimeIn[sc.Index].GetTime() < HMS_TIME(5, 15,0))
{
}

[2021-01-10 09:01:03]
Sierra Chart Engineering - Posts: 104368
Yes that is correct, it has been corrected.
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

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

Login

Login Page - Create Account