spreader post hedge should be < thresh not >

This commit is contained in:
Kevin Darby committed 2018-05-21 13:57:36 -04:00
1 parent 6ec39a9276
commit 23c8b60ea3
2 files changed
+7 -7

No files matched your search

@@ -458,16 +458,16 @@ public:
double& out_new_price)
{
const bts::spark::PostHedgeParams& post_hedge_params = leg_property_data.leg_params().post_hedge_params();
if (post_hedge_params.has_price_based_cross()){
if(post_hedge_price_based_forced_cross (curr_order_price, leg_property_data.trading_side(), book, leg_property_data.tick_size(), post_hedge_params.price_based_cross(), out_new_price))
return true;
}
if (post_hedge_params.has_opposite_market_volume_based_forced_cross()){
if (post_hedge_volume_based_forced_cross(curr_order_price, remaining_to_fill_qty, leg_property_data.trading_side(),
book, leg_property_data.tick_size(),
post_hedge_params.opposite_market_volume_based_forced_cross(),
out_new_price))
return true;
}
if (post_hedge_params.has_price_based_cross()){
if(post_hedge_price_based_forced_cross (curr_order_price, leg_property_data.trading_side(), book, leg_property_data.tick_size(), post_hedge_params.price_based_cross(), out_new_price))
return true;
}
return false;
}
@@ -515,14 +515,14 @@ public:
const md::PriceSize& opp_inside_price_size = book.side(api::Side::SIDE_SELL)[0];
// the price check is so that we dont repeatedly keep doing this
// im the short period where our hedge order change has not effected the book
if (opp_inside_price_size.size() > threshold.value() && out_price < opp_inside_price_size.price()){
if (opp_inside_price_size.size() < threshold.value() && out_price < opp_inside_price_size.price()){
out_new_price = opp_inside_price_size.price() + tick_size * volume_based_forced_cross.cross_ticks();
return true;
}
}
else{
const md::PriceSize& opp_inside_price_size = book.side(api::Side::SIDE_BUY)[0];
if (opp_inside_price_size.size() > threshold.value() && out_price > opp_inside_price_size.price()){
if (opp_inside_price_size.size() < threshold.value() && out_price > opp_inside_price_size.price()){
out_new_price = opp_inside_price_size.price() - tick_size * volume_based_forced_cross.cross_ticks();
return true;
}