diff --git a/doc/user/content/release_notes/_index.md b/doc/user/content/release_notes/_index.md index 7746bd20f..8f1c26d04 100644 --- a/doc/user/content/release_notes/_index.md +++ b/doc/user/content/release_notes/_index.md @@ -4,6 +4,10 @@ weight = 3 sort_by = "weight" insert_anchor_links = "right" +++ +## 2.11.0 +### Internal Changes + - Added support for tag 1031. Currently defaults to Y, can it be override through config. + ## 2.10.0 ### User Visible Changes - Fills now include information about the algo that originated the fill diff --git a/src/lib/api/services/OrderService.proto b/src/lib/api/services/OrderService.proto index 091487e66..f2b48d8fb 100644 --- a/src/lib/api/services/OrderService.proto +++ b/src/lib/api/services/OrderService.proto @@ -327,6 +327,7 @@ message RoutingRecord { string smp_id = 6 ; SelfMatchPreventionInstruction smp_instruction = 7; string location = 8; + string cust_order_handling_inst = 9; } message NativeOrderState { diff --git a/src/lib/config/protos/orderman_cfg.proto b/src/lib/config/protos/orderman_cfg.proto index 5d899ea95..aee3e0802 100644 --- a/src/lib/config/protos/orderman_cfg.proto +++ b/src/lib/config/protos/orderman_cfg.proto @@ -9,4 +9,5 @@ message OrdermanCfg { } repeated Executor executor = 1; optional uint32 default_iceberg_pause_secs = 2 [default = 0]; + optional string fallback_cust_order_handling_inst = 3 [default = "Y"]; } diff --git a/src/lib/jetfix/codec/FieldDefinitions.h b/src/lib/jetfix/codec/FieldDefinitions.h index f1bacd704..cad3503e0 100644 --- a/src/lib/jetfix/codec/FieldDefinitions.h +++ b/src/lib/jetfix/codec/FieldDefinitions.h @@ -9,6 +9,7 @@ namespace jetfix { namespace fix { typedef BoolField<1028> ManualOrderIndicator; +typedef StringField<1031> CustOrderHandlingInst; typedef BoolField<123> GapFillFlag; typedef BoolField<43> PossDupFlag; typedef BoolField<9768> InFlightMitigation; diff --git a/src/lib/jetfix/codec/MessageDefinitions.h b/src/lib/jetfix/codec/MessageDefinitions.h index 197f5580f..1674673f5 100644 --- a/src/lib/jetfix/codec/MessageDefinitions.h +++ b/src/lib/jetfix/codec/MessageDefinitions.h @@ -45,7 +45,8 @@ typedef FIXMsg + TransactTimeStr, + CustOrderHandlingInst > ExecutionReportMsg; typedef FIXMsg diff --git a/src/lib/orderman/actors/ExecutionGateway.cpp b/src/lib/orderman/actors/ExecutionGateway.cpp index c14fff3f0..84805ba4d 100644 --- a/src/lib/orderman/actors/ExecutionGateway.cpp +++ b/src/lib/orderman/actors/ExecutionGateway.cpp @@ -260,6 +260,10 @@ void ExecutionGateway::on_exe_report( if (msg.has()) str_to(msg.get(), &data->exchange_fill_id); str_to(msg.get(), &data->transact_time); + + if (msg.has()) + data->cust_order_handling_inst = msg.get(); + data->cfg = &me->cfg; data->msg = text_msg; me->on_exe_report(*data, msg.trace()); diff --git a/src/lib/orderman/orderman_utils/ExecutionReport.h b/src/lib/orderman/orderman_utils/ExecutionReport.h index 6081be732..76b91a348 100644 --- a/src/lib/orderman/orderman_utils/ExecutionReport.h +++ b/src/lib/orderman/orderman_utils/ExecutionReport.h @@ -34,6 +34,7 @@ public: ExchangeFillID exchange_fill_id; mercury::TimeStampStr transact_time; config::JetFIX::Connection const *cfg; + std::string cust_order_handling_inst; std::string msg; }; diff --git a/src/lib/orderman/orders/NativeOrder.cpp b/src/lib/orderman/orders/NativeOrder.cpp index c32eca3e9..1bcdcf32a 100644 --- a/src/lib/orderman/orders/NativeOrder.cpp +++ b/src/lib/orderman/orders/NativeOrder.cpp @@ -15,6 +15,7 @@ #include "lib/orderman/securities/ISecurityDB.h" #include "lib/utils/PBUtils.h" #include "lib/utils/bts_chrono.h" +#include "lib/config/protos/orderman_cfg.pb.h" #include "lib/orderman/actors/order_manager/OrderServices.h" @@ -336,6 +337,7 @@ NativeOrder::on_init_from_exe_report(ExecutionReport const &er, rr.set_cti_code(CTICode(er.cfg->cti_code()[0])); rr.set_customer_or_firm(CustomerOrFirm(er.cfg->customer_or_firm())); rr.set_location(er.cfg->sender_locationid()); + rr.set_cust_order_handling_inst(er.cust_order_handling_inst); on_init_recovered(orecord, os); return orecord.def(); } @@ -1102,6 +1104,13 @@ void NativeOrder::report_state() { me->services->report_state(me->state); } +std::string NativeOrder::get_cust_order_handling_inst(api::orderman::RoutingRecord const&rr) { + if (rr.cust_order_handling_inst().size()) + return rr.cust_order_handling_inst(); + else + return config::get().fallback_cust_order_handling_inst(); +} + void NativeOrder::init_fix() { bts_assert(me->sec); @@ -1129,6 +1138,8 @@ void NativeOrder::init_fix() { create_encoding.add(rr.cti_code()); create_encoding.add(sec.glbx().security_desc()); create_encoding.add(clordid); + create_encoding.add (get_cust_order_handling_inst(rr)); + if (rr.smp_id().size()) { create_encoding.add(rr.smp_id()); if (rr.smp_instruction() != SELF_MATCH_PREVENTION_INSTRUCTION_UNDEFINED) @@ -1158,6 +1169,7 @@ void NativeOrder::init_fix() { update_encoding.add(clordid); update_encoding.add(clordid); update_encoding.add(true); + update_encoding.add (get_cust_order_handling_inst(rr)); // Self Match Protection if (rr.smp_id().size()) { update_encoding.add(rr.smp_id()); diff --git a/src/lib/orderman/orders/NativeOrder.h b/src/lib/orderman/orders/NativeOrder.h index e3b7d6fa4..517051347 100644 --- a/src/lib/orderman/orders/NativeOrder.h +++ b/src/lib/orderman/orders/NativeOrder.h @@ -71,6 +71,7 @@ class NativeOrder : public Order { void ignore_or_cancel(std::string const &, api::orderman::OrderError, OrderOpResult *out) ; + std::string get_cust_order_handling_inst(api::orderman::RoutingRecord const&) ; }; } // namespace orderman