Login Page - Create Account

Support Board


Date/Time: Tue, 04 Mar 2025 06:42:49 +0000



Unsure About Datetime Functions and Values

View Count: 642

[2021-11-29 13:24:19]
maxpi - Posts: 181
I have tick data in chart #6. The following code reports 0 for the value of LastDateTime. I wonder if the problem is in the calculations or the message. I believe that SCDateTime values should work in the log as floating point values but am unsure.

SCGraphData TickPriceData;
sc.GetChartBaseData(6, TickPriceData);
int tickArraySize =TickPriceData[SC_OPEN].GetArraySize();
  
SCDateTimeArray TickDateTimeArray;
sc.GetChartDateTimeArray(6, TickDateTimeArray);
  
SCDateTime LastDateTime;
LastDateTime =TickDateTimeArray[tickArraySize -1];
  
MessageText.Format("LastDateTime %f", LastDateTime);
sc.AddMessageToLog(MessageText, 0);
[2021-11-29 14:54:19]
Sierra Chart Engineering - Posts: 104368
This is definitely not correct:
MessageText.Format("LastDateTime %f", LastDateTime);
sc.AddMessageToLog(MessageText, 0);

You need to use this function:
ACSIL Interface Members - Functions: sc.DateTimeToString()
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