[Simplified API] ClientId for Bracket Orders Not Saving

Custom indicators, trading strategies, data export and recording and more...
Gregory
Posts: 14
Joined: Thu Apr 11, 2019 10:13 pm
Has thanked: 4 times

[Simplified API] ClientId for Bracket Orders Not Saving

Post by Gregory » Thu Apr 25, 2019 3:21 pm

Bookmap version 7.1.0 build:7

Sending a parent order, with labels for the ClientId of the attached target and stop-loss orders:

Code: Select all

SimpleOrderSendParametersBuilder shortOrderSendParameters = new  SimpleOrderSendParametersBuilder (alias, false, 1);
shortOrderSendParameters.setLimitPrice(bidPrices.get(0));
shortOrderSendParameters.setTakeProfitOffset(10);
shortOrderSendParameters.setStopLossClientId("shortStop");
shortOrderSendParameters.setTakeProfitClientId("shortTarget");
shortOrderSendParameters.setClientId("shortParent");
shortOrderSendParameters.setStopLossOffset(settings.stopLoss);
OrderSendParameters shortOrder = shortOrderSendParameters.build();
api.sendOrder(shortOrder);
*-trading.log file
Here we see the parent order is placed:

Code: Select all

20190425 14:36:32.774(UTC) TRADE: onOrderUpdated (upper): class velox.api.layer1.data.OrderInfoUpdate{instrumentAlias=F.US.ENQM19@CQG, orderId=1, isBuy=false, type=LMT, clientId=shortParent, doNotIncrease=false, filled=0, filledChanged=true, unfilled=1, unfilledChanged=true, averageFillPrice=NaN, averageFillPriceChanged=true, duration=GTC, durationChanged=true, status=WORKING, statusChanged=true, limitPrice=7741.0, limitPriceChanged=true, stopPrice=NaN, stopPriceChanged=true, stopTriggered=false, stopTriggeredChanged=true, modificationUtcTime=0, modificationTimeChanged=true}
20190425 14:36:32.775(UTC) TRADE: onOrderUpdated (upper): class velox.api.layer1.data.OrderInfoUpdate{instrumentAlias=F.US.ENQM19@CQG, orderId=1, isBuy=false, type=LMT, clientId=shortParent, doNotIncrease=false, filled=0, filledChanged=true, unfilled=1, unfilledChanged=true, averageFillPrice=NaN, averageFillPriceChanged=true, duration=GTC, durationChanged=true, status=WORKING, statusChanged=true, limitPrice=7741.0, limitPriceChanged=true, stopPrice=NaN, stopPriceChanged=true, stopTriggered=false, stopTriggeredChanged=true, modificationUtcTime=0, modificationTimeChanged=true}
20190425 14:36:32.782(UTC) TRADE: onOrderUpdated (upper): class velox.api.layer1.data.OrderInfoUpdate{instrumentAlias=F.US.ENQM19@CQG, orderId=1, isBuy=false, type=LMT, clientId=shortParent, doNotIncrease=false, filled=0, filledChanged=true, unfilled=1, unfilledChanged=true, averageFillPrice=NaN, averageFillPriceChanged=true, duration=GTC, durationChanged=true, status=WORKING, statusChanged=true, limitPrice=7741.0, limitPriceChanged=true, stopPrice=NaN, stopPriceChanged=true, stopTriggered=false, stopTriggeredChanged=true, modificationUtcTime=0, modificationTimeChanged=true}
And here the order is executed and we see the child orders being updated:

Code: Select all

20190425 14:40:01.451(UTC) TRADE: onOrderExecuted (upper): class velox.api.layer1.data.ExecutionInfo{orderId=1, size=1, price=7735.75, executionId=0, time=1555988830200000000}
20190425 14:40:56.118(UTC) TRADE: onOrderUpdated (upper): class velox.api.layer1.data.OrderInfoUpdate{instrumentAlias=F.US.ENQM19@CQG, orderId=2, isBuy=true, type=STP, clientId=null, doNotIncrease=true, filled=0, filledChanged=true, unfilled=0, unfilledChanged=true, averageFillPrice=NaN, averageFillPriceChanged=true, duration=GTC, durationChanged=true, status=WORKING, statusChanged=true, limitPrice=NaN, limitPriceChanged=true, stopPrice=7737.25, stopPriceChanged=true, stopTriggered=true, stopTriggeredChanged=true, modificationUtcTime=0, modificationTimeChanged=true}
20190425 14:40:56.120(UTC) TRADE: onOrderUpdated (upper): class velox.api.layer1.data.OrderInfoUpdate{instrumentAlias=F.US.ENQM19@CQG, orderId=2, isBuy=true, type=STP, clientId=null, doNotIncrease=true, filled=0, filledChanged=true, unfilled=0, unfilledChanged=true, averageFillPrice=NaN, averageFillPriceChanged=true, duration=GTC, durationChanged=true, status=FILLED, statusChanged=true, limitPrice=NaN, limitPriceChanged=true, stopPrice=7737.25, stopPriceChanged=true, stopTriggered=true, stopTriggeredChanged=true, modificationUtcTime=0, modificationTimeChanged=true}
20190425 14:40:56.121(UTC) TRADE: onOrderUpdated (upper): class velox.api.layer1.data.OrderInfoUpdate{instrumentAlias=F.US.ENQM19@CQG, orderId=3, isBuy=true, type=LMT, clientId=null, doNotIncrease=true, filled=0, filledChanged=true, unfilled=0, unfilledChanged=true, averageFillPrice=NaN, averageFillPriceChanged=true, duration=GTC, durationChanged=true, status=CANCELLED, statusChanged=true, limitPrice=7734.75, limitPriceChanged=true, stopPrice=NaN, stopPriceChanged=true, stopTriggered=false, stopTriggeredChanged=true, modificationUtcTime=0, modificationTimeChanged=true}
20190425 14:40:56.121(UTC) TRADE: onOrderUpdated (upper): class velox.api.layer1.data.OrderInfoUpdate{instrumentAlias=F.US.ENQM19@CQG, orderId=3, isBuy=true, type=LMT, clientId=null, doNotIncrease=true, filled=0, filledChanged=true, unfilled=0, unfilledChanged=true, averageFillPrice=NaN, averageFillPriceChanged=true, duration=GTC, durationChanged=true, status=CANCELLED, statusChanged=true, limitPrice=7734.75, limitPriceChanged=true, stopPrice=NaN, stopPriceChanged=true, stopTriggered=false, stopTriggeredChanged=true, modificationUtcTime=0, modificationTimeChanged=true}
20190425 14:40:56.121(UTC) TRADE: onOrderExecuted (upper): class velox.api.layer1.data.ExecutionInfo{orderId=2, size=1, price=7737.25, executionId=1, time=1555989705000000000}
The ClientId appears as null in the child orders, though having been assigned through the parent. Maybe I'm missing something

Thanks,
Greg

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: [Simplified API] ClientId for Bracket Orders Not Saving

Post by Andry API support » Fri Apr 26, 2019 10:14 am

Hi Gregory,
- was that live or replay
- which provider (aka platform aka exchange) were you using
- if replay, could you send me your feed file pls

Gregory
Posts: 14
Joined: Thu Apr 11, 2019 10:13 pm
Has thanked: 4 times

Re: [Simplified API] ClientId for Bracket Orders Not Saving

Post by Gregory » Fri Apr 26, 2019 2:11 pm

This is in replay with CQG, but it also happens live with CQG. Here is a link to the 14mb BMF file i'm using,
https://file.io/whFhMc

Do you have an example from v2 of the API for sending/updating an order so it will retain those ClientId labels?

Thanks,
Greg

Andry API support
Posts: 548
Joined: Mon Jul 09, 2018 11:18 am
Has thanked: 25 times
Been thanked: 85 times

Re: [Simplified API] ClientId for Bracket Orders Not Saving

Post by Andry API support » Fri Apr 26, 2019 3:20 pm

This is a CQG-specific issue, we're solving it. If the issue is on our side (if it is caused by our CQG adapter), we'll fix it. The issue may also be on CQG's side.
Other adapters should work correctly.

Post Reply