Page 1 of 1

Order ID vs Client ID, OrderInfo, and OrderInfoBuilder

Posted: Wed Jul 04, 2018 2:55 pm
by Serg
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.

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

Posted: Thu Jul 05, 2018 1:34 am
by aris
Thank you Sergey. This is very helpful.

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

Posted: Fri Jun 05, 2020 5:03 pm
by agan1337
Hi Serg,

Thank you very much !

AG