From 25d100b3b1702c23b4e9cc04e7e83c2f05a6ddaf Mon Sep 17 00:00:00 2001
From: Administrator <admin@example.com>
Date: 星期五, 19 四月 2024 11:31:41 +0800
Subject: [PATCH] 添加S撤日志/L后重新囊括放开

---
 test/test_sell.py         |   10 +++++++++-
 utils/tool.py             |    2 +-
 l2/cancel_buy_strategy.py |   20 ++++++++++----------
 3 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/l2/cancel_buy_strategy.py b/l2/cancel_buy_strategy.py
index 0e53e61..853d719 100644
--- a/l2/cancel_buy_strategy.py
+++ b/l2/cancel_buy_strategy.py
@@ -305,7 +305,7 @@
                 m = x[1] * x[2]
                 if max_money < m:
                     max_money = m
-                total_deal_money += x[1] * x[2]
+                total_deal_money += m
         if max_money >= 4990000:
             return True, f"鏈夊ぇ浜�499w澶у崠鍗曪紙{max_money}锛�"
 
@@ -386,16 +386,16 @@
             if need_cancel:
                 return need_cancel, cancel_msg
             # S鍚庢挙鍙栨秷
-            if self.__latest_process_sell_order_no.get(code) != big_sell_order_info[1][-1][0]:
-                # 涓嶅鐞嗛噸澶嶇殑鍗栧崟
-                # 鑾峰彇鏈�鏂扮殑鎴愪氦鏃堕棿
-                latest_trade_time = l2_huaxin_util.convert_time(big_sell_order_info[1][-1][4][0])
-                if tool.trade_time_sub(latest_trade_time,
-                                       total_datas[order_begin_pos.buy_single_index]['val']['time']) >= 180:
-                    self.__compute_down_cancel_watch_index(code, big_sell_order_info, total_datas)
+            # if self.__latest_process_sell_order_no.get(code) != big_sell_order_info[1][-1][0]:
+            #     # 涓嶅鐞嗛噸澶嶇殑鍗栧崟
+            #     # 鑾峰彇鏈�鏂扮殑鎴愪氦鏃堕棿
+            #     latest_trade_time = l2_huaxin_util.convert_time(big_sell_order_info[1][-1][4][0])
+            #     if tool.trade_time_sub(latest_trade_time,
+            #                            total_datas[order_begin_pos.buy_single_index]['val']['time']) >= 180:
+            #         self.__compute_down_cancel_watch_index(code, big_sell_order_info, total_datas)
             return False, "涓嶆弧瓒虫挙鍗曟潯浠�"
         finally:
-            self.__latest_process_sell_order_no[code] = big_sell_order_info[1][-1][0]
+            # self.__latest_process_sell_order_no[code] = big_sell_order_info[1][-1][0]
             pass
 
     def need_cancel_for_down(self, code, start_index, end_index):
@@ -1311,7 +1311,7 @@
                 changed = False
         # 淇濆瓨鏁版嵁
         if changed:
-            l2_log.l_cancel_debug(code, f"璁剧疆鎴愪氦浣嶄复杩戞挙鍗曠洃鎺ц寖鍥达細{watch_indexes} 璁$畻鑼冨洿锛歿start_index}-{end_index}")
+            l2_log.l_cancel_debug(code, f"L鍓嶇洃鎺ц寖鍥达細{watch_indexes} 璁$畻鑼冨洿锛歿start_index}-{end_index}")
             self.__set_near_by_trade_progress_indexes(code, buy_single_index, watch_indexes)
         self.__last_l_up_compute_info[code] = (time.time(), watch_indexes)
 
diff --git a/test/test_sell.py b/test/test_sell.py
index 865b88d..9674dba 100644
--- a/test/test_sell.py
+++ b/test/test_sell.py
@@ -149,4 +149,12 @@
 
 
 if __name__ == '__main__':
-    statistic_sell_order()
+    # s
+    real_order_time_ms = "09:30:47" + ".{0:0>3}".format(220)
+    big_sell_order_info = [1809599, [[7351750, 208000, 8.7, (11042670, 527268), (11042670, 527275)]]]
+    max_money = 0
+    for x in big_sell_order_info[1]:
+        deal_time = l2_huaxin_util.convert_time(x[4][0], with_ms=True)
+        if real_order_time_ms:
+            if tool.trade_time_sub_with_ms(deal_time, real_order_time_ms) >= 0:
+                print("123123")
diff --git a/utils/tool.py b/utils/tool.py
index b2983c3..4f29cc5 100644
--- a/utils/tool.py
+++ b/utils/tool.py
@@ -159,7 +159,7 @@
 def get_time_as_millionsecond(time_str):
     s_str, ms_str = time_str.split(".")
     ts = s_str.split(":")
-    return int(ts[0]) * 3600 + int(ts[1]) * 60 + int(ts[2]) * 1000 + int(ms_str)
+    return (int(ts[0]) * 3600 + int(ts[1]) * 60 + int(ts[2])) * 1000 + int(ms_str)
 
 
 # 灏嗙鏁版牸寮忓寲涓烘椂闂�

--
Gitblit v1.8.0