Login Page - Create Account

Support Board


Date/Time: Wed, 27 Nov 2024 13:40:26 +0000



Post From: ASCIL Creating TimeDeltas

[2023-08-19 14:56:16]
Gradient - Posts: 89
Thanks.

I'm attempting to compute the time since an order was sent for resting orders.
For example:

bool IsOrderFilled = TradeOrder.OrderStatusCode == SCT_OSC_FILLED;

SCDateTime ExecutionTime=TradeOrder.EntryDateTime;

//note: taking difference between execution time and basedatetime because BaseDateTime is open of
//bar and ExecutionTime is at close of bar, thus yielding a positive delta

if(((ExecutionTime.GetMinute()-sc.BaseDateTimeIn[sc.Index].GetMinute()) > 2) && !IsOrderFilled )

1) This makes sense.

2) These are both within the same hour of the same day, which is why I was thinking it should return some int value that could then be checked against come constant int. The issue is that even when I take the difference between the two expecting only an int value I'm getting back the date portion as well.

I hadn't seen SCDateTimeSpan prior but looking into it now.