admin
2025-04-16 ddb27ef9f3d8da5edca359d14c469e12dffbe213
strategy/buying_strategy.py
@@ -109,6 +109,22 @@
    async_log_util.info(logger, content)
# 获取具体的下单金额【具体选用哪一个参数作为下单金额,判断依据有优先级】
def get_order_money():
    """
    获取下单金额
    :return:
    """
    if data_cache.BUY_MONEY_PER_CODE > 0:
        logger.info(f"采用GUI设置方式=》今日计划下单金额:{data_cache.BUY_MONEY_PER_CODE}")
        return data_cache.BUY_MONEY_PER_CODE
    if data_cache.today_first_planned_order_amount > 0:
        logger.info(f"采用开仓策略首次计算结果=》今日计划下单金额:{data_cache.today_first_planned_order_amount}")
        return data_cache.today_first_planned_order_amount
    logger.info(f"采用开仓策略实时计算方式=》今日计划下单金额:{data_cache.today_planned_order_amount}")
    return data_cache.today_planned_order_amount
# 涨幅视界策略【根据涨幅进入视界为起始的策略】
def growth_view_strategy(current_info):
    symbol_code = current_info[0]  # 券商接口为纯数字编号
@@ -349,10 +365,10 @@
                                            logger_info(
                                                f"最新价: {current_price}, 当日最高价:{current_high},瞬时涨幅: {tick_growth:.2f}%,当日当时涨幅:{today_growth}%,公司名称:{k_line_data[0]['sec_name']},当前时间:{current_created_at},低于水位线:{deep_low:.2f},交易量今日与昨日的比例{round(current_volume / k_line_data[0]['volume'], 2)}")
                                            logger_info(
                                                f"大盘综合强度分数:{data_cache.real_time_market_strong},大盘指数情绪预期分数==={data_cache.index_trend_expectation_score}分,设想的下单金额:{data_cache.today_planned_order_amount}")
                                                f"大盘综合强度分数:{data_cache.real_time_market_strong},大盘指数情绪预期分数==={data_cache.index_trend_expectation_score}分,设想的下单金额:{get_order_money()}")
                                            # 调用下单方法下单
                                            order_methods.buy_order_by_value(symbol,
                                                                             data_cache.today_planned_order_amount,
                                                                             get_order_money(),
                                                                             k_line_data[0]['sec_name'],
                                                                             current_price)
                                            # 查看一下该股有无大单
@@ -535,10 +551,10 @@
                                                    logger_info(
                                                        f"最新价: {current_price}, 当日最高价:{current_high},瞬时涨幅: {tick_growth:.2f}%,当日当时涨幅:{today_growth}%,公司名称:{k_line_data[0]['sec_name']},当前时间:{current_created_at},低于水位线:{deep_low:.2f},交易量今日与昨日的比例{round(current_volume / k_line_data[0]['volume'], 2)}")  # 输出当前价格和3秒涨幅信息
                                                    logger_info(
                                                        f"大盘综合强度分数:{data_cache.real_time_market_strong},大盘指数情绪预期分数==={data_cache.index_trend_expectation_score}分,设想的下单金额:{data_cache.today_planned_order_amount}")
                                                        f"大盘综合强度分数:{data_cache.real_time_market_strong},大盘指数情绪预期分数==={data_cache.index_trend_expectation_score}分,设想的下单金额:{get_order_money()}")
                                                    # 调用下单方法下单
                                                    order_methods.buy_order_by_value(symbol,
                                                                                     data_cache.today_planned_order_amount,
                                                                                     get_order_money(),
                                                                                     k_line_data[0]['sec_name'],
                                                                                     current_price)
                                                    # # 将有强度买入次数自加1