Login Page - Create Account

Support Board


Date/Time: Sun, 04 Dec 2022 21:29:05 +0000



sc.GetTimeHMS() Stopped Working

View Count: 116

[2022-10-03 20:14:00]
Tony - Posts: 284
Working with the SCDateTime Variables and Values: GetTimeHMS()

The error message I got is this:

error: ‘struct s_sc’ has no member named ‘GetTimeHMS’

please help, thanks
Date Time Of Last Edit: 2022-10-03 20:22:17
[2022-10-04 15:28:17]
Sierra_Chart Engineering - Posts: 5464
Show us the original code because that function does not exist on the sc structure. It is a member of SCDateTime objects.
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2022-10-04 17:10:17]
Tony - Posts: 284
thanks, what I am trying to do is play a sound when market open at 6:30 Eastern.

this is the code gave me the error message: (tried SCDateTime::GetTimeHMS(6,30,0) too, didn't work)

if (sc.BaseDataEndDateTime[sc.Index].GetTimeInSeconds()==sc.GetTimeHMS(6,30,0))
sc.PlaySound(7);


this code works as I expected ():

if (sc.BaseDataEndDateTime[sc.Index].GetTimeInSeconds()==(6*3600 + 30*60))
sc.PlaySound(7);

[2022-10-04 17:23:01]
Tony - Posts: 284
Thanks, I figured it out, this should be the correct way to use the function:

int a {0};
int b {0};
int c {0};
sc.BaseDataEndDateTime[sc.Index].GetTimeHMS(a, b, c);

and a, b, c, being updated as last price changes.

I vaguely remember there was a function, takes inputs of numbers of hour, minute and second, and converts them to the value of TimeInSeconds.
[2022-10-04 18:45:48]
Sierra_Chart Engineering - Posts: 5464
Use this function to get the current time:
sc.GetCurrentDateTime()

Also refer to:
Working with the SCDateTime Variables and Values
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, use the Teton service:
Sierra Chart Teton Futures Order Routing
Date Time Of Last Edit: 2022-10-04 18:47:21

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

Login

Login Page - Create Account