Fixing problem with TaskingEye for fractional shot qtys
This commit is contained in:
1 parent
1e4d8584c7
commit
ab70c9dfb1
2 files changed
+8
-4
No files matched your search
+1
-1
Submodule docker/linux updated: 6537812262...56c61231f3.
@@ -148,7 +148,7 @@ TaskingEyeAlgo::~TaskingEyeAlgo() {}
|
||||
OrderOpResult TaskingEyeAlgo::do_before_launch(
|
||||
IBeforeLaunchAlgoServices &serv) {
|
||||
auto is_data_valid = [&]() {
|
||||
return greater_then_eq(1, me->shot_size) &&
|
||||
return greater_then_eq(0, me->shot_size) &&
|
||||
greater_then_eq(1, me->target_qty) &&
|
||||
greater_then_eq(1, me->max_shots_per_window) &&
|
||||
greater_then_eq(1000000000, me->window_size_nanos) &&
|
||||
@@ -351,6 +351,10 @@ void TaskingEyeAlgo::_evaluate_and_shoot() {
|
||||
TEASecData &sec_data = it->second;
|
||||
auto ch_ord_key =
|
||||
me->service_ptr->launch_child(*sec_data.order, price, qty);
|
||||
LOG(OrderMan, Info,
|
||||
"TakingEyeAlgo::_evaluate_and_shoot ord_key: {} child_ord_key: {} "
|
||||
"price: {} qty: {}",
|
||||
me->service_ptr->order_key(), ch_ord_key, price, qty.full_value());
|
||||
me->shots.push_back(TEAShot{sec_key, ch_ord_key});
|
||||
}
|
||||
}
|
||||
@@ -387,7 +391,7 @@ bool TaskingEyeAlgo::_in_shooting_zone(
|
||||
if (greater_then_eq(1, md_ask.size()) &&
|
||||
greater_then_eq(md_ask.price(), ee_buy_pr)) {
|
||||
price = Price(md_ask.price());
|
||||
qty = std::min(md_ask.size(), (uint)me->shot_size);
|
||||
qty = std::min(static_cast<double>(md_ask.size()), me->shot_size);
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
@@ -400,7 +404,7 @@ bool TaskingEyeAlgo::_in_shooting_zone(
|
||||
if (greater_then_eq(1, md_bid.size()) &&
|
||||
greater_then_eq(ee_sell_pr, md_bid.price())) {
|
||||
price = Price(md_bid.price());
|
||||
qty = std::min(md_bid.size(), (uint)me->shot_size);
|
||||
qty = std::min(static_cast<double>(md_bid.size()), me->shot_size);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user