Added account_id to ExchangePosition
This commit is contained in:
1 parent
e4291e1c51
commit
25d4c54284
5 files changed
+55
-14
No files matched your search
@@ -33,6 +33,7 @@
|
||||
#include "lib/utils/type_name.h"
|
||||
|
||||
#include <boost/algorithm/string/predicate.hpp>
|
||||
#include <optional>
|
||||
|
||||
namespace bts {
|
||||
namespace orderman {
|
||||
@@ -444,19 +445,23 @@ void OrderServiceServer::_on_exchange_position(
|
||||
ret_pos.set_record_id(id);
|
||||
ret_pos.set_security_key(p.security == nullptr ? 0 : p.security->id());
|
||||
ret_pos.set_security_resolved(p.security != nullptr);
|
||||
ret_pos.set_exchange_desc(p.exchange_sec_desc);
|
||||
ret_pos.set_account_name(p.account_name);
|
||||
ret_pos.set_account_id(
|
||||
p.account_id == std::nullopt ? 0 : p.account_id.value());
|
||||
ret_pos.set_account_resolved(p.account_id != std::nullopt);
|
||||
ret_pos.set_exchange_desc(p.exchange_sec_desc);
|
||||
ret_pos.set_exchange(ev.position.exchange);
|
||||
ret_pos.set_avg_filled_price(p.avg_filled_price.value());
|
||||
ret_pos.set_position(p.position);
|
||||
ret_pos.set_exchange(ev.position.exchange);
|
||||
me->exchange_pos_publisher.add_or_update(ret_pos);
|
||||
LOG(OrderMan, Info,
|
||||
"OrderServiceServer::_on_exchange_position publishing pos id: {} "
|
||||
"key: {} res: {} desc: {} exchange: {} account: {} filled_price: {} "
|
||||
"fills: {}",
|
||||
"key: {} res: {} account_name: {} account_id: {} account_resolved: "
|
||||
"{} desc: {} exchange: {} filled_price: {} fills: {}",
|
||||
ret_pos.record_id(), ret_pos.security_key(),
|
||||
ret_pos.security_resolved(), ret_pos.exchange_desc(),
|
||||
bts::api::Venue_Name(ret_pos.exchange()), ret_pos.account_name(),
|
||||
ret_pos.security_resolved(), ret_pos.account_name(),
|
||||
ret_pos.account_id(), ret_pos.account_resolved(),
|
||||
ret_pos.exchange_desc(), bts::api::Venue_Name(ret_pos.exchange()),
|
||||
ret_pos.avg_filled_price(), ret_pos.position());
|
||||
}
|
||||
me->exchange_pos_publisher.flush();
|
||||
|
||||
Reference in new issue
Block a user