API Support Forum
OEC API > FIX Support > OSO leg 2 order is not executed afer leg1 filled.
Author Topic: OSO leg 2 order is not executed afer leg1 filled.
(5 messages, Page 1 of 1)
Moderators: VPfau
MHall4001
Posts: 31
Joined: Oct 14, 2013


Posted: Jan 08, 2014 @ 04:49 AM             Msg. 1 of 5
According to the API doc "First order in a list is main order, which triggers the other (child) ones when it filled/completed".

There may be a problem with the execution of the second legs of OSO orders. The following describes a situation, along with fix messages where a OSO leg1 is filled but leg2 is neither filled nor rejected.

My comments in <brackets>.
<Client send NewOrderList message of type OSO with CLOrd ID of 1401071547220000 for leg 1 and 1401071547220001 for leg 2. Leg1 is a limit order, leg2 is a market order which should be placed when leg1 is filled.>

8=FIX.4.49=33335=E34=249=MHall400152=20140107-15:47:35.47556=OEC_TEST66=OSO Order 2 Legs68=269=OSO394=373=211=140107154722000067=11=API00221855=LE461=FXXXXS200=20141254=160=20140107-15:47:35.47438=540=244=132.2511=140107154722000167=21=API00221855=LE461=FXXXXS200=20140654=260=20140107-15:47:35.47538=540=144=132.2510=233

<Order is accepted by server, server assigns the following order numbers leg1 = 202867343, leg2 = 202867344.>

8=FIX.4.49=21535=834=549=OEC_TEST52=20140107-15:47:45.99356=MHall40011=API0022186=0.00011=140107154722000014=017=522378737=20286734338=539=044=132.2554=155=LE60=20140107-15:47:45150=0151=5200=201412461=FXXXXS10=169

8=FIX.4.49=23135=834=449=OEC_TEST52=20140107-15:47:45.99356=MHall40011=API0022186=0.00011=140107154722000114=017=522378637=20286734438=539=944=132.2554=255=LE58=Auto-Execute60=20140107-15:47:45150=9151=5200=201406461=FXXXXS10=001

<Leg1 of order is updated several times using OrderCancelReplaceReject messages, acceptance of which is confirmed by the server. An example ...>

8=FIX.4.49=19235=G34=11549=MHall400152=20140107-16:07:25.51756=OEC_TEST1=API00221811=140107154722002338=540=241=140107154722002244=132.3554=155=LE60=20140107-15:47:35.474200=201412461=FXXXXS10=208

8=FIX.4.49=25635=834=8849=OEC_TEST52=20140107-16:07:26.89956=MHall40011=API0022186=0.00011=140107154722002314=017=OECFIX:635245560331309946:138537=20286734338=539=E41=140107154722002244=13254=155=LE60=20140107-16:07:26150=E151=5200=201412461=FXXXXS10=132

8=FIX.4.49=27335=834=8949=OEC_TEST52=20140107-16:07:26.91556=MHall40011=API0022186=0.00011=140107154722002314=017=OECFIX:635245560331309946:138637=20286734338=539=041=140107154722002244=132.3554=155=LE60=20140107-16:07:26150=5151=5198=202867370200=201412461=FXXXXS10=158

<Just before the first leg is filled....>
<Latest ClOrderId number is 1401071547220023>

8=FIX.4.49=25635=834=8849=OEC_TEST52=20140107-16:07:26.89956=MHall40011=API0022186=0.00011=140107154722002314=017=OECFIX:635245560331309946:138537=20286734338=539=E41=140107154722002244=13254=155=LE60=20140107-16:07:26150=E151=5200=201412461=FXXXXS10=132

<<On Message ClOrderId 1401071547220023 status = E > Pending replace
8=FIX.4.49=27335=834=8949=OEC_TEST52=20140107-16:07:26.91556=MHall40011=API0022186=0.00011=140107154722002314=017=OECFIX:635245560331309946:138637=20286734338=539=041=140107154722002244=132.3554=155=LE60=20140107-16:07:26150=5151=5198=202867370200=201412461=FXXXXS10=158

<For ClOrderId 1401071547220023 status = 0 means the order change has been accepted by server>

<Client lowers price of ClOrderId 1401071547220023 by order sending following message. New order number is 1401071547220024>

8=FIX.4.49=19235=G34=11849=MHall400152=20140107-16:07:49.39956=OEC_TEST1=API00221811=140107154722002438=540=241=140107154722002344=131.9554=155=LE60=20140107-15:47:35.474200=201412461=FXXXXS10=232

<Order server updates client with ex rep of partial fill (3 of 5 for ClOrderId ending in 1401071547220023)>

8=FIX.4.49=23435=834=9149=OEC_TEST52=20140107-16:07:50.76756=MHall40011=API0022186=132.35011=140107154722002314=317=522380231=132.35032=337=20286734338=539=144=132.3554=155=LE60=20140107-16:07:50150=F151=2200=201412461=FXXXXS10=035

<Order server then sends a pending replace messsge for the new ClOrderId 1401071547220024. >

8=FIX.4.49=26135=834=9249=OEC_TEST52=20140107-16:07:50.78356=MHall40011=API0022186=132.35011=140107154722002414=317=OECFIX:635245560331309946:138737=20286734338=539=E41=140107154722002344=132.3554=155=LE60=20140107-16:07:50150=E151=2200=201412461=FXXXXS10=117

<Order server then sends a pending replace ex rep for the ClOrderId 1401071547220023 but the order 202867343 has actually been filled (tag 150=F (filled) tag 151=0 (remaining quantity of zero)). >

8=FIX.4.49=23435=834=9349=OEC_TEST52=20140107-16:07:50.78356=MHall40011=API0022186=132.35011=140107154722002314=517=522380431=132.35032=237=20286734338=539=E44=132.3554=155=LE60=20140107-16:07:50150=F151=0200=201412461=FXXXXS10=056

<Order server then sends an order cancel reject for ClOrderIdr 1401071547220024 as the order 202867343 to which the ClOrderId has been filled>

8=FIX.4.49=17135=934=9449=OEC_TEST52=20140107-16:07:50.79956=MHall400111=140107154722002437=20286734339=241=140107154722002358=Order Completed60=20140107-16:07:50102=2434=210=192

<Order server then sends details of execution for ClOrderId 1401071547220023>
8=FIX.4.49=24135=834=9549=OEC_TEST52=20140107-16:07:50.79956=MHall40011=API0022186=132.35011=140107154722002314=517=OECFIX:635245560331309946:138837=20286734338=539=B44=132.3554=155=LE60=20140107-16:07:50150=B151=0200=201412461=FXXXXS10=173

<So far so good. But now one would expect the other leg of the OSO to go from status 9 (Suspended), through statuses , A, 0 and 2 as it is a market order. But no. There is no further communication from the order server. Order 202867344 has been lost.

Edited by MHall4001 on Jan 8, 2014 at 05:19:16
MHall4001
Posts: 31
Joined: Oct 14, 2013


Posted: Jan 08, 2014 @ 05:32 AM             Msg. 2 of 5
After some further searching through the Fix logs I discovered what is happening. The order server does process the second leg of the OSO but the Execution reports it sends out change the ClOrdID to a server derived value - that looks like a new order number for the server and it adds an extra tag (12073) which contains the ClOrdID. This isn't in my FIX DD so I reject the message (This tag isn't in your API doc either!).

Can you put the ClOrdID in the ClOrdID field and the server's additional order number in the 12073 tag?
Fix messages:
Exec reports...
8=FIX.4.49=24135=834=9649=OEC_TEST52=20140107-16:07:50.79956=MHall40011=API0022186=0.00011=OECFIX:20286737114=017=522380637=20286734438=339=054=255=LE60=20140107-16:07:50150=0151=3200=201406325=Y377=N461=FXXXXS12073=140107154722000110=102

8=FIX.4.49=25935=834=9749=OEC_TEST52=20140107-16:07:50.79956=MHall40011=API0022186=129.92511=OECFIX:20286737114=317=522380731=129.92532=337=20286734438=339=E54=255=LE60=20140107-16:07:50150=F151=0200=201406325=Y377=N461=FXXXXS12073=140107154722000110=250

8=FIX.4.49=28035=834=9849=OEC_TEST52=20140107-16:07:50.79956=MHall40011=API0022186=129.92511=OECFIX:20286737314=317=OECFIX:635245560331309946:138937=20286734438=539=154=255=LE60=20140107-16:07:50150=5151=2198=202867373200=201406325=Y377=N461=FXXXXS12073=140107154722000110=240

Rejects...
8=FIX.4.49=12935=334=11949=MHall400152=20140107-16:07:49.55656=OEC_TEST45=9658=Tag not defined for this message type371=325372=8373=210=125

8=FIX.4.49=12935=334=12049=MHall400152=20140107-16:07:49.55856=OEC_TEST45=9758=Tag not defined for this message type371=325372=8373=210=120

8=FIX.4.49=12935=334=12149=MHall400152=20140107-16:07:49.55956=OEC_TEST45=9858=Tag not defined for this message type371=325372=8373=210=123

Michael Hall
VPfau
Moderator
Posts: 154
Joined:


Posted: Jan 08, 2014 @ 09:48 AM             Msg. 3 of 5
On activation process an order are changing it's ClOrderID. For such cases you may check: UnsolicitedIndicator(325)=Y, SolicitedFlag(377)=N and LastSolicitedClOrdID(12073) custom field which is a reference to the original ClOrdID.
OrderID remains same.

We will update FIX API documentation shortly.

Vitaliy Pfau
MHall4001
Posts: 31
Joined: Oct 14, 2013


Posted: Jan 08, 2014 @ 10:53 AM             Msg. 4 of 5
Thank you for your quick response. I understand what you're saying but I still think that only the client side should update the ClOrdId (Cl stands for Client) which how it works in other circumstances. But I can work around this.

Also while you're updating the documentation on OSOs you might want to change the part that says "OCO/OSO orders are sent using NewOrderList(MsgType=E) message, that's a set of orders is sent as a single
message, but processing of the orders is performed for each individual order. That means, if for example, one of list
orders is incorrect then all orders in the list will be rejected and for each order ExecutionReport message will be
responded." Currently if the first order in the list is incorrect and is rejected the next order in the list has a status of SUSPENDED. See Fix messages below:
8=FIX.4.49=33535=E34=249=MHall400152=20140108-15:37:34.28656=OEC_TEST66=OSO Order 2 Legs68=269=OSO394=373=211=140108153721000167=11=API00221855=LE461=FXXXXS200=20141254=160=20140108-15:37:34.27638=140=244=132.17511=140108153721000267=21=API00221855=LE461=FXXXXS200=20140654=260=20140108-15:37:34.27638=140=144=132.17510=075
8=FIX.4.49=23935=834=249=OEC_TEST52=20140108-15:37:45.99056=MHall40011=API0022186=0.00011=140108153721000114=017=OECFIX:635245560331309946:223937=20286834738=139=A44=132.17554=155=LE60=20140108-15:37:45150=A151=0200=201412461=FXXXXS10=055
8=FIX.4.49=23935=834=349=OEC_TEST52=20140108-15:37:45.99056=MHall40011=API0022186=0.00011=140108153721000214=017=OECFIX:635245560331309946:224037=20286834838=139=A44=132.17554=255=LE60=20140108-15:37:45150=A151=0200=201406461=FXXXXS10=054
202868348 status = SENT
8=FIX.4.49=24235=834=449=OEC_TEST52=20140108-15:37:45.99056=MHall40011=API0022186=011=140108153721000114=017=522549137=20286834738=139=844=132.17554=155=LE58=Order breaks limits.60=20140108-15:37:45103=0150=8151=1200=201412461=FXXXXS10=069
8=FIX.4.49=23235=834=549=OEC_TEST52=20140108-15:37:46.00556=MHall40011=API0022186=0.00011=140108153721000214=017=522549237=20286834838=139=944=132.17554=255=LE58=Auto-Execute60=20140108-15:37:45150=9151=1200=201406461=FXXXXS10=035

Michael Hall
VPfau
Moderator
Posts: 154
Joined:


Posted: Jan 08, 2014 @ 11:25 AM             Msg. 5 of 5
In case of OSO's reject the second order became SUSPENDED and CANCELED.

You rejected the Cancel status FIX message. See the log:

8=FIX.4.4|9=230|35=8|34=5|49=OEC_TEST|52=20140108-16:07:42.908|56=MHall4001|1=API002218|6=0.000|11=1401081607230002|14=0|17=5225497|37=202868351|38=1|39=9|44=132.1|54=2|55=LE|58=Auto-Execute|60=20140108-16:07:42|150=9|151=1|200=201406|461=FXXXXS|10=181|
8=FIX.4.4|9=310|35=8|34=6|49=OEC_TEST|52=20140108-16:07:42.924|56=MHall4001|1=API002218|6=0.000|11=OECFIX:202868352|14=0|17=OECFIX:635245560331309946:2244|37=202868351|38=1|39=4|41=1401081607230002|44=132.1|54=2|55=LE|58=Auto-cancelled|60=20140108-16:07:42|150=4|151=1|200=201406|325=Y|377=N|461=FXXXXS|12073=1401081607230002|10=210|
8=FIX.4.4|9=126|35=3|34=3|49=MHall4001|52=20140108-16:07:41.224|56=OEC_TEST|45=6|58=Tag not defined for this message type|371=325|372=8|373=2|10=202|

Vitaliy Pfau