Allow cover order to continue even if hedgding child is canceled.
This commit is contained in:
1 parent
0af5b78318
commit
3dda3e7f75
1 file changed
+1
-6
@@ -134,17 +134,12 @@ void CoverAlgo::on_child_change(OrderKey k, ChildState const &st) {
|
||||
switch (st.status) {
|
||||
case ChildStatus::WORKING:
|
||||
break;
|
||||
case ChildStatus::CANCELED:
|
||||
case ChildStatus::COMPLETED:
|
||||
if (auto it = std::find(me->hedges.begin(), me->hedges.end(), k);
|
||||
it != me->hedges.end())
|
||||
me->hedges.erase(it);
|
||||
break;
|
||||
case ChildStatus::CANCELED:
|
||||
LOG(OrderMan, Info, "CoverAlgo {}. Hedge was canceled, terminating",
|
||||
algo().order_key().value());
|
||||
me->status = Status::DONE;
|
||||
algo().terminate_error("Unexpected child cancel");
|
||||
break;
|
||||
}
|
||||
}
|
||||
check_terminate();
|
||||
|
||||
Reference in new issue
Block a user