Merge branch 'spartan_tas' of bitbucket.org:bluetradesys/spark into spartan_tas
This commit is contained in:
commit
ed0eb9be19
1 file changed
+26
-14
@@ -71,7 +71,7 @@ struct SecData{
|
||||
SpreaderUtils::book_to_str(bk, api::Side::SIDE_SELL));
|
||||
use_look_ahead_book = false;
|
||||
last_book = current_book;
|
||||
current_book = bk;
|
||||
current_book = bk;
|
||||
}
|
||||
const Book& get_current_book(){
|
||||
return use_look_ahead_book ? look_ahead_book : current_book;
|
||||
@@ -84,14 +84,24 @@ struct SecData{
|
||||
agg_side,
|
||||
last_price,last_qty,
|
||||
look_ahead_book);
|
||||
if(detailed_logging && use_look_ahead_book)
|
||||
LOG(OrderMan, Info, "Normal->Lookahead "
|
||||
"agg:{} pr:{} qty:{} {} {} -> {} {}",
|
||||
agg_side, last_price, last_qty,
|
||||
SpreaderUtils::book_to_str(current_book, api::Side::SIDE_BUY),
|
||||
SpreaderUtils::book_to_str(current_book, api::Side::SIDE_SELL),
|
||||
SpreaderUtils::book_to_str(look_ahead_book, api::Side::SIDE_BUY),
|
||||
SpreaderUtils::book_to_str(look_ahead_book, api::Side::SIDE_SELL));
|
||||
LOG(OrderMan, Info, "SecData::on_trade_signal skey:{} use_la:{}",
|
||||
security.id(), use_look_ahead_book);
|
||||
if(detailed_logging){
|
||||
if(use_look_ahead_book)
|
||||
LOG(OrderMan, Info, "Normal->Lookahead succeeded "
|
||||
"agg:{} pr:{} qty:{} {} {} -> {} {}",
|
||||
agg_side, last_price, last_qty,
|
||||
SpreaderUtils::book_to_str(current_book, api::Side::SIDE_BUY),
|
||||
SpreaderUtils::book_to_str(current_book, api::Side::SIDE_SELL),
|
||||
SpreaderUtils::book_to_str(look_ahead_book, api::Side::SIDE_BUY),
|
||||
SpreaderUtils::book_to_str(look_ahead_book, api::Side::SIDE_SELL));
|
||||
else
|
||||
LOG(OrderMan, Info, "Normal->Lookahead failed "
|
||||
"agg:{} pr:{} qty:{} {} {}",
|
||||
agg_side, last_price, last_qty,
|
||||
SpreaderUtils::book_to_str(current_book, api::Side::SIDE_BUY),
|
||||
SpreaderUtils::book_to_str(current_book, api::Side::SIDE_SELL));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -475,8 +485,8 @@ void log_polygon_eval(OrderKey ok, const SniperPolygon& p,
|
||||
// logs only if the opp changes
|
||||
//((f_imp == SniperAlgo::FireImpetus::Book) ? "Book" : "Lookahead")) :
|
||||
if(is_curr_opp != is_prev_opp){
|
||||
std::string new_opp = is_curr_opp ? "Sniper Opp Created" :
|
||||
"Sniper Opp Vanished";
|
||||
std::string new_opp = is_curr_opp ? "Sniper Opp Created " :
|
||||
"Sniper Opp Vanished ";
|
||||
new_opp.append(f_imp == SniperAlgo::FireImpetus::Book ? "Book" : "Lookahead");
|
||||
std::string leg_markets = leg_value_txt(side);
|
||||
LOG(OrderMan, Warn, "{},{},{},{},{},{},{},{},{} -> {},{},{},{}",
|
||||
@@ -748,6 +758,9 @@ void SniperAlgo::_fire_orders(SecData& sec_data,FireImpetus f_imp){
|
||||
LOG(OrderMan, Info, "Cumm price/qty constraint prevented shooting");
|
||||
return;
|
||||
}
|
||||
LOG(OrderMan, Info, "Firing Polygon pid:{} skey:{} f_imp:{} corid:{}",
|
||||
p.pid, sec_data.security.id(),
|
||||
static_cast<int>(f_imp), p.latest_bk_corid.sn);
|
||||
for (auto& l : p.legs){
|
||||
auto[pr,qty] = l.cross_value.price_qty(poly_side);
|
||||
auto[order_template,side] = get_leg_order_template(poly_side,l);
|
||||
@@ -755,9 +768,8 @@ void SniperAlgo::_fire_orders(SecData& sec_data,FireImpetus f_imp){
|
||||
l.sec_data.security, side);
|
||||
payup_pr = Price(bts::securities::raw_round_to_quote_price (
|
||||
payup_pr.value(), l.sec_data.security.contract_spec().low_tick(),side));
|
||||
LOG(OrderMan, Info, "Firing Order sk:{} pr:{} pu_pr:{} qty:{} sd:{} f_imp:{}",
|
||||
l.sec_data.security.id(), pr, payup_pr, qty, side,
|
||||
static_cast<int>(f_imp));
|
||||
LOG(OrderMan, Info, "Firing Order sk:{} pr:{} pu_pr:{} qty:{} sd:{}",
|
||||
l.sec_data.security.id(), pr, payup_pr, qty, side);
|
||||
l.working_order =
|
||||
me->algo_services->launch_child(order_template,payup_pr,qty);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user