|
|
@@ -951,15 +951,11 @@ 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.inventory <= Decimal::ZERO {
|
|
|
+ if self.post_side >= 0 && buy_value == 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);
|
|
|
- let amount = if predictor.inventory <= dec!(-3) {
|
|
|
- utils::get_amount_by_min_amount_value(self.min_amount_value * predictor.inventory.abs(), target_buy_price, self.step_size)
|
|
|
- } else {
|
|
|
- utils::get_amount_by_min_amount_value(self.min_amount_value, target_buy_price, self.step_size)
|
|
|
- };
|
|
|
+ let amount = utils::get_amount_by_min_amount_value(self.min_amount_value, target_buy_price, self.step_size);
|
|
|
// let amount = if predictor.inventory < Decimal::ZERO {
|
|
|
// // utils::fix_amount(self.step_size * predictor.inventory.abs(), self.step_size)
|
|
|
// if predictor.level >= dec!(3) {
|
|
|
@@ -991,16 +987,12 @@ impl Strategy {
|
|
|
}
|
|
|
}
|
|
|
// 挂空单
|
|
|
- if self.post_side <= 0 && sell_value == Decimal::ZERO && predictor.inventory >= Decimal::ZERO {
|
|
|
+ if self.post_side <= 0 && sell_value == 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));
|
|
|
// 取消大小限制
|
|
|
target_sell_price = utils::fix_price(target_sell_price, self.tick_size);
|
|
|
- let amount = if predictor.inventory >= dec!(3) {
|
|
|
- utils::get_amount_by_min_amount_value(self.min_amount_value * predictor.inventory.abs(), target_sell_price, self.step_size)
|
|
|
- } else {
|
|
|
- utils::get_amount_by_min_amount_value(self.min_amount_value, target_sell_price, self.step_size)
|
|
|
- };
|
|
|
+ let amount = utils::get_amount_by_min_amount_value(self.min_amount_value, target_sell_price, self.step_size);
|
|
|
// let amount = if predictor.inventory > Decimal::ZERO {
|
|
|
// if predictor.level >= dec!(3) {
|
|
|
// utils::get_amount_by_min_amount_value(self.min_amount_value * predictor.inventory.abs(), target_sell_price, self.step_size)
|