From 751183dcd74207a50834cacc575f0dfccb41658c Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期二, 06 六月 2023 18:13:05 +0800
Subject: [PATCH] 交易优化,看盘接口完善

---
 juejin.py |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/juejin.py b/juejin.py
index 50d2488..4a3dc06 100644
--- a/juejin.py
+++ b/juejin.py
@@ -95,7 +95,7 @@
     # 浜ゆ槗鏅傞枔涓嶈兘鍋氬垵濮嬪寲
     if not tool.is_init_time():
         raise Exception("浜ゆ槗鏃堕棿涓嶈兘鍒濆鍖�")
-
+    init_data()
     codes = gpcode_manager.get_gp_list()
     logger_system.info("姣忔棩鍒濆鍖�")
 
@@ -118,7 +118,7 @@
         big_money_num_manager.expire(code)
     # 娓呴櫎娑ㄥ仠鏃堕棿
     global_util.limit_up_time.clear()
-    init_data()
+
     # 鍒濆鍖栧悓鑺遍『涓荤珯
     l2_clients = client_manager.getValidL2Clients()
     for client in l2_clients:
@@ -293,11 +293,13 @@
         t1.start()
 
     @classmethod
-    def get_gp_latest_info(cls, codes):
+    def get_gp_latest_info(cls, codes,fields=None):
+        if not codes:
+            return []
         account_id, s_id, token = getAccountInfo()
         symbols = gpcode_manager.get_gp_list_with_prefix(codes)
         gmapi.set_token(token)
-        data = gmapi.get_instruments(symbols=",".join(symbols))
+        data = gmapi.get_instruments(symbols=",".join(symbols),fields=fields)
         print(data)
         return data
 
@@ -352,6 +354,8 @@
 
     @classmethod
     def get_gp_current_info(cls, codes):
+        if not codes:
+            return []
         account_id, s_id, token = getAccountInfo()
         symbols = gpcode_manager.get_gp_list_with_prefix(codes)
         gmapi.set_token(token)
@@ -373,10 +377,7 @@
         account_id, s_id, token = getAccountInfo()
         gmapi.run(strategy_id=s_id,
                   filename='juejin.py',
-                  # todo 鍥炴祴妯″紡
                   mode=gmapi.MODE_LIVE,
-                  backtest_start_time='2022-08-18 09:25:00',
-                  backtest_end_time='2022-08-18 10:30:00',
                   token=token)
 
     def stop(self):

--
Gitblit v1.8.0