admin
2025-04-09 e2ecb8701e756b72fe0481ee43eb68cc956c4532
strategy/selling_strategy.py
@@ -543,3 +543,63 @@
                                    order_methods.sell_order_by_part_volume(1, symbol, position_volume_yesterday,
                                                                            current_price,
                                                                            k_line_data[0]['sec_name'], index)
def explosion_strategy(code):
    if code not in data_cache.available_symbols_set:
        return
    current_info = data_cache.current_l1_dict.get(code)
    if not current_info:
        return
    # symbol = symbol_code
    symbol = basic_methods.format_stock_symbol(code)  # 转化为掘金数据来源的股票代码
    current_price = current_info[2]  # 获取当前最新价
    current_volume = current_info[3]  # 当日当时的总成交量
    current_quotes_sell = current_info[6]  # 卖5档数据
    k_line_data = data_cache.all_stocks_all_K_line_property_dict.get(symbol, None)
    position_info, index = None, None
    for i, element in enumerate(data_cache.account_positions_dict):
        if code == element['securityID']:  # 当循环到的持仓代码正好是current_data的代码时,即取得了持仓个股的行情快照数据
            position_info = element
            index = i
            break
    if not position_info:
        return
    position_volume_yesterday = position_info['availablePosition']  # 股份可用 (可用股份数量)  # 昨日持仓量(可用持仓量)
    if current_volume < k_line_data[0]['volume'] * 0.6:
        logger_info(
            f"【开盘临机】-【 炸板中!!且当日量不足】【{k_line_data[0]['sec_name']}】 卖一数量不等于0,设定委卖数量【十分之一仓】,当日当时量:{current_volume}")
        order_methods.sell_order_by_part_volume(0.1, symbol,
                                                position_volume_yesterday,
                                                current_price,
                                                k_line_data[0]['sec_name'],
                                                index)
    # 如果 卖二 量炸出来了,那么就是彻底炸开了。
    if current_quotes_sell[1][1] != 0:
        logger_info(
            f"【开盘临机】-【 炸板炸开了!!】【{k_line_data[0]['sec_name']}】 卖二数量不等于0,设定委卖数量【十分之二仓】,当日当时量:{current_volume}")
        order_methods.sell_order_by_part_volume(0.2, symbol,
                                                position_volume_yesterday,
                                                current_price,
                                                k_line_data[0]['sec_name'],
                                                index)
        if current_volume < k_line_data[0]['volume'] * 0.8:
            logger_info(
                f"【开盘临机】-【 炸板!!且当日量不足】【{k_line_data[0]['sec_name']}】 买盘小于1万 且 今日量小于昨日量的 0.8,当日当时量:{current_volume}")
            # 该股加入到板上盯卖的集合中  所以设定卖出全仓
            if symbol in data_cache.LIMIT_UP_SELL_CODES:
                logger_info(
                    f"【开盘临机】-【 炸板!!且当日量不足】【{k_line_data[0]['sec_name']}】 板上盯卖 |开启| 设定委卖【全仓】")
                order_methods.sell_order_by_part_volume(1, symbol,
                                                        position_volume_yesterday,
                                                        current_price,
                                                        k_line_data[0]['sec_name'],
                                                        index)
            else:
                logger_info(
                    f"【开盘临机】-【 炸板!!且当日量不足】【{k_line_data[0]['sec_name']}】 板上盯卖 |关闭| 设定委卖【十分之一仓】")
                order_methods.sell_order_by_part_volume(0.1, symbol,
                                                        position_volume_yesterday,
                                                        current_price,
                                                        k_line_data[0]['sec_name'],
                                                        index)