API Support Forum
OEC API > API Support > Change Order not fulfilled
Author Topic: Change Order not fulfilled
(4 messages, Page 1 of 1)
Moderators: VPfau
JGagnon
Posts: 95
Joined: Apr 11, 2011


Posted: Feb 04, 2013 @ 11:28 AM             Msg. 1 of 4
OECID: 202631517

LONG Order was filled, we tried to modify the exit order (SELL) which was originally priced at 135.48 to 135.58, this order was sent to OEC on 2013-02-04 10:33:20.833.

Question 1: Was this rejected? Please post details as we are not seeing this in our application.
Question 2: If this was rejected I don't understand why, price did not change for 4-5 seconds and when it did change it matched our stop price.

Price history:

tickId tickTime price
4947649 2013-02-04 10:33:06.000 135.59
4947650 2013-02-04 10:33:13.000 135.60
4947651 2013-02-04 10:33:14.000 135.59
<--- Change Order was put in place here from a STP of 135.48 to a stop of 135.58 at local time (2013-02-04 10:33:20.833) which is relative to these price changes that are being recorded
4947652 2013-02-04 10:33:25.000 135.58
4947653 2013-02-04 10:33:32.000 135.57
4947654 2013-02-04 10:33:37.000 135.56
4947655 2013-02-04 10:33:39.000 135.55
4947656 2013-02-04 10:33:44.000 135.56
4947657 2013-02-04 10:33:45.000 135.57
4947658 2013-02-04 10:33:49.000 135.56

John Gagnon
JGagnon
Posts: 95
Joined: Apr 11, 2011


Posted: Feb 04, 2013 @ 11:45 AM             Msg. 2 of 4
by the way we are already trapping OnCommandUpdatedEvent via below:

this.oecClient1.OnCommandUpdated += new OEC.API.OnCommandUpdatedEvent(this.oecClient1_OnCommandUpdated);

I did not see a rejected/cancelled record from this event here is the activity we did capture:

Id ypsId OECId TypeId OTypeId OECDatetime OSideId OQuant OPrice1 OPrice2 OAction FQuant FPrice Desc comment
148835 145 202631517 4 4 2/4/2013 3:29:06 PM 2 10 135.48 0.00 0 0.00 Sent
148836 145 202631517 4 4 2/4/2013 3:29:06 PM 2 10 135.48 0.00 Command 0 0.00 Create Sell 10 6EH3 STP 135.48
148837 145 202631517 4 4 2/4/2013 3:29:06 PM 2 10 135.48 0.00 0 0.00 Sent
148838 145 202631517 4 4 2/4/2013 3:29:06 PM 2 10 135.48 0.00 Command 0 0.00 Create Sell 10 6EH3 STP 135.48
148839 145 202631517 4 4 2/4/2013 3:29:06 PM 2 10 135.48 0.00 0 0.00 Accepted
148840 145 202631517 4 4 2/4/2013 3:29:06 PM 2 10 135.48 0.00 Command 0 0.00 Create Sell 10 6EH3 STP 135.48
148841 145 202631517 4 4 2/4/2013 3:29:06 PM 2 10 135.48 0.00 Working 0 0.00 Working #393997
148842 145 202631517 4 4 2/4/2013 3:33:55 PM 2 10 135.48 0.00 Command 0 0.00 Modify To: Sell 10 6EH3 STP 135.58
148843 145 202631517 4 4 2/4/2013 3:33:55 PM 2 10 135.48 0.00 Command 0 0.00 Modify To: Sell 10 6EH3 STP 135.58


John Gagnon
RuslanK
Posts: 69
Joined: Jun 02, 2010


Posted: Feb 04, 2013 @ 11:51 AM             Msg. 3 of 4
Hello John

Our records indicate that your modification order (for original order #202631517) has been placed at 02/04/13 10:33:55.697 and a price at the moment was around 135.54 - 135.55 which is obviously lower than price you used in modification request.

That's why it was rejected with message "Invalid trigger price".

Ruslan Kartokhin
Software Developer
RuslanK
Posts: 69
Joined: Jun 02, 2010


Posted: Feb 04, 2013 @ 11:55 AM             Msg. 4 of 4
As of command rejection - you should check command state on every CommandUpdated event.
If Command.State == Data.CommandState.Failed that means command was rejected and the reason was that provided in Command.ResultComments field.

Ruslan Kartokhin
Software Developer