1.首笔计划下单金额的逻辑梳理修改
2.L2板上盯卖的持仓检查代码格式修改
3.
3个文件已修改
30 ■■■■■ 已修改文件
strategy/buying_strategy.py 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/market_sentiment_analysis.py 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/selling_strategy.py 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/buying_strategy.py
@@ -315,6 +315,9 @@
                                    if strength_list_have_it is True:
                                        logger_info(
                                            f"【有概念 有强度】出现在板块强度大于2的列表中 瞬时量幅比:{round(last_volume_to_growth_ratio, 2)}%,当日当时涨幅:{today_growth}%。")
                                        # if tick_growth >= 0.8:
                                        #     logger_info(
                                        #         f"【有概念 有强度 有强拉】瞬时涨幅 > 0.8% !瞬时涨幅:{round(tick_growth, 2)}%")
                                        if last_volume_to_growth_ratio > 0.8 and (
                                                free_market_value < 40 and current_price < 20):
                                            logger_info(
strategy/market_sentiment_analysis.py
@@ -768,23 +768,14 @@
                        #                                                 usefulMoney * 0.9 * low_emotion_mood_ratio / Unfinished_opening_plan_number)
                        # 除以3应该是一个常量,如果以Unfinished_opening_plan_number,会出现float division by zero
                        # 如果今日计划下单数量不为空 或 计划金额为默认值,那么就实时计算第一次计划金额,并固定记录下来
                        # 如果今日计划下单数量不为空 或 计划金额为默认值,那么就实时计算第计划金额,记录下来
                        if not data_cache.today_planned_order_amount or data_cache.today_first_planned_order_amount <= 0:
                            data_cache.today_planned_order_amount = usefulMoney * 0.95 * ideal_trading_market_score / 3
                            logger.info(f"第一次实时计算计划下单金额==={data_cache.today_planned_order_amount}元")
                            logger.info(f"实时计算计划下单金额==={data_cache.today_planned_order_amount}元")
                        # 开仓计划运行时间段
                        # 计算并固定首次下单时的计划金额(有延迟误差)
                        # # 如果一日三仓的计划还未完成 且 首次开仓金额为0
                        if Unfinished_opening_plan_number != 0 and data_cache.today_first_planned_order_amount <= 0:
                            # 如果GUI看盘手动设置了具体的下单金额【data_cache.BUY_MONEY_PER_CODE 中默认值为-1,只有当GUI看盘手动设置了并提交才会>=0】,就按照GUI设置的金额下单。否则就按照评分策略的金额下单,
                            # if data_cache.BUY_MONEY_PER_CODE >= 0:
                            #     data_cache.today_planned_order_amount = data_cache.BUY_MONEY_PER_CODE
                            #     logger.info(f"采用GUI设置方式=》今日计划下单金额:{data_cache.today_planned_order_amount}")
                            # else:
                            #     # 如果今日还没有一个新增仓位,就不停计算更新计划金额
                            #     if addition_position_number > 0:
                            #         data_cache.today_planned_order_amount = data_cache.opening_strategy_results
                            #         logger.info(f"采用开仓策略计算方式=》今日计划下单金额:{data_cache.today_planned_order_amount}")
                            if addition_position_number > 0:
                                # 下过一次单过后再计算动态下单金额
                                data_cache.today_first_planned_order_amount = float(data_cache.today_planned_order_amount)
strategy/selling_strategy.py
@@ -556,12 +556,12 @@
# L2级数据触发的板上盯的炸板策略
def explosion_strategy(code):
    if code not in data_cache.available_symbols_set:
        return
        return "没在持仓中"
    current_info = data_cache.current_l1_dict.get(code)
    if not current_info:
        return
        return "L1数据不存在"
    # symbol = symbol_code
    symbol = basic_methods.format_stock_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档数据
@@ -573,10 +573,10 @@
            index = i
            break
    if not position_info:
        return
        return "无持仓数据"
    position_volume_yesterday = position_info['availablePosition']  # 股份可用 (可用股份数量)  # 昨日持仓量(可用持仓量)
    # 该股加入到板上盯卖的集合中  所以设定卖出全仓
    if symbol in data_cache.LIMIT_UP_SELL_CODES:
    # 该股加入到板上盯卖的集合中  所以设定卖出全仓  data_cache.LIMIT_UP_SELL_CODES 是华鑫格式的代码
    if code in data_cache.LIMIT_UP_SELL_CODES:
        logger_info(f"板上盯卖 |开启| 进入卖票决策")
        if current_volume < k_line_data[0]['volume'] * 0.6:
            logger_info(