def score_analyze(basic, kdata, pick_index, take_index, policy_args): """ 根据股票股价、市值、成交量等方面给股票打分: * 股价估分,总计25分; * 市值估分,总计25分; * 涨停估分,总分25分,一个涨停板5分; """ max_pclose = __parse_policy_args(policy_args, MAX_PCLOSE) outstanding = __parse_policy_args(policy_args, OUTSTANDING) score = dogen.score_by_pclose(40, kdata.iloc[take_index][dogen.P_CLOSE], max_pclose) score += dogen.score_by_outstanding( 40, kdata.iloc[take_index][dogen.P_CLOSE] * basic[dogen.OUTSTANDING], outstanding) temp_score = 20 temp_slice = 20 tdata = kdata[0:pick_index + 1] count = tdata[tdata[dogen.P_CLOSE] >= tdata[dogen.L_HIGH]].index.size if (count > temp_score / temp_slice): count = temp_score / temp_slice if (count > 0): score += temp_slice * count return (int)(score)
def score_analyze(basic, kdata, pick_index, take_index, policy_args): """ 根据股票股价、市值、成交量等方面给股票打分: * 股价估分,总计25分; * 市值估分,总计25分; * 涨停估分,总分25分,一个涨停板5分; """ max_pclose = __parse_policy_args(policy_args, MAX_PCLOSE) outstanding = __parse_policy_args(policy_args, OUTSTANDING) score = dogen.score_by_pclose(25, kdata.iloc[take_index][dogen.P_CLOSE], max_pclose) score += dogen.score_by_outstanding(25, kdata.iloc[take_index][dogen.P_CLOSE]*basic[dogen.OUTSTANDING], outstanding) return (int)(score)
def score_analyze(basic, kdata, pick_index, take_index, policy_args): """ 根据股票股价、市值、成交量等方面给股票打分: * 股价估分,总计25分; * 市值估分,总计25分; * 下跌估分,总计50分(默认最多四个下跌交易日); """ max_pclose = __parse_policy_args(policy_args, MAX_PCLOSE) outstanding = __parse_policy_args(policy_args, OUTSTANDING) hl_valid = __parse_policy_args(policy_args, HL_VALID) score = dogen.score_by_pclose(25, kdata.iloc[take_index][dogen.P_CLOSE], max_pclose) score += dogen.score_by_outstanding(25, kdata.iloc[take_index][dogen.P_CLOSE]*basic[dogen.OUTSTANDING], outstanding) temp_score = 50.0 temp_slice = temp_score / hl_valid if (pick_index <= hl_valid): score += (pick_index * temp_slice) return (int)(score)
def score_analyze(basic, kdata, high_index, pick_index, take_index, fall_range, policy_args): """ 根据股票股价、市值、成交量等方面给股票打分: * 股价估分,总计40分; * 市值估分,总计40分; * 涨停估分,总分20分,两个月内一个涨停板10分; """ max_pclose = __parse_policy_args(policy_args, MAX_PCLOSE) outstanding = __parse_policy_args(policy_args, OUTSTANDING) pick_start = __parse_policy_args(policy_args, PICK_START) [high_index, pick_index, dec_close, get_llow, tmpId] = fall_range score = dogen.score_by_pclose(30, kdata.iloc[take_index][dogen.P_CLOSE], max_pclose) score += dogen.score_by_outstanding( 30, kdata.iloc[take_index][dogen.P_CLOSE] * basic[dogen.OUTSTANDING], outstanding) temp_score = 20 temp_slice = 20 tdata = kdata[0:high_index + 1] count = tdata[tdata[dogen.P_CLOSE] >= tdata[dogen.L_HIGH]].index.size if (count > temp_score / temp_slice): count = temp_score / temp_slice if (count > 0): score += temp_slice * count temp_score = 20 temp_slice = 10 temp_index = pick_index for i in range(0, (int)(temp_score / temp_slice)): rise_range = dogen.get_last_rise_range(kdata, 10, sIdx=temp_index) if rise_range is None: break else: [min_index, max_index, inc_close, get_hl, tmpId] = rise_range score += temp_slice return (int)(score)