Login Page - Create Account

Support Board


Date/Time: Sun, 12 Jan 2025 05:16:47 +0000



Post From: ACSIL - The indexing of the TimeAndSales array

[2017-01-25 20:59:58]
Zosimus - Posts: 345
When I loop through all the elements of the TimeAndSales array, can I assume that each element of the array represents a different trade and that the order of the elements in the array represent the order in which the trades took place?

When I print all the array elements to the Message Log I see trade volumes that do not seem to match what I see in the Time and Sales window. Also I see many consecutive array elements with the same volume. Of course we do often get consecutive trades with the the same volumes but in the TimeAndSales array there seem to be much to many repetitions.

The Log with the printed array entries is attached.
This is the code I used to get the TimeAndSales array volume values.

SCTimeAndSalesArray TimeSales;
sc.GetTimeAndSales(TimeSales);
if (TimeSales.Size() == 0) return;
    
for (int TSIndex = 0 ; TSIndex < TimeSales.Size(); ++TSIndex){
SCString str;  
str.Format("TSIndex = %i ----- TnS Entry Volume = %i",TSIndex, TimeSales[TSIndex].Volume);
sc.AddMessageToLog(str, 0);
}
Attachment Deleted.
attachmentTnS_Array_Entries.txt - Attached On 2017-01-25 20:52:07 UTC - Size: 590.12 KB - 382 views