| | |
| | | trade_price = current_price_process_manager.get_trade_price(code) |
| | | if trade_price is None: |
| | | return False, True, f"尚未获取到当前成交价" |
| | | if False and float(limit_up_price) - float(trade_price) > 0.00001: |
| | | # 计算信号起始位置到当前的手数 |
| | | order_begin_pos = cls.__get_order_begin_pos( |
| | | code) |
| | | num_operate_map = local_today_num_operate_map.get(code) |
| | | total_num = 0 |
| | | for i in range(order_begin_pos.buy_single_index, total_data[-1]["index"] + 1): |
| | | data = total_data[i] |
| | | val = data["val"] |
| | | if not L2DataUtil.is_limit_up_price_buy(val): |
| | | continue |
| | | left_count = l2_data_source_util.L2DataSourceUtils.get_limit_up_buy_no_canceled_count_v2(code, |
| | | data[ |
| | | "index"], |
| | | total_data, |
| | | local_today_canceled_buyno_map.get( |
| | | code)) |
| | | total_num += left_count * val["num"] |
| | | m_base_val = l2_trade_factor.L2PlaceOrderParamsManager.get_base_m_val(code) |
| | | thresh_hold_num = m_base_val // (float(gpcode_manager.get_limit_up_price(code)) * 100) |
| | | if total_num < thresh_hold_num * 2: |
| | | return False, False, f"当前成交价({trade_price})尚未在0档及以内 且 纯买额({total_num})小于2倍M值({thresh_hold_num * 2})" |
| | | # 判断是否为板上放量: |
| | | # 1.当前成交价为涨停价 |
| | | # 2.总卖额为0 |
| | | if abs(float(limit_up_price) - float(trade_price)) < 0.001: |
| | | sell_data = cls.__L2MarketSellManager.get_current_total_sell_data(code) |
| | | if sell_data and sell_data[1]<=0: |
| | | # 板上放量,判断是否有放量,放量才会下单 |
| | | # 获取最近1s的主动卖金额 |
| | | min_time = total_data[order_begin_pos.buy_single_index]['val']['time'] |
| | | min_time = tool.trade_time_add_second(min_time, -1) |
| | | sell_orders = HuaXinSellOrderStatisticManager.get_latest_transaction_datas(code, min_deal_time=min_time) |
| | | sell_order_num = sum([x[1] for x in sell_orders]) |
| | | sell_money = int(float(limit_up_price) * sell_order_num) |
| | | if sell_money < 2990000: |
| | | return False, False, f"板上放量金额不足,近1s总卖:{sell_money}小于299w" |
| | | # 判断成交进度是否距离我们的位置很近 |
| | | trade_index, is_default = cls.__TradeBuyQueue.get_traded_index(code) |
| | | if False and not is_default and trade_index: |