added logs in Lean to detect the out-of-the-gate fill situation

This commit is contained in:
Taha Afzal committed 2019-05-01 14:00:18 -04:00
1 parent 59ba9dc129
commit 04eee0f4b7
1 file changed
+14 -1
@@ -54,6 +54,10 @@ void LeanAlgo::do_launch(IAlgoServices& algo) {
me->algo_services = &algo;
bts_assert(me->child_template);
me->child_key = algo.launch_child(*me->child_template, algo.price(), algo.quantity());
LOG(OrderMan, Info,
"LeanAlgo::do_launch key:{} child_key:{} price:{} qty:{}",
algo.order_key().value(),me->child_key,
algo.price(),algo.quantity());
algo.subscribe_book(SecurityKey(algo.definition().security_key()));
}
void LeanAlgo::do_launch_attached(IAlgoServices&algo,OrderKey k, ChildState st) {
@@ -110,7 +114,12 @@ void LeanAlgo::on_book(SecurityKey, const Book &book) {
break;
}
}
void LeanAlgo::on_child_change(OrderKey, const ChildState &st) {
void LeanAlgo::on_child_change(OrderKey key, const ChildState &st) {
LOG(OrderMan, Info,
"LeanAlgo::on_child_change key:{} child_key:{} status:{} total_fills:{} "
"last_price:{}",
algo().order_key().value(),key,
static_cast<int>(st.status),st.total_fills,st.last_price);
algo().update_fill_state(st.total_fills, st.last_price);
switch (st.status) {
case ChildStatus::WORKING:
@@ -254,6 +263,10 @@ bool LeanAlgo::_try_cross() {
Update child_update;
child_update.set_price(me->observed_price.value()),
child_update.set_quantity(algo().quantity().value());
LOG(OrderMan, Info, "LeanAlgo::_try_cross updating child "
"key:{} child_key:{} price:{} qty:{}",
algo().order_key().value(),me->child_key,
child_update.price(),child_update.quantity());
algo().update_child(me->child_key, child_update);
return true;
}