Login Page - Create Account

Support Board


Date/Time: Thu, 25 Apr 2024 09:09:36 +0000



[Programming Help] - sc.DateTimeOut[] always returns 30.12.1899

View Count: 887

[2018-05-09 16:20:34]
BrMa - Posts: 77
Dear ladies and gentlemen,

I'm trying to get the SCDateTime-element for a specific bar when it was finished. The documentation says (http://www.sierrachart.com/index.php?page=doc/ACS_ArraysAndLooping.html#ArrayIndexing) that
sc.DateTimeOut[]
would be the right array to look at. Unfortunately
sc.DateTimeOut[]
returns 30.12.1899 00:00:00 (which is equal to a zero-value of the variable) regardless which index I'm passing.

However - if I'm using
sc.BaseDateTimeIn[]
, it returns the right begin-SCDateTime for the bar.

Can you give me a hint what I'm doing wrong that
sc.BaseDateTimeIn[]
works and
sc.DateTimeOut[]
not, using the same index?

I'm also passing you my debug-routine to check the values - maybe it helps to determine the failure:
if (debug)
{
  char t_output[254];
  int Year, Month, Day, Hour, Minute, Second;
      
  DATETIME_TO_YMDHMS(sc.DateTimeOut[sc.IndexOfLastVisibleBar - 1], Year, Month, Day, Hour, Minute, Second);
  sprintf(t_output, "*** DateTimeOut: %d.%d.%d %d:%d:%d ***", Day, Month, Year, Hour, Minute, Second);
  sc.AddMessageToLog(t_output, 1);
  
  DATETIME_TO_YMDHMS(sc.BaseDateTimeIn[sc.IndexOfLastVisibleBar - 1], Year, Month, Day, Hour, Minute, Second);
  sprintf(t_output, "*** BaseDateTimeIn: %d.%d.%d %d:%d:%d ***", Day, Month, Year, Hour, Minute, Second);
  sc.AddMessageToLog(t_output, 1);
}

[2018-05-09 19:02:31]
Sierra Chart Engineering - Posts: 104368
No, that is definitely not the right array to use. You need to use:
http://www.sierrachart.com/index.php?page=doc/ACSIL_Members_Variables_And_Arrays.html#scBaseDateTimeIn
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
[2019-11-29 14:37:26]
scotteza - Posts: 4
I was just reading the documentation for "Working with ACSIL Arrays and Understanding Looping" (Working with ACSIL Arrays and Understanding Looping).

I understand what sc.BaseDateTimeIn[] is used for (holding the start times of price data bars).

But I don't understand what sc.DateTimeOut is supposed to be used for. What data does this array hold?

Thanks in advance!

[2019-11-29 21:46:30]
Sierra Chart Engineering - Posts: 104368
Did you read the documentation for this?
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
[2019-12-03 12:52:29]
scotteza - Posts: 4
I had only read the info on the page Working with ACSIL Arrays and Understanding Looping.

Posting for anyone else who comes across this post and wonders the same thing I did: I just realised that there is more extensive documentation on these array at ACSIL Interface Members - Variables and Arrays: sc.DateTimeOut[], and I found my answer there.

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

Login

Login Page - Create Account