Login Page - Create Account

Support Board


Date/Time: Tue, 16 Apr 2024 20:23:06 +0000



ACSIL: Getting the MilliSecond part of the Time&Sales time.

View Count: 1754

[2014-10-08 21:03:23]
Zosimus - Posts: 345
I want to get the MS part of the Time&Sales time. (I understand that it is not "real" milliseconds but rather a counter of the T&S entries that happen within the same second).

When I use the following code I only get zeros for the MS part (As seen in the attached image):

  SCTimeAndSalesArray TimeSales;
  sc.GetTimeAndSales(TimeSales);
  int TSIndex = TimeSales.Size() - 1;
  SCDateTimeMS TSDateTime = TimeSales[TSIndex].DateTime;  
  int TS_MS = TSDateTime.GetMilliSecond();

SCString ToLog;
ToLog.Format(" MS_Part is: %i", TS_MS);
sc.AddMessageToLog(ToLog, 0);

The Chart Update Interval is set to 40ms and the Time and Sales window does show milliseconds in the Time column.
What is the correct way to get the MS part of the Time&Sales time ?



  
Date Time Of Last Edit: 2014-10-08 21:07:14
imageTS_MS_Log.png / V - Attached On 2014-10-08 21:02:14 UTC - Size: 56.61 KB - 428 views
[2014-10-09 03:23:24]
Sierra Chart Engineering - Posts: 104368
This code is always getting the milliseconds of the last time and sales record and maybe that one is usually zero. Otherwise the code looks OK.
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
[2014-10-16 22:35:35]
Zosimus - Posts: 345
As you can see in the attached image I only get zeros for Time&Sales Milliseconds BUT the corresponding entries on the Time&Sales window do show milliseconds other than zeros.
Date Time Of Last Edit: 2014-10-16 22:36:54
imageTimenSales.png / V - Attached On 2014-10-16 22:36:49 UTC - Size: 250.38 KB - 385 views
[2014-10-17 09:55:05]
Hendrixon - Posts: 130
yon,

What use do you find in the counter? please explain.


[2014-10-17 10:08:06]
Zosimus - Posts: 345
I need a way to determine whether the data in the last index of the Time&Sales array that I get when the sc.GetTimeAndSales(TimeSales) is called represents a new trade that just took place OR just a repeat of the T&S data of the previous trade because no new trade took place since the previous time the function was called.
I thought of doing this by comparing the time stamps of the last T&S data I got with the previous one. For this purpose I need to compare the counter too.
Date Time Of Last Edit: 2014-10-17 11:42:15
[2014-10-17 22:52:03]
Sierra Chart Engineering - Posts: 104368
As we suspected there is no problem with getting milliseconds for time and sales records.

In the next release you will find this function which will demonstrate this works properly:
/ACS_source/studies.cpp/scsf_TimeAndSalesMilliseconds

You should also be aware of the Sequence member of the time and sales data structure. It is the sequence number which does exactly what you are looking for and this is documented here:
http://www.sierrachart.com/index.php?page=doc/doc_ACSIL_Members_Functions.html#scGetTimeAndSales
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: 2014-10-18 02:35:26

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

Login

Login Page - Create Account