From 627a78af20d49295ac2e8ae73e3e6037bb7826eb Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期三, 17 四月 2024 13:05:22 +0800 Subject: [PATCH] 添加日志 --- l2/l2_data_manager_new.py | 43 +++++++++++++++++++++---------------------- 1 files changed, 21 insertions(+), 22 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index 0eda9b7..14a093c 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -406,7 +406,6 @@ pass async_log_util.info(logger_l2_process, f"code:{code} 鑾峰彇鍒颁笅鍗曠湡瀹炰綅缃細{place_order_index}") - # 澶勭悊娑ㄥ仠鍗栦笌娑ㄥ仠鍗栨挙 try: for d in add_datas: @@ -1361,7 +1360,8 @@ # if code.find('60') == 0: # 婵�杩涗拱 continue_count = 1 - has_single, _index, sell_info = cls.__compute_active_order_begin_pos(code, continue_count, compute_start_index, compute_end_index) + has_single, _index, sell_info = cls.__compute_active_order_begin_pos(code, continue_count, + compute_start_index, compute_end_index) fast_msg = None if has_single: order_begin_pos.mode = OrderBeginPosInfo.MODE_ACTIVE @@ -1487,7 +1487,7 @@ order_begin_pos.num, order_begin_pos.count, order_begin_pos.threshold_money, - order_begin_pos.buy_single_index, order_begin_pos.max_num_set,order_begin_pos.sell_info[1]) + order_begin_pos.buy_single_index, order_begin_pos.max_num_set, order_begin_pos.sell_info[1]) threshold_money = threshold_money_new order_begin_pos.threshold_money = threshold_money elif order_begin_pos.mode == OrderBeginPosInfo.MODE_FAST: @@ -1727,6 +1727,22 @@ if refer_sell_data is None: refer_sell_data = (start_time_str, 0, 0, (round(float(total_datas[start_index]["val"]["price"]), 2), 0)) l2_log.debug(code, f"涓㈠け鎬诲崠棰濓紝璁剧疆榛樿涓�0锛岃绠楄寖鍥达細{start_index}-{end_index}") + # 鍒ゆ柇鏄惁涓虹湡鐨勬澘涓婃斁閲� + single = place_order_single_data_manager.L2TradeSingleDataManager.get_valid_trade_single( + code, + tool.to_time_with_ms(total_datas[end_index]['val']['time'], total_datas[end_index]['val']['tms'])) + trade_price_info = HuaXinSellOrderStatisticManager.get_latest_trade_price_info(code) + limit_up_price = gpcode_manager.get_limit_up_price(code) + is_limit_up = False + if limit_up_price and trade_price_info and abs(trade_price_info[0] - float(limit_up_price)) < 0.001: + is_limit_up = True + if refer_sell_data[1] > 0 or single or not is_limit_up: + # 涓嶆槸鏉夸笂鏀鹃噺 + pass + else: + # 鏉夸笂鏀鹃噺 + pass + # 鑾峰彇褰撳墠鏄惁鍙縺杩涗拱 # 鑾峰彇鏉垮潡鏄惁鍙互婵�杩涗拱 # 鍙拱鐨勬澘鍧�, 鏄惁鐙嫍, 娑堟伅, 鍙拱鐨勫己鍔挎澘鍧�, 鍏抽敭璇�, 婵�杩涗拱鐨勬澘鍧� @@ -1735,23 +1751,6 @@ # 鏈夊彲涔版澘鍧楋紝鏈夋縺杩涗拱鏉垮潡 # 绗竴姝ワ細 璁$畻鎬诲崠棰� threshold_money, sell_1_price = refer_sell_data[1], refer_sell_data[3][0] - if code.find("60") == 0: - threshold_money = 0 - else: - pass - # for i in range(start_index - 1, -1, -1): - # val = total_datas[i]["val"] - # if tool.compare_time(val["time"], refer_sell_data[0]) < 0: - # # 灏嗘湰s鐨勮绠椾笂鍘� - # break - # if L2DataUtil.is_sell(val): - # threshold_money += val["num"] * int(float(val["price"]) * 100) - # elif L2DataUtil.is_sell_cancel(val): - # threshold_money -= val["num"] * int(float(val["price"]) * 100) - # elif L2DataUtil.is_buy(val): - # # 鍒ゆ柇浠锋牸锛堝ぇ浜庡崠1锛� 琚拱鍚冩帀 - # if round(float(val["price"]), 2) - sell_1_price >= 0: - # threshold_money -= val["num"] * int(float(val["price"]) * 100) # 绗簩姝ワ細璁$畻璧峰淇″彿 second_930 = 9 * 3600 + 30 * 60 + 0 total_datas = local_today_datas.get(code) @@ -2162,7 +2161,7 @@ threshold_money = threshold_money_origin # 鐩爣鎵嬫暟 - threshold_num = 0 # round(threshold_money / (limit_up_price * 100)) + threshold_num = 0 # round(threshold_money / (limit_up_price * 100)) bigger_threshold_num = round(5000 / (limit_up_price)) # buy_single_time_seconds = L2DataUtil.get_time_as_second(total_datas[buy_single_index]["val"]["time"]) @@ -2265,7 +2264,7 @@ elif code.find("00") == 0: # 娣辫瘉闈炴澘涓婃斁閲� safe_count = 2 - if code.find("60") == 0: + if code.find("60") == 0: # 涓婅瘉瀹夊叏绗旀暟涓�3 safe_count = 3 if buy_count < safe_count: -- Gitblit v1.8.0