Order ID vs Client ID, OrderInfo, and OrderInfoBuilder

Connections to new exchanges, data vendors and trading systems or proprietary Quant solution for HFT firms
Serg
Posts: 113
Joined: Mon Jun 11, 2018 12:40 pm
Has thanked: 15 times
Been thanked: 35 times

Order ID vs Client ID, OrderInfo, and OrderInfoBuilder

Post by Serg » Wed Jul 04, 2018 2:55 pm

It's the responsibility of the L0 adapter to communicate the information about working orders and position to Bookmap upon connection and then in real-time. Bookmap displays whatever it receives from the adapter.

Here is an explanation about orderId and clientId which are members of OrderInfo:

Code: Select all

public OrderInfoBuilder(java.lang.String instrumentAlias,
                        java.lang.String orderId,
                        boolean isBuy,
                        OrderType type,
                        java.lang.String clientId,
                        boolean doNotIncrease)
orderId
Use orderId for referencing to the order between the adapter and Bookmap. It must be unique, typically set by the exchange, but from Bookmap perspective it doesn't matter whether it was set by exchange or by the adapter.

clientId
If the order was generated by user from Bookmap chart, do not modify clientId. In other cases the adapter can assign to it any value including null. Bookmap uses clientId only in cases when it needs to track its status. For instance, if user clicks "Reverse position" or "Flatten position" buttons, multiple times, this field allows Bookmap to ignore the clicks until it gets a response on the previously sent order. In other cases when user sends an order from the chart, Bookmap passes it to the adapter and "forgets" about it. When it comes back confirmed and with orderId, Bookmap will treat it same way as if the order was initiated from outside of Bookmap.

aris
Posts: 4
Joined: Thu Jul 05, 2018 1:32 am

Re: Order ID vs Client ID, OrderInfo, and OrderInfoBuilder

Post by aris » Thu Jul 05, 2018 1:34 am

Thank you Sergey. This is very helpful.

agan1337
Posts: 10
Joined: Tue Dec 10, 2019 9:31 pm
Been thanked: 1 time

Re: Order ID vs Client ID, OrderInfo, and OrderInfoBuilder

Post by agan1337 » Fri Jun 05, 2020 5:03 pm

Hi Serg,

Thank you very much !

AG

Post Reply