| | |
| | | |
| | | @classmethod |
| | | def __can_buy_first(cls, code): |
| | | if code.find("60") == 0: |
| | | return False, True, f"上证暂不交易" |
| | | |
| | | if not cls.__TradeStateManager.is_can_buy_cache(): |
| | | return False, True, f"今日已禁止交易" |
| | | |
| | |
| | | limit_up_price = round(float(gpcode_manager.get_limit_up_price(code)), 2) |
| | | # 从成交进度位到截至位置计算大单 |
| | | min_money = l2_data_util.get_big_money_val(limit_up_price) |
| | | left_count, left_money = cancel_buy_strategy.L2DataComputeUtil.compute_left_buy_order(code, trade_index, total_data[-1]["index"], |
| | | left_count, left_money = cancel_buy_strategy.L2DataComputeUtil.compute_left_buy_order(code, |
| | | trade_index, |
| | | total_data[ |
| | | -1][ |
| | | "index"], |
| | | limit_up_price, |
| | | min_money=min_money) |
| | | if left_count < 1: |
| | | return False, False, f"没有已挂或者成交的大单" |
| | | |
| | | |
| | | |
| | | # 暂时注释想买单功能 |
| | | if not cls.__WantBuyCodesManager.is_in_cache(code): |
| | |
| | | threshold_money = threshold_money_new |
| | | order_begin_pos.threshold_money = threshold_money |
| | | |
| | | l2_log.debug(code, "范围:{}-{} m值-{} 量比:{} rebegin_buy_pos:{} clear_buy_single:{}", compute_start_index, compute_end_index, |
| | | l2_log.debug(code, "范围:{}-{} m值-{} 量比:{} rebegin_buy_pos:{} clear_buy_single:{}", compute_start_index, |
| | | compute_end_index, |
| | | threshold_money, cls.volume_rate_info[code][0], |
| | | rebegin_buy_pos, clear_buy_single) |
| | | |
| | |
| | | # 记录买入信号位置 |
| | | if not clear_buy_single: |
| | | # 没有清除信号位置就保存下单位置信息 |
| | | cls.__save_order_begin_data(code, OrderBeginPosInfo(buy_single_index=buy_single_index, buy_exec_index=-1, |
| | | cls.__save_order_begin_data(code, |
| | | OrderBeginPosInfo(buy_single_index=buy_single_index, buy_exec_index=-1, |
| | | buy_compute_index=compute_end_index, num=buy_nums, |
| | | count=buy_count, |
| | | mode_desc=order_begin_pos.mode_desc, |