Login Page - Create Account

Support Board


Date/Time: Thu, 02 May 2024 10:14:55 +0000



GetSecond() function returning only zero

View Count: 687

[2019-08-08 14:12:23]
Ernie Doo - Posts: 46
If I use in ACSIL the following example given by Sierra Chart in the section "Working with the SCDateTime Variables and Values" then the fuction is only returning zero continiously>

int Second = sc.BaseDateTimeIn[sc.Index].GetSecond();

GetMinute works perfectly and if I use the following line the information returned contains the minute and it changes with every bar.

int Minute = sc.BaseDateTimeIn[sc.Index].GetMinute();

Can you please explain me why is GetSecond not working?

Thanks a lot.
Ernesto
[2019-08-08 16:01:33]
John - SC Support - Posts: 31293
As described in the documentation, the sc.BaseDateTimeIn array gives the Starting time of the bar. If you are using time-based bars, then most likely the bars are starting at the beginning of the minute, in which case the seconds will always be 0.

Refer to the following for sc.BaseDateTimeIn array:
ACSIL Interface Members - Variables and Arrays: sc.BaseDateTimeIn[]
For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing
[2019-08-08 16:26:55]
Ernie Doo - Posts: 46
Thanks for your prompt response. I have been reading and studying everything I can regarding ACSIL.

If I have a 1 minute chart, is there a way I can get the seconds that have gone by within a bar in real-time?

Thanks again
Date Time Of Last Edit: 2019-08-08 16:28:00
[2019-08-08 16:48:03]
Sierra Chart - Max - Posts: 5598
Have you looked at sc.BaseDataEndDateTime[] ?

ACSIL Interface Members - Variables and Arrays: sc.BaseDataEndDateTime[]
Sierra Chart Support
[2019-08-08 17:16:28]
Ernie Doo - Posts: 46
Awesome!! Thanks a lot! Works perfectly.

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

Login

Login Page - Create Account