Author |
Topic: When OCO entry stop fills, state transitions for OCOs are different using different demo accounts (4 messages, Page 1 of 1) |
||||
---|---|---|---|---|---|
Moderators: VPfau | |||||
CWeber984 Posts: 226 Joined: Apr 24, 2012 |
When an OCO's entry stop fills, the callbacks to OnOrderStateChange and OnCommandUpdated are different in their number and sequence between two demo accounts i use:
Account 1: OnOrderFilled : 100481837 MKT GTC OnOrderStateChanged 100481837 MKT GTC - currState: 5(Completed), oldState: 4(Working), linked: T, isOCO: F OnCommandUpdated 100481838 STP 1531.25 GTC Executed Create OnOrderStateChanged 100481838 STP 1531.25 GTC - currState: 4(Working), oldState: 3(Held), linked: F, isOCO: T OnCommandUpdated 100481839 LMT 1526.25 GTC Executed Create OnOrderStateChanged 100481839 LMT 1526.25 GTC - currState: 4(Working), oldState: 3(Held), linked: F, isOCO: T Account 2: OnOrderFilled : 100482132 MKT GTC OnOrderStateChanged 100482132 MKT GTC - currState: 5(Completed), oldState: 4(Working), linked: T, isOCO: F OnOrderStateChanged 100482133 STP 1526.75 GTC - currState: 2(Accepted), oldState: 3(Held), linked: F, isOCO: T OnOrderStateChanged 100482134 LMT 1531.75 GTC - currState: 2(Accepted), oldState: 3(Held), linked: F, isOCO: T OnCommandUpdated 100482133 STP 1526.75 GTC Executed Create OnCommandUpdated 100482134 LMT 1531.75 GTC Executed Create OnOrderStateChanged 100482133 STP 1526.75 GTC - currState: 4(Working), oldState: 2(Accepted), linked: F, isOCO: T OnOrderStateChanged 100482134 LMT 1531.75 GTC - currState: 4(Working), oldState: 2(Accepted), linked: F, isOCO: T I place the orders identically: an OCO stp and OCO lmt are placed 10 pips away from entry stop. Note how the sequence and number of the OnCommandUpdated and OnOrderStateChanged callbacks are different. Note also how in: - Account 1, the OCO's moved from Held to Working - Account 2, the OCO's moved from Held to Accepted to Working Account 1 has been used for at least a year, where account 2 was created 2-3 weeks ago. Through thorough testing, we find that the callbacks do not vary in their order received for either account. They are consistently different from each other as presented. The difference in the callbacks and particularly the state transitions for the OCO orders is giving us pause, as we now face the choice of coding for one or the other or both. Therefore, can you give some insight as to an OCO's expected state transitions when the OCO's have been placed and their entry order fills? We look forward to getting your feedback so that we can be properly handle our OCO's as they change states, and perhaps become more knowledgeable on different type of demo accounts as well. Much appreciated, Chris PS: will send details about the two account to api@openecry.com with this topic tag. CHW |
||||
VictorV Posts: 746 Joined: May 08, 2007 |
Hello,
Accepted state is an optional transitional state. Order will be switched to another state immediately without any action from client application. Meaning: order accepted by risk system. Some accounts use another route and their Working status 'includes' meaning of Accepted one. Regular state diagram look like this one: Sent -> Working -> Completed Orders that held by OEC server until some condition triggers (for example, Market-If-Touched orders or orders with 'time release' instruction) will have intermediate state Held: Sent -> Held -> Working -> .. In some situations, transition to Working status is extended: .. -> Accepted -> Working -> .. If order is rejected by risk engine or some else preliminary check by OEC: Sent -> Rejected In some situations, if order is accepted by risk engine, by rejected by exchange: .. -> Accepted -> Rejected Cancelled order will go the next way: .. -> Working -> Cancelled or .. -> Held -> Cancelled Here some API documentation about order states: http://www.openecry.com/api/api/html/T_OEC_Data_OrderState.htm and http://www.openecry.com/api/api/html/9900566b-260a-4247-8326-9698b013e7b8.htm Victor Vins Lead Software Developer |
||||
CWeber984 Posts: 226 Joined: Apr 24, 2012 |
The provided links and your explanation do help me to understand that there are different sequences on callbacks and different state transitions for different accounts.
Thanks much, Chris CHW |
||||