Compare commits

...
6 changed files with 31 additions and 9 deletions

No files matched your search

@@ -83,8 +83,15 @@ _end_state_worker (this, other._end_state_worker){
/****************************External Calls**************************/
/********************************************************************/
void SingleFillHedger::init_hedger (Price price,
Quantity quantity){
_worker->init(price,quantity);
Quantity quantity,
ChildOrder* order){
if(order!=nullptr && !_spreader.in_cache_warming_cycle()){
_child_order_state.re_init(*order);
_child_order_state.modify_order(price,quantity);
_switch_state (&_working_state_worker);
}
else
_worker->init(price,quantity);
}
void SingleFillHedger::on_order_update(const SpreaderChildOrderState& u){
//bts_assert (u.order_key() == _order.order_key());
@@ -93,7 +93,8 @@ public:
//that live in the START state until...
//iii.until init_hedger is called which sets the price
//qty and causes the order to be submitted
void init_hedger (Price price, Quantity quantity);
void init_hedger (Price price, Quantity quantity,
ChildOrder* order = nullptr);
//b. called by the spreader when there is an order update
// reported by the exchange
void on_order_update(const SpreaderChildOrderState& order_update_message);
@@ -118,7 +118,9 @@ void SingleLegQuoter::update_other_leg_fills(size_t leg_index,
"spread_key:{} leg_idx:{} fill_idx:{} filled_quantity:{}",
_spreader.spreader_order_key(), _this_leg_data.leg_index(),
leg_index, filled_quantity);
_worker->on_other_leg_quoter_fill (leg_index, filled_quantity);
// SP-44
terminate();
//_worker->on_other_leg_quoter_fill (leg_index, filled_quantity);
}
void SingleLegQuoter::update_order_price_quantity(Price price,
Quantity quantity){
@@ -35,8 +35,8 @@ public:
llevel(Info),
forced_fill_qty(0),
fill_mult(1),
last_cache_warm_fill_ts()
{}
last_cache_warm_fill_ts(){
}
void set_forced_flag(){
in_cache_warming_cycle=true;
llevel = NoLog;
@@ -62,11 +62,18 @@ public:
// const accessors ////////////////////
///////////////////////////////////////
OrderKey order_key() const {
if (_is_live)
return _child_order.key();
if (_is_live){
// SP-44
if (_child_order.is_active())
return _child_order.key();
return OrderKey(0);
}
else
return _test_only_order_key;
}
ChildOrder& child_order() {
return _child_order;
}
api::orderman::OrderStatus status () const {
return _status;
}
@@ -183,7 +183,12 @@ public:
SingleFillHedger& add_new_hedger(bts::Price hedge_price,
bts::Quantity hedge_quantity){
SingleFillHedger& rv = _hedger_manager.get_hedger();
rv.init_hedger (hedge_price,hedge_quantity);
ChildOrder* p = nullptr;
if(_leg_property_data.is_active_quoting()){
bts_assert(_quoter_child_order_state!=nullptr);
p = &(_quoter_child_order_state->child_order());
}
rv.init_hedger (hedge_price,hedge_quantity,p);
return rv;
}
};