JiahengHe 2 years ago
parent
commit
a57a769e86
1 changed files with 7 additions and 7 deletions
  1. 7 7
      strategy/src/quant.rs

+ 7 - 7
strategy/src/quant.rs

@@ -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;
+                            });
                         }
                     }
                 }