admin
2025-03-14 d8b13cde5467bc5a8158e524f680b35fb486230a
日志调整
9个文件已修改
34 ■■■■ 已修改文件
constant.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/L2_data_analysis.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/all_K_line.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/buying_strategy.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/check_timer.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/index_market_trend_strategy.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/instant_time_market.py 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/kpl_api.py 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
strategy/selling_strategy.py 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
constant.py
@@ -59,6 +59,8 @@
# 定义log日志的路径
LOG_PATH = f"{get_path_prefix()}/logs"
# 定义L2数据日志的路径
L2_LOG_PATH = f"{get_path_prefix()}/low_suction_log/huaxin/l2"
DATA_DIR_PATH = f"{get_path_prefix()}/local_storage_data"
strategy/L2_data_analysis.py
@@ -40,7 +40,7 @@
    # 获取当前日期,并格式化为 'YYYY-MM-DD'
    current_date = datetime.datetime.now().strftime('%Y-%m-%d')
    # 声明要转义的文件的路径
    log_file_path = f'{constant.LOG_PATH}/transaction.{current_date}.log'
    log_file_path = f'{constant.L2_LOG_PATH}/transaction.{current_date}.log'
    # 检查文件是否存在,如果存在则继续处理,如果不存在则就此打住
    if not os.path.exists(log_file_path):
        logger.info(f"Error错误:{log_file_path}----文件不存在!")
strategy/all_K_line.py
@@ -448,7 +448,7 @@
    while True:
        try:
            # 声明赋值实时时间
            now_time = datetime.datetime.now().strftime("%H:%M:%S")
            now_time = data_cache.now_time
            # print(f"now_time==={now_time}")
            # if now_time > data_cache.AFTER_CLOSING_TIME and data_cache.execution is False:
strategy/buying_strategy.py
@@ -239,7 +239,7 @@
                    # 创建一个已买板块集合
                bought_plate_set = set(data_cache.bought_plate)
                # 设定当前时间点
                now_time = datetime.datetime.now().strftime("%H:%M:%S")
                now_time = data_cache.now_time
                '''
                新多分支条件逻辑视界【概念?强度?强拉?消息?价值?】
                '''
strategy/check_timer.py
@@ -1,13 +1,13 @@
"""
定义整个项目的定时器
"""
import datetime
# import datetime
import time
from log_module.log import logger_common
from strategy import data_cache
from strategy import kpl_api
from strategy import instant_time_market
# from strategy import instant_time_market
# 获取logger实例
logger = logger_common
@@ -23,7 +23,7 @@
    while True:
        try:
            # 声明赋值实时时间
            now_time = datetime.datetime.now().strftime("%H:%M:%S")
            now_time = data_cache.now_time
            # print(f"now_time==={now_time}")
            if now_time > data_cache.AFTER_CLOSING_TIME and data_cache.execution is False:
                # 整理当日涨停信息并写入本地管理好本地数据
strategy/index_market_trend_strategy.py
@@ -70,7 +70,7 @@
        logger.info(f"创业板指 当日涨幅 ==== {round(data_cache.TSXV_today_growth, 4)}%")
        # 在集合竞价时更新一下 各个指数的开盘涨幅
        now_time = datetime.datetime.now().strftime("%H:%M:%S")
        now_time = data_cache.now_time
        # 9:25:06 < now_time < 9:25:12 记录开盘指数 及 开盘涨幅
        if data_cache.LATER_OPEN_BIDDING_TIME < now_time < data_cache.AFTER_OPEN_BIDDING_TIME:
            index_K_line['Shanghai']['Shanghai_open_index'] = Shanghai_index
strategy/instant_time_market.py
@@ -31,7 +31,7 @@
        try:
            # 在data_cache中获取到推送过来的实时指数行情数据
            stock_index_dict = data_cache.stock_index_dict
            now_time = datetime.datetime.now().strftime("%H:%M:%S")
            now_time = data_cache.now_time
            if len(stock_index_dict) == 0 and data_cache.L1_DATA_START_TIME < now_time < data_cache.CLOSING_TIME:
                print(f"9:15--15:00 实时指数数据为空===={stock_index_dict}")
            index_judge_thread_manager(stock_index_dict)
@@ -69,7 +69,7 @@
def get_all_stocks_current_open(current_infos):
    pass
    # 获取当前时间
    now_time = datetime.datetime.now().strftime("%H:%M:%S")
    now_time = data_cache.now_time
    # 如果当前时间大于09:25:06才运行最高价和最低价的运算
    if data_cache.LATER_OPEN_BIDDING_TIME < now_time:
        # if data_cache.AFTER_CLOSING_TIME < now_time:
@@ -158,7 +158,7 @@
# 生成所有个股的最高价、最低价 字典
def get_all_stocks_current_high_and_low(current_infos):
    # 获取当前时间
    now_time = datetime.datetime.now().strftime("%H:%M:%S")
    now_time = data_cache.now_time
    # 如果当前时间大于09:25:06才运行最高价和最低价的运算
    if data_cache.LATER_OPEN_BIDDING_TIME < now_time:
        # if data_cache.AFTER_CLOSING_TIME < now_time:
@@ -270,7 +270,7 @@
        try:
            now_start = time.time()
            current_infos = l1_data_api.get_current_info()
            now_time = datetime.datetime.now().strftime("%H:%M:%S")
            now_time = data_cache.now_time
            if len(current_infos) == 0 and now_time > data_cache.L1_DATA_START_TIME:
                print(f"9:15后 l1数据为空=l1_data_current_infos===={current_infos}")
            # for i in current_infos:
@@ -301,7 +301,7 @@
    logging.info(f"set_current_info进入")
    try:
        now_start = time.time()
        now_time = datetime.datetime.now().strftime("%H:%M:%S")
        now_time = data_cache.now_time
        if len(current_infos) == 0 and now_time > data_cache.L1_DATA_START_TIME:
            print(f"9:15后 l1数据为空=l1_data_current_infos===={current_infos}")
        # for i in current_infos:
strategy/kpl_api.py
@@ -278,7 +278,7 @@
            ds.append(request_plate_codes(d))
        dask_result = batch_get_plate_codes(ds)
        dask_result.compute()
        now_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
        now_time = data_cache.now_time
        if data_cache.L1_DATA_START_TIME < now_time < data_cache.CLOSING_TIME:
            logger.info(f"精选板块股票强度数据更新 == {market_sift_plate_stock_dict}")
    return market_sift_plate_stock_dict
@@ -331,7 +331,7 @@
# 获取涨停板块名称列表并存储本地的函数
def get_limit_up_block_names():
    # 设定当前时间点
    now_time = datetime.datetime.now().strftime("%H:%M:%S")
    now_time = data_cache.now_time
    # print(f"now_time===={now_time}")
    if data_cache.SERVER_RESTART_TIME < now_time < data_cache.UPDATE_DATA_TIME:
        # print(f"在时间内使用--------------------------")
@@ -718,7 +718,7 @@
    while True:
        try:
            if data_cache.position_automatic_management_switch is True:
                now_time = datetime.datetime.now().strftime("%H:%M:%S")
                now_time = data_cache.now_time
                if data_cache.SERVER_RESTART_TIME < now_time < data_cache.UPDATE_DATA_TIME:
                    # 获取大盘综合强度分数
                    data_cache.real_time_market_strong = get_market_strong()
strategy/selling_strategy.py
@@ -96,7 +96,7 @@
# 分时变化策略
def instantaneous_change_strategy(current_info):
    # 设定当前时间点
    now_time = datetime.datetime.now().strftime("%H:%M:%S")
    now_time = data_cache.now_time
    symbol_code = current_info[0]  # 券商接口为纯数字编号
    # symbol = symbol_code
    symbol = basic_methods.format_stock_symbol(symbol_code)  # 转化为掘金数据来源的股票代码