|
|
@@ -915,17 +915,17 @@ pub async fn run_stratey(quant_arc: Arc<Mutex<Quant>>) -> JoinHandle<()>{
|
|
|
// 触发策略 更新策略时间
|
|
|
quant.strategy.local_time = Utc::now().timestamp_millis();
|
|
|
let trade_msg = quant.trade_msg.clone();
|
|
|
+ let platform_rest_fb = quant.platform_rest.clone_box();
|
|
|
// 获取信号
|
|
|
if quant.mode_signal > 20 {
|
|
|
-
|
|
|
// 先执行onExit
|
|
|
let orders = quant.strategy.on_exit(&trade_msg);
|
|
|
if orders.is_not_empty() {
|
|
|
info!("触发onExit");
|
|
|
quant._update_local_orders(&orders);
|
|
|
- // tokio::spawn(async {
|
|
|
- // self.platform_rest.command_order(orders).await;
|
|
|
- // });
|
|
|
+ tokio::spawn(async {
|
|
|
+ platform_rest_fb.command_order(orders).await;
|
|
|
+ });
|
|
|
}
|
|
|
} else {
|
|
|
// 再执行onSleep
|
|
|
@@ -933,9 +933,9 @@ pub async fn run_stratey(quant_arc: Arc<Mutex<Quant>>) -> JoinHandle<()>{
|
|
|
// 记录指令触发信息
|
|
|
if orders.is_not_empty() {
|
|
|
quant._update_local_orders(&orders);
|
|
|
- // tokio::spawn(async {
|
|
|
- // self.platform_rest.command_order(orders).await;
|
|
|
- // });
|
|
|
+ tokio::spawn(async {
|
|
|
+ platform_rest_fb.command_order(orders).await;
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
}
|