Login Page - Create Account

Support Board


Date/Time: Sun, 19 May 2024 03:36:23 +0000



Post From: s_SCTradeOrder order lifetime

[2015-09-24 15:02:38]
User35525 - Posts: 180
Revised: Please close this. I wanted to know if I could quickly query only active brackets. Even if there was a way, I'd still have to troubleshoot potential bracket problems (steps #1-3 below).
...

Is there a function to grab just active orders (working and open), which I see at Trade >> Trade Orders and Positions? I'm using server-side brackets at CTS with SC 1296, and see all orders when I walk the order list with GetOrderByIndex. Just because a child is either SCT_OSC_FILLED or SCT_OSC_CANCELED doesn't tell me the OCO bracket is closed, as the parent or other child could be active.

Is this normal, and if 'yes', is there a way I can walk the orders and only receive active/working/open orders, and not closed orders too?

Some background: I'm walking the orders to get trade state of my OCO bracket, but think it would be easier if I only had to deal with active orders (at least it would eliminate step #4 below):

1) walk it once to get a complete list of parents, some being closed orders.
2) walk it again to get a complete list of children, some being closed orders. I believe it's theoretically possible to have children without parents (orphans), if orders are cancelled manually or anomalously at CTS, instead of within SC.
3) match-up parents and children, if possible. It's also possible to have naked brackets, meaning parents without attached stop (SL) orders.
4) now, to know if the order is active, you have to keep track of both the order "type" and "status" of both children; that is, if child1 cancels and child2 fills, that's a normal OCO exit; if child1 fills and child2 cancels, that's also a normal OCO exit; and if the parent type is changed to a market order and both children are cancelled, that's also normal, if you're flattening before a child gets filled.

Thanks.
Date Time Of Last Edit: 2015-09-25 03:58:11