39 lines
992 B
C++
39 lines
992 B
C++
#include "PricerOrder.h"
|
|
|
|
#include "lib/orderman/OrderBuilder.h"
|
|
#include "lib/orderman/orders/spreader_orders/spreader/SpreaderUtils.h"
|
|
#include "lib/utils/PBUtils.h"
|
|
#include <google/protobuf/timestamp.pb.h>
|
|
|
|
namespace bts {
|
|
namespace orderman {
|
|
|
|
using namespace api::orderman;
|
|
|
|
struct PricerOrder::PImpl {
|
|
PImpl() {}
|
|
|
|
int32_t price_offset_ticks;
|
|
double price_factor;
|
|
};
|
|
|
|
PricerOrder::PricerOrder() : me(new PImpl()) {}
|
|
|
|
PricerOrder::~PricerOrder() {}
|
|
|
|
void PricerOrder::setup_child(
|
|
const api::orderman::OrderDefinition &this_def,
|
|
const PreActivationOrderServices &,
|
|
api::orderman::OrderState &initial_state,
|
|
api::orderman::OrderDefinition *out_child) {
|
|
initial_state.mutable_pricer();
|
|
auto const &pricer_def = this_def.custom_def().pricer();
|
|
*out_child->mutable_custom_def() = pricer_def.child();
|
|
|
|
me->price_offset_ticks = pricer_def.price_offset_ticks();
|
|
me->price_factor = pricer_def.price_factor();
|
|
}
|
|
|
|
} // namespace orderman
|
|
} // namespace bts
|