| | |
| | | if need_clear_data: |
| | | trade_result_manager.real_cancel_success(code, buy_single_index, buy_exec_index, |
| | | local_today_datas.get(code)) |
| | | return |
| | | return False |
| | | else: |
| | | l2_log.debug(code, "可以下单,原因:{}", reason) |
| | | |
| | |
| | | l2_log.debug(code, "执行买入异常:{}", str(e)) |
| | | pass |
| | | finally: |
| | | l2_log.debug(code, "m值影响因子:{}", l2_trade_factor.L2TradeFactorUtil.factors_to_string(code)) |
| | | # l2_log.debug(code, "m值影响因子:{}", l2_trade_factor.L2TradeFactorUtil.factors_to_string(code)) |
| | | pass |
| | | return True |
| | | |
| | | # 是否可以取消 |
| | | @classmethod |
| | |
| | | # with open(f"{constant.get_path_prefix()}/logs/profile/{code}_can_buy_first.txt", 'w') as f: |
| | | # f.write(output.getvalue()) |
| | | # return results |
| | | return cls.can_buy_first(code, limit_up_price, score_index, score, score_info, cls.volume_rate_info[code]) |
| | | return cls.can_buy_first(code, limit_up_price) |
| | | |
| | | else: |
| | | return True, False, "在想买名单中" |
| | | |
| | | @classmethod |
| | | def can_buy_first(cls, code, limit_up_price, score_index, score, score_info, volume_rate_info): |
| | | def is_has_k_format(score_info): |
| | | # (15个交易日涨幅是否大于24.9%,是否破前高,是否超跌,是否接近前高,是否N,是否V,是否有形态,天量大阳信息,是否具有辨识度) |
| | | |
| | | if score_info[1][3][6][0] and not score_info[1][3][3][0]: |
| | | return True |
| | | if score_info[1][3][7][0]: |
| | | return True |
| | | return False |
| | | def can_buy_first(cls, code, limit_up_price): |
| | | # def is_has_k_format(score_info): |
| | | # # (15个交易日涨幅是否大于24.9%,是否破前高,是否超跌,是否接近前高,是否N,是否V,是否有形态,天量大阳信息,是否具有辨识度) |
| | | # |
| | | # if score_info[1][3][6][0] and not score_info[1][3][3][0]: |
| | | # return True |
| | | # if score_info[1][3][7][0]: |
| | | # return True |
| | | # return False |
| | | |
| | | if float(limit_up_price) >= constant.MAX_CODE_PRICE: |
| | | return False, True, f"股价大于{constant.MAX_CODE_PRICE}块" |
| | |
| | | cls.__TradePointManager.delete_buy_cancel_point(code) |
| | | l2_log.debug(code, "delete_buy_cancel_point") |
| | | # 直接下单 |
| | | cls.__buy(code, capture_time, total_datas[compute_index], compute_index, is_first_code) |
| | | ordered = cls.__buy(code, capture_time, total_datas[compute_index], compute_index, is_first_code) |
| | | |
| | | # 数据是否处理完毕 |
| | | if compute_index < compute_end_index: |
| | | cls.__process_order(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False) |
| | | if ordered: |
| | | cls.__process_order(code, compute_index + 1, compute_end_index, capture_time, is_first_code, False) |
| | | else: |
| | | cls.__start_compute_buy(code, compute_index + 1, compute_end_index, threshold_money, capture_time, |
| | | is_first_code) |
| | | else: |
| | | # 未达到下单条件,保存纯买额,设置纯买额 |
| | | # 记录买入信号位置 |