From 6a679ff78c436c4e5253201082ae0f6082ed37ef Mon Sep 17 00:00:00 2001 From: Eric Harding Date: Wed, 10 Jun 2020 14:13:13 -0400 Subject: [PATCH] Fix for cancel/replace --- src/lib/orderman/actors/ilink3/ILinkGW.cpp | 26 ++++++++-------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/lib/orderman/actors/ilink3/ILinkGW.cpp b/src/lib/orderman/actors/ilink3/ILinkGW.cpp index 50108a2f0..479cc2416 100644 --- a/src/lib/orderman/actors/ilink3/ILinkGW.cpp +++ b/src/lib/orderman/actors/ilink3/ILinkGW.cpp @@ -288,26 +288,19 @@ void ILinkGW::send_order(const CreateOrderMsg& create) { auto party = send_party_details(*create.routing_record); auto msg = _buffer.frame(); - if (need_px(create.order_type)) { - msg.price().mantissa(to_price9(create.price)); - } - else { - msg.price().mantissa(iLinkBinary::PRICENULL9::mantissaNullValue()); - } + if (need_px(create.order_type)) { msg.price().mantissa(to_price9(create.price)); } + else { msg.price().mantissa(iLinkBinary::PRICENULL9::mantissaNullValue()); } msg.orderQty(create.quantity.value()); msg.securityID(create.security->glbx().exchange_id()); msg.side(map_side(create.side)); msg.seqNum(next_seq()); msg.putSenderID(create.routing_record->operator_id()); - // Store our order key in the create.key. Cannot store binary data. msg.putClOrdID(encode_clordid(create.key)); msg.partyDetailsListReqID(party); msg.orderRequestID(++_msg_count); msg.sendingTimeEpoch(_time.now()); - if (needs_stop_px(create.order_type)) { - msg.stopPx().mantissa(to_price9(create.stop_px)); - } - else msg.stopPx().mantissa(iLinkBinary::PRICENULL9::mantissaNullValue()); + if (needs_stop_px(create.order_type)) { msg.stopPx().mantissa(to_price9(create.stop_px)); } + else { msg.stopPx().mantissa(iLinkBinary::PRICENULL9::mantissaNullValue()); } msg.putLocation(create.routing_record->location()); msg.minQty(iLinkBinary::NewOrderSingle514::minQtyNullValue()); msg.displayQty(create.display_quantity.value()); @@ -336,20 +329,19 @@ void ILinkGW::send_cancel_replace(const CancelReplaceOrderMsg& replace) { msg.orderID(replace.exchange_order_id.value()); - msg.price().mantissa(to_price9(create.price)); + if (need_px(create.order_type)) { msg.price().mantissa(to_price9(create.price)); } + else { msg.price().mantissa(iLinkBinary::PRICENULL9::mantissaNullValue()); } msg.orderQty(create.quantity.value()); msg.securityID(create.security->glbx().exchange_id()); msg.side(map_side(create.side)); msg.seqNum(next_seq()); msg.putSenderID(create.routing_record->operator_id()); - // msg.putClOrdID(create.clordid); + msg.putClOrdID(encode_clordid(create.key)); msg.partyDetailsListReqID(party); msg.orderRequestID(++_msg_count); msg.sendingTimeEpoch(_time.now()); - if (needs_stop_px(create.order_type)) { - msg.stopPx().mantissa(to_price9(create.stop_px)); - } - else msg.stopPx().mantissa(iLinkBinary::PRICENULL9::mantissaNullValue()); + if (needs_stop_px(create.order_type)) { msg.stopPx().mantissa(to_price9(create.stop_px)); } + else { msg.stopPx().mantissa(iLinkBinary::PRICENULL9::mantissaNullValue()); } msg.putLocation(create.routing_record->location()); msg.minQty(iLinkBinary::NewOrderSingle514::minQtyNullValue()); msg.displayQty(create.display_quantity.value());