|
|
@@ -951,7 +951,7 @@ impl Strategy {
|
|
|
// let one_hand_long_value = dec!(0.99) * (self.max_long_value / self.grid);
|
|
|
// let one_hand_short_value = dec!(0.99) * (self.max_short_value / self.grid);
|
|
|
// 挂多单
|
|
|
- if self.post_side >= 0 && buy_value == Decimal::ZERO && predictor.optimal_bid_price < predictor.mid_price && predictor.inventory <= Decimal::ZERO {
|
|
|
+ if self.post_side >= 0 && buy_value == Decimal::ZERO && predictor.inventory <= Decimal::ZERO {
|
|
|
let mut target_buy_price = predictor.optimal_bid_price;
|
|
|
// target_buy_price = utils::clip(target_buy_price, self.bp * dec!(0.97), self.ap * dec!(1.0005));
|
|
|
target_buy_price = utils::fix_price(target_buy_price, self.tick_size);
|
|
|
@@ -991,7 +991,7 @@ impl Strategy {
|
|
|
}
|
|
|
}
|
|
|
// 挂空单
|
|
|
- if self.post_side <= 0 && sell_value == Decimal::ZERO && predictor.optimal_ask_price > predictor.mid_price && predictor.inventory >= Decimal::ZERO {
|
|
|
+ if self.post_side <= 0 && sell_value == Decimal::ZERO && predictor.inventory >= Decimal::ZERO {
|
|
|
let mut target_sell_price = predictor.optimal_ask_price;
|
|
|
// target_sell_price = utils::clip(target_sell_price, self.bp * dec!(0.9995), self.ap * dec!(1.03));
|
|
|
// 取消大小限制
|
|
|
@@ -1110,7 +1110,7 @@ impl Strategy {
|
|
|
self.fix_price(predictor);
|
|
|
|
|
|
self._cancel_open(&mut command, local_orders); // 撤单命令处理
|
|
|
- // self._post_open(&mut command, local_orders, predictor); // 限价单命令处理
|
|
|
+ self._post_open(&mut command, local_orders, predictor); // 限价单命令处理
|
|
|
self._check_local_orders(&mut command, local_orders); // 固定时间检查超时订单
|
|
|
self._update_in_cancel(&mut command, local_orders); // 更新撤单队列,是一个filter
|
|
|
self._check_request_limit(&mut command); // 限制频率,移除不合规则之订单,是一个filter
|