Login Page - Create Account

Support Board


Date/Time: Tue, 30 Apr 2024 08:59:25 +0000



Post From: Millisecond equalent for currentbar date & time

[2013-12-14 18:21:35]
ejtrader - Posts: 688
Thanks SC Team.

Considering Millisecond timestamps - Is this the correct way to detect if a T&S record belong to the last bar on chart ( irrespective of the chart type )?

Thanks


..
sc.AutoLoop = 1;
..

SCDateTimeMS cbDT = sc.BaseDateTimeIn[sc.Index];

SCTimeAndSalesArray TimeSales;
sc.GetTimeAndSales(TimeSales);

for (int TSIndex = TimeSales.GetArraySize() - 1; TSIndex >= 0; --TSIndex)
{
SCDateTimeMS TradeDateTime = TimeSales[TSIndex].DateTime;

if (TradeDateTime >= cbDT) // Will this ensure the T&S record belongs to the very last bar on chart irrespective of the chart type?
{
// Few actions
}
}

Date Time Of Last Edit: 2013-12-14 18:26:23