From ea1e94b2099f3635508cc00f0723495e2034ee98 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 12 八月 2024 17:58:01 +0800 Subject: [PATCH] 下单策略修改 --- l2/l2_data_manager_new.py | 94 +++++++++++++++++----------------------------- 1 files changed, 35 insertions(+), 59 deletions(-) diff --git a/l2/l2_data_manager_new.py b/l2/l2_data_manager_new.py index c9ea3c2..739c50b 100644 --- a/l2/l2_data_manager_new.py +++ b/l2/l2_data_manager_new.py @@ -846,6 +846,11 @@ return False, True, f"14:57鍚庝笉鑳戒氦鏄�" if 130100 >= now_time_int >= 112900 or now_time_int < 93100: if now_time_int < 93100: + # 鍒ゆ柇杩�120澶╂槸鍚︽湁娑ㄥ仠 + k_format = code_nature_analyse.CodeNatureRecordManager().get_k_format_cache(code) + if k_format and len(k_format) >= 12 and not k_format[11]: + return False, True, f"09:31:00涔嬪墠涓嬪崟锛�90涓氦鏄撴棩鏃犳定鍋�" + # 鍒ゆ柇鎴愪氦鐨勫ぇ鍗曟暟閲� data_list = BigOrderDealManager().get_total_buy_money_list(code) bigger_money = 2990000 @@ -854,8 +859,8 @@ if d < bigger_money: continue fdatas.append(d) - if len(fdatas) < 3: - return False, True, f"09:31:00涔嬪墠涓嬪崟锛屾垚浜ゅぇ鍗曟暟閲忥紙{len(fdatas)}锛変笉瓒�3涓�" + if len(fdatas) < 1: + return False, True, f"09:31:00涔嬪墠涓嬪崟锛屾垚浜ゅぇ鍗曟暟閲忥紙{len(fdatas)}锛変笉瓒�1涓�" else: # 鍒ゆ柇鏁版嵁鏄惁鍗� total_datas = local_today_datas.get(code) @@ -938,28 +943,35 @@ buy1_money = 1 deal_rate = round(total_deal_money / buy1_money, 2) if deal_rate < 0.05: - return False, True, f"鏉夸笂鏀鹃噺鎴愪氦閲戦涓嶈冻锛岃繎2s鎬绘垚浜ゆ瘮渚�({deal_rate})锛歿total_deal_money}/{buy1_money}灏忎簬0.05" - # 鍒ゆ柇鎴愪氦杩涘害鏄惁璺濈鎴戜滑鐨勪綅缃緢杩� - trade_index, is_default = cls.__TradeBuyQueue.get_traded_index(code) - if False and not is_default and trade_index: - not_cancel_num = 0 - num_operate_map = local_today_num_operate_map.get(code) - for i in range(trade_index + 1, total_data[-1]["index"] + 1): - if L2DataUtil.is_limit_up_price_buy(total_data[i]["val"]): - left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(code, - total_data[ - i][ - "index"], - total_data, - local_today_canceled_buyno_map.get( - code)) - if left_count > 0: - not_cancel_num += total_data[i]["val"]["num"] - m_base_val = l2_trade_factor.L2PlaceOrderParamsManager.get_base_m_val(code) - not_cancel_money = not_cancel_num * 100 * float(gpcode_manager.get_limit_up_price(code)) - if m_base_val > not_cancel_money: - return False, False, f"鎴愪氦浣嶇疆璺濈褰撳墠浣嶇疆绾拱棰�({not_cancel_money})灏忎簬m鍊�({m_base_val})" + # 鍒ゆ柇鎴愪氦杩涘害鍒板綋鍓嶆暟鎹殑绗旀暟锛屽鏋滃皯浜�10绗斾笖杩樻湁鏈垚浜ょ殑澶у崟锛�>=299锛夊氨鍙互涓嬪崟 + trade_index, is_default = cls.__TradeBuyQueue.get_traded_index(code) + if trade_index is None: + trade_index = 0 + total_count = 0 + total_big_count = 0 + for i in range(trade_index + 1, total_data[-1]["index"] + 1): + data = total_data[i] + val = data["val"] + if not L2DataUtil.is_limit_up_price_buy(val): + continue + money = val["num"] * float(val["price"]) + if money < 5000: + continue + left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2( + code, + i, + total_data, + local_today_canceled_buyno_map.get( + code)) + if left_count > 0: + total_count += 1 + if money > 29900: + total_big_count += 1 + if total_count > 10: + break + if total_count > 10 or total_big_count < 1: + return False, True, f"鏉夸笂鏀鹃噺鎴愪氦閲戦涓嶈冻锛岃繎2s鎬绘垚浜ゆ瘮渚�({deal_rate})锛歿total_deal_money}/{buy1_money}灏忎簬0.05锛屾湭鎴愪氦鏁伴噺-{total_count}锛屽ぇ鍗曟暟閲�-{total_big_count}" # 涓婅瘉涓嬪崟闇�瑕佹湁鎴愪氦澶у崟锛堝寘鍚富鍔ㄤ拱涓庤鍔ㄤ拱锛夋垨鑰呮寕涔扮殑澶у崟 if tool.is_sh_code(code): deal_big_order_count = BigOrderDealManager().get_total_buy_count(code) @@ -1103,36 +1115,10 @@ if is_in_strong_time_30 and is_best_zylt: # 寮哄娍30鍒嗛挓锛屾渶浼樺競鍊�, 鏈夊彲浠ヤ笅鍗曠殑鏉垮潡锛屼笉鐪嬮噺 return True, False, can_buy_result[2] - # 娉ㄩ噴閲忕殑褰卞搷 - # if k_format and (k_format[1][0] or k_format[3][0]) and len(k_format) >= 12 and k_format[11]: - # # 鐮村墠楂�/鎺ヨ繎鍓嶉珮涓�30澶╁唴鏈夋定鍋� - # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: - # return False, True, f"鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮涓�30澶╁唴鏈夋定鍋�,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[1]}" - # 娉ㄩ噴閲忕殑褰卞搷 - # if HighIncreaseCodeManager().is_in(code): - # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.59: - # return False, True, f"5澶╁唴3娆℃定鍋滐紝閲忔湭杈惧埌59%锛坽cls.volume_rate_info[code][0]}锛�" msg_list = [] if is_in_strong_time: msg_list.append("寮哄娍10鍒嗛挓") - # 涓�5涓氦鏄撴棩鏈夌偢鏉夸箣鍚� - # 娉ㄩ噴閲忕殑褰卞搷 - # if has_open_limit_up_in_5: - # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.15: - # return False, True, f"寮哄娍10鍒嗛挓,涓�5涓氦鏄撴棩鐐告澘,閲忔湭杈惧埌{0.15}({cls.volume_rate_info[code][0]})" - # - # # 涓�5涓氦鏄撴棩鏈夎穼鍋� - # if has_limit_down_in_5: - # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.15: - # return False, True, f"寮哄娍10鍒嗛挓,涓�5涓氦鏄撴棩璺屽仠,閲忔湭杈惧埌{0.15}({cls.volume_rate_info[code][0]})" - # - # # 鑾峰彇閲忕殑鍙傝�冩棩鏈� - # if code in global_util.max60_volumn: - # day = global_util.max60_volumn[code][1] - # if day in HistoryKDatasUtils.get_latest_trading_date_cache(5): - # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < 0.15 and not is_special: - # return False, True, f"寮哄娍10鍒嗛挓锛屽弬鑰冮噺鍦ㄦ渶杩�5澶╋紝鏃犺鲸璇嗗害锛岄噺鏈揪鍒�0.15({cls.volume_rate_info[code][0]})" # 鐙嫍 if not can_buy_result[0] and can_buy_result[1]: @@ -1141,16 +1127,6 @@ # 濡傛灉娌℃湁杈ㄨ瘑搴︽墠涓嶄拱 if not is_special: return False, True, f"寮哄娍10鍒嗛挓锛屾棤杈ㄨ瘑搴︼紝 鐙嫍锛坽can_buy_result[4]}锛変笉涓嬪崟锛坽can_buy_result[4]}锛夎嚜鐢辨祦閫氬競鍊硷紙{zyltgb_as_yi}锛変笉鏄壒浼樺競鍊�" - # 娉ㄩ噴閲忕殑褰卞搷 - # if k_format and (k_format[1][0] or k_format[3][0]): - # msg_list.append("鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮") - # # 鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮 - # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[1]: - # return False, True, f"寮哄娍10鍒嗛挓锛岀嫭鑻楋紙{can_buy_result[4]}锛夛紝鑲′环鍒涙柊楂樻垨鑰呴�艰繎鍓嶉珮,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[1]}" - # else: - # if code in cls.volume_rate_info and cls.volume_rate_info[code][0] < volume_rate_thresholds[ - # 0] and not is_special: - # return False, True, f"寮哄娍10鍒嗛挓锛屾棤杈ㄨ瘑搴︼紝鐙嫍锛坽can_buy_result[4]}锛�,褰撴棩閲忔瘮({cls.volume_rate_info[code][0]})灏忎簬{volume_rate_thresholds[0]}" elif not can_buy_result[0]: return False, True, f"闈炵嫭鑻椾笉婊¤冻韬綅锛歿can_buy_result[2]}" else: -- Gitblit v1.8.0