From 045a5aa6434da6e83c3d850b17e7e58cd7b55ef5 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期一, 15 五月 2023 15:46:32 +0800 Subject: [PATCH] 开盘啦板块影响交易逻辑 --- third_data/kpl_util.py | 68 ++++++++++++++++++++++++++++++++- 1 files changed, 65 insertions(+), 3 deletions(-) diff --git a/third_data/kpl_util.py b/third_data/kpl_util.py index 68fe651..eec6a68 100644 --- a/third_data/kpl_util.py +++ b/third_data/kpl_util.py @@ -30,7 +30,7 @@ # 娑ㄥ仠浠g爜锛� -# (浠g爜,鍚嶇О,棣栨娑ㄥ仠鏃堕棿,鏈�杩戞定鍋滄椂闂�,鍑犳澘,娑ㄥ仠鍘熷洜,鏉垮潡,瀹為檯娴侀��,涓诲姏鍑�棰�) +# (浠g爜,鍚嶇О,棣栨娑ㄥ仠鏃堕棿,鏈�杩戞定鍋滄椂闂�,鍑犳澘,娑ㄥ仠鍘熷洜,鏉垮潡,瀹為檯娴侀��,涓诲姏鍑�棰�,娑ㄥ仠鍘熷洜浠g爜,娑ㄥ仠鍘熷洜浠g爜鏁伴噺) # (0,1,6,25,9,16,11,15,12) # 绔炰环浠g爜锛� # (浠g爜,鍚嶇О,娑ㄥ仠濮斾拱棰�,鏉垮潡,绔炰环鎴愪氦棰�,瀹為檯娴侀��) @@ -62,13 +62,14 @@ BEST_FENG_KOU = "best_feng_kou" FENG_XIANG = "feng_xiang" INDUSTRY_RANK = "industry_rank" + JINGXUAN_RANK = "jingxuan_rank" def __parseDaBanItemData(data, type): if type == DABAN_TYPE_BIDDING: return data[0], data[1], data[18], data[11], data[22], data[15] elif type == DABAN_TYPE_LIMIT_UP: - return data[0], data[1], data[6], data[25], data[9], data[16], data[11], data[15], data[12] + return data[0], data[1], data[6], data[25], data[9], data[16], data[11], data[15], data[12], data[26], data[27] elif type == DABAN_TYPE_OPEN_LIMIT_UP: return data[0], data[1], data[4], data[11], data[15] elif type == DABAN_TYPE_LIMIT_DOWN: @@ -170,4 +171,65 @@ pdata = __parseIndustry_rank(d) if pdata: fresult_.append(pdata) - return fresult_ \ No newline at end of file + return fresult_ + + +# 瑙f瀽鏉垮潡浠g爜 +def parsePlateCodes(data): + if type(data) == str: + data = json.loads(data) + if int(data["errcode"]) != 0: + raise Exception(f"瑙f瀽鏁版嵁鍑洪敊锛宔rrcode锛歿data['errcode']}") + list_ = data["list"] + fresult_ = [] + for d in list_: + # (浠g爜,鍚嶇О,鐜颁环,娑ㄥ箙,鑷敱娴侀��,鍑犳澘锛岄緳鍑狅紝涓诲姏鍑�棰�,300w鍑�棰�,鏈烘瀯澧炰粨) + fresult_.append((d[0], d[1], d[5], d[6], d[10], d[23], d[24], d[13], d[50], d[42])) + return fresult_ + + +# 瑙f瀽姒傚康涓殑鏉垮潡寮哄害 +def parseSonPlat(data): + if type(data) == str: + data = json.loads(data) + if int(data["errcode"]) != 0: + raise Exception(f"瑙f瀽鏁版嵁鍑洪敊锛宔rrcode锛歿data['errcode']}") + list_ = data["List"] + fresult_ = [] + for d in list_: + # (浠g爜,鍚嶇О,寮哄害) + fresult_.append((d[0], d[1], d[2])) + return fresult_ + + +def __money_desc(money): + if abs(money) > 100000000: + return f"{round(money / 100000000, 2)}浜�" + else: + return f"{round(money / 10000, 2)}涓�" + + +def parseMarketIndustry(data): + if type(data) == str: + data = json.loads(data) + if int(data["errcode"]) != 0: + raise Exception(f"瑙f瀽鏁版嵁鍑洪敊锛宔rrcode锛歿data['errcode']}") + list_ = data["list"] + fresult_ = [] + for d in list_: + # (浠g爜,鍚嶇О,娑ㄥ箙,涓诲姏鍑�棰�) + fresult_.append((d[0], d[1], d[3], d[6])) + return fresult_ + + +def parseMarketJingXuan(data): + if type(data) == str: + data = json.loads(data) + if int(data["errcode"]) != 0: + raise Exception(f"瑙f瀽鏁版嵁鍑洪敊锛宔rrcode锛歿data['errcode']}") + list_ = data["list"] + fresult_ = [] + for d in list_: + # (浠g爜,鍚嶇О,寮哄害,涓诲姏鍑�棰�) + fresult_.append((d[0], d[1], d[2], d[6])) + return fresult_ -- Gitblit v1.8.0