Woark in progress to add support for update to stop limit and glbx iceberg.

This commit is contained in:
Pedro Pinto committed 2019-05-08 06:46:40 -04:00
1 parent 0cc30a7934
commit f60afe1196
1 file changed
+14 -5
+14 -5
View File
@@ -49,6 +49,7 @@ struct NativeOrder::PImpl {
jetfix::FIXFragment::Bookmark<jetfix::fix::Price> update_price_bm;
jetfix::FIXFragment::Bookmark<jetfix::fix::OrderQty> update_quantity_bm;
jetfix::FIXFragment::Bookmark<jetfix::fix::MaxShow> update_max_show_bm;
jetfix::FIXFragment::Bookmark<jetfix::fix::StopPx> update_stop_px_bm;
jetfix::FIXFragment::Bookmark<jetfix::fix::TransactTimeStr>
update_transact_time_bm;
@@ -537,6 +538,16 @@ OrderOpResult NativeOrder::on_activate(Price p, Quantity q,
}
OrderOpResult NativeOrder::on_update(Price p, Quantity q) {
api::orderman::Update update;
update.set_price(p.value());
update.set_quantity(q.value());
return on_update(update);
}
OrderOpResult NativeOrder::on_update(api::orderman::Update const &update) {
auto p = Price(update.price());
auto q = Quantity(update.quantity());
auto scoped_log =
me->services->log_scope("NativeOrder::on_update", key().value());
auto result = OrderOpResult{};
@@ -648,10 +659,7 @@ OrderOpResult NativeOrder::on_update(Price p, Quantity q) {
}
report_state();
return result;
}
OrderOpResult NativeOrder::on_update(api::orderman::Update const &update) {
return on_update(Price(update.price()), Quantity(update.quantity()));
}
OrderOpResult NativeOrder::on_detach() { return OrderOpResult{}; }
@@ -1143,8 +1151,9 @@ void NativeOrder::init_fix() {
securities::encode_exchange_price(*me->sec, Price(stop_px)).value();
create_encoding.add<fix::StopPx>(encoded_stop_px,
me->price_encoding_precision, -1);
update_encoding.add<fix::StopPx>(encoded_stop_px,
me->price_encoding_precision, -1);
me->update_stop_px_bm =
update_encoding.add<fix::StopPx>(encoded_stop_px,
me->price_encoding_precision, price_sz());
break;
}