Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 00:53:46 +0000



Post From: s_SCTradeOrder order lifetime

[2015-10-02 19:42:23]
User35525 - Posts: 180
Thanks about sc.GetAttachedOrderIDsForParentOrder().

For IsWorkingOrderStatus(), it was my error since this compiles:
if (!IsWorkingOrderStatus(OrderDetails.OrderStatusCode)) continue;

But not this:

int sid= OrderDetails.OrderStatusCode;
if (!IsWorkingOrderStatus(sid)) continue;

This was the compiler error:

error: invalid conversion from 'int' to 'SCOrderStatusCodeEnum' [-fpermissive]
if (!IsWorkingOrderStatus(sid)) continue;


However this compiles:

int sid= OrderDetails.OrderStatusCode;
if (sid == SCT_OSC_FILLED){ //stopped-out.
...

I think sc would need to provide "int StatusCodeTypeAsInt;" and "StatusCodeTypeAsInt(0)" within scstructures.h, and "bool IsWorkingOrderStatus(int OrderStatusCode)" within scconstants.h, for my example to be worksable. I don't need it, but see that it might be useful to somebody later. Then this would work:

int sid= OrderDetails.StatusCodeTypeAsInt;
if (!IsWorkingOrderStatus(sid)) continue;
...and then they could store sid and later check against it without knowing the order ID or having the OrderDetails object handy. Maybe an "int" would be better than "SCOrderStatusCodeEnum" in some cases that I'm unaware of (global variables?).
Date Time Of Last Edit: 2015-10-02 19:50:45