LWF orders are supported in FIX 5.0.
Parameters
All values for
TimeInForce, SelfTradePrevention, and PostOnly are supported.
Summary
CashOrderQty on limit orders is available for both buy and sell orders despite the following example featuring a buy order.OrdType=1|Side=1|CashOrderQty=30000
However, a market order leaves the executed price out of the client’s control.
With the following market state:
You can try to trade $30,000 of BTC by placing a limit buy order. To do this you must perform the
notional/price division to calculate the necessary OrderQty. The resulting order would look like:
OrdType=2|Side=1|Price=60000|OrderQty=0.5
If this order is filled at $2,000, then everything works as intended. In actuality, the market may change from the time in between when the user submits the order and when it is received by the exchange.
To illustrate, consider the case where the market state has changed to the following at the time when the exchange receives your order:
Your order now fills at 29,500, which is less than what you originally wanted.
To solve this issue, you can specify
CashOrderQty instead of OrderQty:
OrdType=2|Side=1|Price=60000|CashOrderQty=30000
Given the same market state:
The order will be filled as taker with quantity
0.50847457, making the total notional of this order $29,999.9996.
In a separate example, with the following market state:
Your order will fill as a taker at price 17850 notional will be filled. The remaining 60,000 with quantity
0.2025.
Caveats
- Orders may be filled at less than the notional specified due to fees and truncation of product base increment.
- TPSL / Stop / Batch orders are not be supported with this feature.
- OrderCancelReplaceRequest with
CashOrderQtyis not supported.
Market Data
OrderQty/CumQty/LeavesQtyis supplied in all Execution Reports. In particularOrderQtyis calculated after the order has been processed as a taker (i.e., it is NOT calculated withCashOrderQty / Price), such that all quantity tags are consistent with one another.Sizefield is populated in all WebSocket feed messages. No changes are expected from the perspective of a WebSocket consumer.
Examples
In the following examples, all irrelevant tags are omitted.Example 1 - A buy GTC order partially fills before resting
Example 1 - A buy GTC order partially fills before resting
CashOrderQty in the ExecutionReport is not $1,000 due to fees and base increment truncation.0.03 * $2951.86666... = $88.556.The remaining notional of $996.01591412 - $88.556 = $907.45991412 will rest on the book with a quantity of $907.45991412 / $2952 = 0.30740512.Note that OrderQty = CumQty + LeavesQty. In the case of this specific order we have: 0.03 + 0.30740512 = 0.33740512.The order is now rested on the book and be filled as passive.Example 2 - A buy IOC order that results in no fills
Example 2 - A buy IOC order that results in no fills
OrderQty is 0 in this case and this order will not be published in public WebSocket channels. It appears in the user channel only for this particular client.Example 3 - A sell GTC order with Self Trade Prevention (decrement and cancel)
Example 3 - A sell GTC order with Self Trade Prevention (decrement and cancel)
LeavesQty of 0.025 that was self trade cancelled: