From c7b6f5be3e5850bbf66db5363e634c57ff9ca876 Mon Sep 17 00:00:00 2001 From: Administrator <admin@example.com> Date: 星期二, 28 三月 2023 15:32:24 +0800 Subject: [PATCH] 评分机制调整 --- trade/first_code_score_manager.py | 56 +++++++++++++++++++++++++++++++------------------------- 1 files changed, 31 insertions(+), 25 deletions(-) diff --git a/trade/first_code_score_manager.py b/trade/first_code_score_manager.py index 3b08089..95f49d0 100644 --- a/trade/first_code_score_manager.py +++ b/trade/first_code_score_manager.py @@ -9,7 +9,7 @@ # zyltgb鑷敱娴侀�氬競鍊兼槸鍚﹀ぇ浜�250浜� # limit_price 娑ㄥ仠浠锋槸鍚﹀ぇ浜�100鍧� # limit_up_time 鏄惁10鐐逛箣鍓嶆定鍋� -# k_form(15涓氦鏄撴棩鏄惁娑ㄥ箙24.9%,鏄惁鐮村墠楂橈紝鏄惁瓒呰穼锛屾槸鍚︽帴杩戝墠楂橈紝鏄惁N,鏄惁V) +# k_form(15涓氦鏄撴棩鏄惁娑ㄥ箙24.9%,鏄惁鐮村墠楂橈紝鏄惁瓒呰穼锛屾槸鍚︽帴杩戝墠楂橈紝鏄惁N,鏄惁V,鏄惁鏈夊舰鎬�) import code_nature_analyse import global_data_loader import global_util @@ -24,7 +24,7 @@ score_list = [] if zyltgb: zyltgbs = [0, 10, 31, 51, 101, 150, 250, 1000000] - zyltgb_score = [5, 25, 20, 15, 10, 5, -80] + zyltgb_score = [20, 30, 20, 10, 0, -10, -20] for i in range(1, len(zyltgbs)): if zyltgbs[i - 1] <= zyltgb / 100000000 < zyltgbs[i]: score_list.append(zyltgb_score[i - 1]) @@ -45,18 +45,18 @@ k_score = [] # 15涓氦鏄撴棩鏄惁娑ㄥ箙24.9% if k_form[0]: - k_score.append(-25) + k_score.append(-55) else: k_score.append(0) - # 鏄惁鐮村墠楂� + # 鏄惁鐮村墠楂� if k_form[1]: - k_score.append(50) + k_score.append(65) else: k_score.append(0) # 鏄惁瓒呰穼 if k_form[2]: - k_score.append(40) + k_score.append(45) else: k_score.append(0) @@ -67,14 +67,21 @@ k_score.append(0) # 鏄惁N if k_form[4]: - k_score.append(35) + k_score.append(40) else: k_score.append(0) # 鏄惁V if k_form[5]: - k_score.append(30) + k_score.append(35) else: k_score.append(0) + + # 鏄惁鏈夊舰鎬� + if k_form[6]: + k_score.append(0) + else: + k_score.append(-25) + score_list.append(k_score) nature_score = [] @@ -94,20 +101,18 @@ score_list.append(nature_score) hot_block_score = [] - - if hot_block[1] >= 2: - hot_block_score.append(40) + # 鏉垮潡涓彧鏈夎嚜宸辨定鍋滐紝涓旀棤鐐告澘 + if hot_block[1] == 1 and hot_block[2] == 0: + hot_block_score.append(25) + elif hot_block[1] >= 2 and hot_block[2] == 0: + hot_block_score.append(35) else: - hot_block_score.append(30) - if hot_block[2] > 0: - hot_block_score.append(10) - else: - hot_block_score.append(0) + hot_block_score.append(5) score_list.append(hot_block_score) # 閲� - volume_score = [0, 40, 50, 40, 30, 10, -15, -35] - volume_rates = [0, 0.499, 0.649, 0.799, 0.949, 1.099, 1.249, 1.399] + volume_score = [0, 35, 45, 55, 45, 35, 15, -5, -30] + volume_rates = [0, 0.349, 0.499, 0.649, 0.799, 0.949, 1.099, 1.249, 1.399] volume_add = False for i in range(1, len(volume_rates)): if volume_rates[i - 1] <= volume_rate < volume_rates[i]: @@ -118,7 +123,12 @@ score_list.append(volume_score[-1]) if limit_up_time: - score_list.append(20) + times = ["10:00:00", "11:30:00", "14:00:00", "15:00:00"] + time_scores = [15, 10, 5, 0] + for i in range(0, len(times)): + if int(times[i].replace(":", "")) >= int(limit_up_time.replace(":", "")): + score_list.append(time_scores[i]) + break else: score_list.append(0) @@ -162,7 +172,7 @@ k_form = code_nature_analyse.CodeNatureRecordManager.get_k_format(code) if k_form is None: - k_form = [(True, ''), (False, ''), (False, ''), (False, ''), (False, ''), (False, '')] + k_form = [(True, ''), (False, ''), (False, ''), (False, ''), (False, ''), (False, ''), (True, '')] source_datas.append(k_form) code_nature = code_nature_analyse.CodeNatureRecordManager.get_nature(code) @@ -180,10 +190,6 @@ source_datas.append(volume_rate) source_datas.append(limit_up_time) - if limit_up_time and tool.trade_time_sub(limit_up_time, "10:00:00") < 0: - limit_up_time = True - else: - limit_up_time = False # 鑾峰彇鎴愪氦澶у崟 deal_big_num = deal_big_money_manager.get_deal_big_money_num(code) @@ -208,5 +214,5 @@ if __name__ == "__main__": global_data_loader.load_zyltgb() - score = get_score("000779", 1.2, "15:00:01", True) + score = get_score("603829", 1.2, "15:00:01", True) print(score) -- Gitblit v1.8.0