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)
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.
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.