|
|
@@ -840,7 +840,7 @@ impl Strategy {
|
|
|
if order.side == "kd".to_string() {
|
|
|
// 在价格范围内时不处理
|
|
|
// if order.price <= long_upper && order.price >= long_lower {
|
|
|
- if (self.local_time - order.local_time <= 200) && (order.price <= long_upper && order.price >= long_lower) {
|
|
|
+ if (self.local_time - order.local_time <= 500) && (order.price <= long_upper && order.price >= long_lower) {
|
|
|
continue
|
|
|
}
|
|
|
// debug!(?key, ?order.price, ?long_upper, ?long_lower);
|
|
|
@@ -848,7 +848,7 @@ impl Strategy {
|
|
|
} else if order.side == "kk".to_string() { // 开空订单处理
|
|
|
// 在价格范围内时不处理
|
|
|
// if order.price >= short_lower && order.price <= short_upper {
|
|
|
- if (self.local_time - order.local_time <= 200) && (order.price >= short_lower && order.price <= short_upper) {
|
|
|
+ if (self.local_time - order.local_time <= 500) && (order.price >= short_lower && order.price <= short_upper) {
|
|
|
continue
|
|
|
}
|
|
|
// debug!(?key, ?order.price, ?short_lower, ?short_upper);
|
|
|
@@ -981,7 +981,7 @@ impl Strategy {
|
|
|
let client_id = utils::generate_client_id(Some(self.broker_id.clone()));
|
|
|
let order = vec![
|
|
|
amount.to_string(),
|
|
|
- "kd".to_string(),
|
|
|
+ if predictor.inventory < Decimal::ZERO {"pk".to_string()} else {"kd".to_string()},
|
|
|
target_buy_price.to_string(),
|
|
|
client_id.clone(),
|
|
|
];
|
|
|
@@ -1023,7 +1023,7 @@ impl Strategy {
|
|
|
let client_id = utils::generate_client_id(Some(self.broker_id.clone()));
|
|
|
let order = vec![
|
|
|
amount.to_string(),
|
|
|
- "kk".to_string(),
|
|
|
+ if predictor.inventory > Decimal::ZERO {"pd".to_string()} else {"kk".to_string()},
|
|
|
target_sell_price.to_string(),
|
|
|
client_id.clone(),
|
|
|
];
|