Fix for cancel/replace

This commit is contained in:
Eric Harding committed 2020-06-10 14:13:28 -04:00
1 parent aba3f21020
commit 6a679ff78c
1 file changed
+9 -17
+9 -17
View File
@@ -288,26 +288,19 @@ void ILinkGW::send_order(const CreateOrderMsg& create) {
auto party = send_party_details(*create.routing_record);
auto msg = _buffer.frame<iLinkBinary::NewOrderSingle514>();
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());