Administrator
2023-08-17 9ec7d91a46bad23927a84bb6355e8766ecdb9d24
code_attribute/first_target_code_data_processor.py
@@ -34,7 +34,7 @@
            codes.append(code)
    # ---查询想买单,如果没有在列表中就需要强行加入列表
    want_codes = gpcode_manager.WantBuyCodesManager.list_code()
    want_codes = gpcode_manager.WantBuyCodesManager().list_code_cache()
    if want_codes:
        # 没有在现价采集中的想买代码
        diff_codes = set(want_codes) - set(codes)
@@ -105,13 +105,13 @@
        need_get_volumn = False
        if code not in global_util.max60_volumn or global_util.max60_volumn.get(code) is None:
            need_get_volumn = True
        if not need_get_volumn and code_nature_analyse.CodeNatureRecordManager.get_nature(
        if not need_get_volumn and code_nature_analyse.CodeNatureRecordManager.get_nature_cache(
                code) is None:
            need_get_volumn = True
        if need_get_volumn:
            limit_up_price = gpcode_manager.get_limit_up_price(code)
            if limit_up_price is None:
                inited_data.re_set_price_pres([code], True)
                continue
            try:
                volumes_data = inited_data.get_volumns_by_code(code, 150)
                volumes = inited_data.parse_max_volume(volumes_data[:90],
@@ -134,14 +134,14 @@
                                                     volumes_data)
            except Exception as e:
                logger_first_code_record.error(f"{code}:{str(e)}")
    gpcode_manager.FirstCodeManager.add_record(codes)
    gpcode_manager.FirstCodeManager().add_record(codes)
    # 初始化板块信息
    for code in codes:
        block_info.init_code(code)
    if new_add_codes:
        gpcode_manager.set_first_gp_codes_with_data(HistoryKDatasUtils.get_gp_latest_info(codes,
                                                                                          fields="symbol,sec_name,sec_type,sec_level"))
        gpcode_manager.FirstGPCodesManager().set_first_gp_codes_with_data(HistoryKDatasUtils.get_gp_latest_info(codes,
                                                                                                                fields="symbol,sec_name,sec_type,sec_level"))
        # 加入首板历史记录
        logger_first_code_record.info("新增首板:{}", new_add_codes)
@@ -190,8 +190,8 @@
            limit_up_time = tool.get_now_time_str()
        if is_limit_up:
            # 加入首板涨停
            gpcode_manager.FirstCodeManager.add_limited_up_record([code])
        pricePre = gpcode_manager.get_price_pre(code)
            gpcode_manager.FirstCodeManager().add_limited_up_record([code])
        pricePre = gpcode_manager.CodePrePriceManager.get_price_pre_cache(code)
        if pricePre is None:
            inited_data.re_set_price_pres([code])
@@ -201,10 +201,10 @@
             "limit_up": is_limit_up})
        if code in new_add_codes:
            if is_limit_up:
                place_order_count = trade_data_manager.placeordercountmanager.get_place_order_count(
                place_order_count = trade_data_manager.PlaceOrderCountManager().get_place_order_count(
                    code)
                if place_order_count == 0:
                    trade_data_manager.placeordercountmanager.place_order(code)
                    trade_data_manager.PlaceOrderCountManager().place_order(code)
    gpcode_first_screen_manager.process_ticks(prices)