Administrator
2024-04-17 627a78af20d49295ac2e8ae73e3e6037bb7826eb
添加日志
2个文件已修改
56 ■■■■ 已修改文件
code_attribute/global_data_loader.py 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
l2/l2_data_manager_new.py 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
code_attribute/global_data_loader.py
@@ -40,11 +40,14 @@
def load_volumn():
    codes = gpcode_manager.get_gp_list()
    for code in codes:
        max60, yesterday = code_volumn_manager.get_histry_volumn(code)
        today = code_volumn_manager.get_today_volumn(code)
        global_util.max60_volumn[code] = max60
        global_util.yesterday_volumn[code] = yesterday
        global_util.today_volumn[code] = today
        try:
            max60, yesterday = code_volumn_manager.get_histry_volumn(code)
            today = code_volumn_manager.get_today_volumn(code)
            global_util.max60_volumn[code] = max60
            global_util.yesterday_volumn[code] = yesterday
            global_util.today_volumn[code] = today
        except:
            pass
# 添加今日涨停数据
l2/l2_data_manager_new.py
@@ -406,7 +406,6 @@
                                pass
                            async_log_util.info(logger_l2_process, f"code:{code} 获取到下单真实位置:{place_order_index}")
                    # 处理涨停卖与涨停卖撤
                    try:
                        for d in add_datas:
@@ -1361,7 +1360,8 @@
            # if code.find('60') == 0:
            # 激进买
            continue_count = 1
            has_single, _index, sell_info = cls.__compute_active_order_begin_pos(code, continue_count, compute_start_index, compute_end_index)
            has_single, _index, sell_info = cls.__compute_active_order_begin_pos(code, continue_count,
                                                                                 compute_start_index, compute_end_index)
            fast_msg = None
            if has_single:
                order_begin_pos.mode = OrderBeginPosInfo.MODE_ACTIVE
@@ -1487,7 +1487,7 @@
                order_begin_pos.num,
                order_begin_pos.count,
                order_begin_pos.threshold_money,
                order_begin_pos.buy_single_index, order_begin_pos.max_num_set,order_begin_pos.sell_info[1])
                order_begin_pos.buy_single_index, order_begin_pos.max_num_set, order_begin_pos.sell_info[1])
            threshold_money = threshold_money_new
            order_begin_pos.threshold_money = threshold_money
        elif order_begin_pos.mode == OrderBeginPosInfo.MODE_FAST:
@@ -1727,6 +1727,22 @@
            if refer_sell_data is None:
                refer_sell_data = (start_time_str, 0, 0, (round(float(total_datas[start_index]["val"]["price"]), 2), 0))
                l2_log.debug(code, f"丢失总卖额,设置默认为0,计算范围:{start_index}-{end_index}")
            # 判断是否为真的板上放量
            single = place_order_single_data_manager.L2TradeSingleDataManager.get_valid_trade_single(
                code,
                tool.to_time_with_ms(total_datas[end_index]['val']['time'], total_datas[end_index]['val']['tms']))
            trade_price_info = HuaXinSellOrderStatisticManager.get_latest_trade_price_info(code)
            limit_up_price = gpcode_manager.get_limit_up_price(code)
            is_limit_up = False
            if limit_up_price and trade_price_info and abs(trade_price_info[0] - float(limit_up_price)) < 0.001:
                is_limit_up = True
            if refer_sell_data[1] > 0 or single or not is_limit_up:
                # 不是板上放量
                pass
            else:
                # 板上放量
                pass
            # 获取当前是否可激进买
            # 获取板块是否可以激进买
            # 可买的板块, 是否独苗, 消息, 可买的强势板块, 关键词, 激进买的板块
@@ -1735,23 +1751,6 @@
                # 有可买板块,有激进买板块
                # 第一步: 计算总卖额
                threshold_money, sell_1_price = refer_sell_data[1], refer_sell_data[3][0]
                if code.find("60") == 0:
                    threshold_money = 0
                else:
                    pass
                    # for i in range(start_index - 1, -1, -1):
                    #     val = total_datas[i]["val"]
                    #     if tool.compare_time(val["time"], refer_sell_data[0]) < 0:
                    #         # 将本s的计算上去
                    #         break
                    #     if L2DataUtil.is_sell(val):
                    #         threshold_money += val["num"] * int(float(val["price"]) * 100)
                    #     elif L2DataUtil.is_sell_cancel(val):
                    #         threshold_money -= val["num"] * int(float(val["price"]) * 100)
                    #     elif L2DataUtil.is_buy(val):
                    #         # 判断价格(大于卖1) 被买吃掉
                    #         if round(float(val["price"]), 2) - sell_1_price >= 0:
                    #             threshold_money -= val["num"] * int(float(val["price"]) * 100)
                # 第二步:计算起始信号
                second_930 = 9 * 3600 + 30 * 60 + 0
                total_datas = local_today_datas.get(code)
@@ -2162,7 +2161,7 @@
        threshold_money = threshold_money_origin
        # 目标手数
        threshold_num = 0 # round(threshold_money / (limit_up_price * 100))
        threshold_num = 0  # round(threshold_money / (limit_up_price * 100))
        bigger_threshold_num = round(5000 / (limit_up_price))
        # buy_single_time_seconds = L2DataUtil.get_time_as_second(total_datas[buy_single_index]["val"]["time"])
@@ -2265,7 +2264,7 @@
            elif code.find("00") == 0:
                # 深证非板上放量
                safe_count = 2
            if  code.find("60") == 0:
            if code.find("60") == 0:
                # 上证安全笔数为3
                safe_count = 3
            if buy_count < safe_count: