From 09f84c4ecae2a71e07f6dd64e6066563599a62b6 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 17 六月 2025 17:59:40 +0800 Subject: [PATCH] ‘功能完善 --- strategy/strategy_script_v6.py | 39 ++++++++++++++------------------------- 1 files changed, 14 insertions(+), 25 deletions(-) diff --git a/strategy/strategy_script_v6.py b/strategy/strategy_script_v6.py index 8f481a6..144d469 100644 --- a/strategy/strategy_script_v6.py +++ b/strategy/strategy_script_v6.py @@ -91,6 +91,9 @@ if sv.鍏釜浜ゆ槗鏃ユ定骞呰繃楂�: return False, f"6涓氦鏄撴棩娑ㄥ箙杩囬珮" + if sv.鏃ヤ笁鏉夸釜鏁癬10 >= 1: + return False, f"10涓氦鏄撴棩鏈�>=3杩炴澘" + # if sv.褰撳墠浠� > sv.鏄ㄦ棩鏈�浣庝环 * 1.1: # return False, f"涔板叆鏃剁殑浠锋牸蹇呴』鈮ゆ槰鏃ユ渶浣庝环*110%" @@ -112,8 +115,8 @@ # 鐩爣绁ㄦ澘鍧楁定鍋滀釜鏁�>=2 # 鏉垮潡鍙兘涔板叆涓�涓唬鐮� - # if sv.鏉垮潡鎴愪氦浠g爜: - # can_buy_plates -= set(sv.鏉垮潡鎴愪氦浠g爜.keys()) + if sv.鏉垮潡鎴愪氦浠g爜: + can_buy_plates -= set(sv.鏉垮潡鎴愪氦浠g爜.keys()) if not can_buy_plates: return False, f"娌℃湁娑ㄥ仠鐨勬澘鍧�: {[(plate, sv.寮�鐩樺暒鏈�姝f澘鍧楁定鍋�.get(plate)) for plate in sv.浠g爜鏉垮潡 if sv.寮�鐩樺暒鏈�姝f澘鍧楁定鍋淽} 杩炵画鑰侀鏉愶細{sv.杩炵画鑰侀鏉恾" @@ -138,7 +141,7 @@ if sv.浠婃棩澶у崟鏁版嵁: # print(sv.浠婃棩澶у崟鏁版嵁[-1][3], format_time(sv.浠婃棩澶у崟鏁版嵁[-1][3])) # filter_orders = [(o[0], o[2]) for o in sv.浠婃棩澶у崟鏁版嵁 if format_time(o[3]) >= sv.浠婃棩閲忓淇℃伅[0]] - filter_orders = [(o[0], o[2]) for o in sv.浠婃棩澶у崟鏁版嵁 if o[2] >= 200e4] + filter_orders = [(o[0], o[2]) for o in sv.浠婃棩澶у崟鏁版嵁] filter_orders.reverse() orderids = set() for o in filter_orders: @@ -146,34 +149,20 @@ continue orderids.add(o[0]) big_order_money += o[1] - big_sell_order_money = 0 - if sv.浠婃棩鍗栧ぇ鍗曟暟鎹�: - filter_orders = [(o[0], o[2]) for o in sv.浠婃棩鍗栧ぇ鍗曟暟鎹� if o[2] >= 200e4] - filter_orders.reverse() - orderids = set() - for o in filter_orders: - if o[0] in orderids: - continue - orderids.add(o[0]) - big_sell_order_money += o[1] - - threshold_money = max(sv.鑷敱娴侀�氬競鍊� // 1000, 200e4) + threshold_money = max(1.5 * sv.鑷敱娴侀�氬競鍊� // 1000, 200e4) limit_up_codes_count = max([(p, len(sv.寮�鐩樺暒鏈�姝f澘鍧楁定鍋�.get(p, []))) for p in can_buy_plates], key=lambda x: x[1])[1] - # threshold_money *= max(min(10 - limit_up_codes_count + 1, 10), 5) / 10 - threshold_money *= 0.5 + # threshold_money *= max(10 - limit_up_codes_count + 3, 5) / 10 + if big_order_money < threshold_money: + return False, f"({big_order_money}/{threshold_money})澶у崟閲戦涓嶈冻" - # print(target_code, sv.鑷敱娴侀�氬競鍊�, threshold_money, limit_up_codes_count) + big_sell_order_money = 0 - # threshold_money = 200e4 # int(sv.鏄ㄦ棩鎴愪氦閲� * 0.2 * sv.浠婃棩娑ㄥ仠浠� * 0.05) + if big_order_money < threshold_money: + return False, f"({round(big_order_money / 1e4, 2)}涓�/{round(threshold_money / 1e4, 2)}涓�)澶у崟閲戦涓嶈冻" - final_big_order_money = big_order_money - big_sell_order_money - - if final_big_order_money < threshold_money: - return False, f"({round(final_big_order_money / 1e4, 2)}涓�/{round(threshold_money / 1e4, 2)}涓�)澶у崟閲戦涓嶈冻" - - return True, f" \n\t澶у崟淇℃伅锛歿round(final_big_order_money / 1e4, 2)}涓囷紙涔帮細{round(big_order_money / 1e4, 2)}涓� 鍗栵細{round(big_sell_order_money / 1e4, 2)}涓囷級/{round(threshold_money / 1e4, 2)}涓� \n\t閲忓淇℃伅锛歿sv.浠婃棩閲忓淇℃伅}\n\t浠婃棩鏈�楂樹环:{sv.浠婃棩鏈�楂樹环淇℃伅} \n\t5鏃ユ渶楂樹环锛歿sv.鏃ユ渶楂樹环_5}", f"\n\t鏉垮潡淇℃伅锛歿[(p, sv.寮�鐩樺暒鏈�姝f澘鍧楁定鍋�.get(p)) for p in can_buy_plates]}", can_buy_plates + return True, f" \n\t澶у崟淇℃伅锛歿round(big_order_money / 1e4, 2)}涓囷紙涔帮細{round(big_order_money / 1e4, 2)}涓� 鍗栵細{round(big_sell_order_money / 1e4, 2)}涓囷級/{round(threshold_money / 1e4, 2)}涓� \n\t閲忓淇℃伅锛歿sv.浠婃棩閲忓淇℃伅}\n\t浠婃棩鏈�楂樹环:{sv.浠婃棩鏈�楂樹环淇℃伅} \n\t5鏃ユ渶楂樹环锛歿sv.鏃ユ渶楂樹环_5}", f"\n\t鏉垮潡淇℃伅锛歿[(p, sv.寮�鐩樺暒鏈�姝f澘鍧楁定鍋�.get(p)) for p in can_buy_plates]}", can_buy_plates compute_result = can_buy() -- Gitblit v1.8.0