35 lines
1.4 KiB
C++
35 lines
1.4 KiB
C++
#include "ExecutionReport.h"
|
|
#include "lib/api/services/OrderService.pb.h"
|
|
#include "lib/domain_model/Security.pb.h"
|
|
#include "lib/logging/logging.h"
|
|
#include "lib/orderman/orderman_utils/orderman_common.h"
|
|
#include <sstream>
|
|
|
|
namespace bts {
|
|
namespace orderman {
|
|
|
|
using namespace bts::api::orderman;
|
|
|
|
std::string ExecutionReport::to_string() const {
|
|
std::ostringstream rv;
|
|
rv << "account_name: " << to_trim_str(account_name)
|
|
<< " operator_id: " << to_trim_str(operator_id)
|
|
<< " order_key: " << order_key.value() << " msg_seq_num: " << msg_seq_num
|
|
<< " security: " << security->id()
|
|
<< " leg_security: " << (leg_security == nullptr ? 0 : leg_security->id())
|
|
<< " side: " << bts::api::Side_Name(side) << " time_in_force: "
|
|
<< bts::api::orderman::TimeInForce_Name(time_in_force)
|
|
<< " order_type: " << bts::api::orderman::NativeOrderType_Name(order_type)
|
|
<< " exec_type: " << bts::api::orderman::ExecType_Name(exec_type)
|
|
<< " order_status: "
|
|
<< bts::api::orderman::NativeOrderStatus_Name(order_status)
|
|
<< " price: " << price.value() << " quantity: " << quantity
|
|
<< " filled_quantity: " << filled_quantity
|
|
<< " avg_price: " << avg_price.value() << " last_shares: " << last_shares
|
|
<< " last_price: " << last_price.value() << " msg: " << msg
|
|
<< " exchange: " << bts::api::Venue_Name(exchange);
|
|
return rv.str();
|
|
}
|
|
|
|
} // namespace orderman
|
|
} // namespace bts
|