L2大单在否函数返回结果
有强度有强拉策略分支中加入 有大单 限制条件
2个文件已修改
11 ■■■■ 已修改文件
strategy/L2_data_analysis.py 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/buying_strategy.py 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/L2_data_analysis.py
@@ -55,15 +55,17 @@
    # 遍历转换后的列表
    for sublist in true_lists:
        if sublist and sublist[0] and sublist[0][0] == code:
            logger.info(f"找到大单的对应行列表 sublist[0]===={sublist[0]}")
            logger.info(f"找到L2大单,对应行列表: sublist[0]===={sublist[0]}")
            # print(f"找到大单的对应行列表 sublist[0]===={sublist[0]}")
            found = True  # 设置标志为 True,表示找到了
    # 检查是否没有找到特定股票代码
    if not found:
        logger.info(f"没有找到这个货:{code}")
        logger.info(f"没有找到L2大单:{code}")
        # print(f"没有找到这个货:{code}")
    return found
if __name__ == '__main__':
    # 测试的时候可以调用一下
strategy/buying_strategy.py
@@ -283,6 +283,8 @@
                        # 进入乐观涨幅区间
                        if 0 <= today_growth <= 6.5:
                            # logger_info(f"进入乐观涨幅区间!公司名称:{k_line_data[0]['sec_name']},当日当时涨幅:{today_growth},当前时间:{current_data['created_at']}")
                            # 调用L2大单记录在否函数检查返回结果
                            L2_found_big_order = L2_data_analysis.find_L2_big_order_of_code(symbol_code)
                            # 进入无高位风险 且 无二次近前高风险等 视界
                            if k_line_data[0]['risk_position'] not in ['recent_high_position_risk',
                                                                       'recent_second_break_near_high_position_risk',
@@ -544,6 +546,9 @@
                                                        free_market_value == 0 or free_market_value == 0.0) and free_market_value < 6:
                                                    logger_info(
                                                        f"【不利】自由市值小于6亿!不买!! 公司名称:{k_line_data[0]['sec_name']},最新价: {current_price}")
                                                elif L2_found_big_order is False:
                                                    logger_info(
                                                        f"【不利】L2记录中未发现大单!不买!! 公司名称:{k_line_data[0]['sec_name']},最新价: {current_price}")
                                                elif data_cache.have_strength_buy_times >= 1:
                                                    logger_info(f"【不利】有强度买入 1 次了!不买了!!公司名称:{k_line_data[0]['sec_name']},")
                                                    L2_data_analysis.find_L2_big_order_of_code(symbol_code)