Administrator
2024-12-31 2ccd2ee1112ee84f5139fc5b8cf2ce070f8f991e
测试
4个文件已修改
25 ■■■■■ 已修改文件
api/outside_api_command_callback.py 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
huaxin_client/l1_api_client.py 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/history_k_data_manager.py 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
third_data/hx_qc_value_util.py 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/outside_api_command_callback.py
@@ -487,7 +487,7 @@
        try:
            fdata = {}
            try:
                date = HistoryKDatasUtils.get_previous_trading_date(tool.get_now_date_str())
                date = HistoryKDatasUtils.get_trading_dates(tool.date_sub(tool.get_now_date_str(), 10) ,tool.get_now_date_str())
                if date:
                    fdata["juejin"] = 1
            except Exception as e:
@@ -545,6 +545,7 @@
            # 获取今日K线的更新数量
            try:
                dates = HistoryKDatasUtils.get_latest_trading_date_cache(5)
                logger_debug.info(f"获取到的交易日:{dates}")
                latest_trading_date = None
                if dates:
                    latest_trading_date = dates[0]
@@ -552,6 +553,7 @@
                    raise Exception("没有获取到上一个交易日的日期")
                codes = HistoryKDataManager().get_history_bars_codes(latest_trading_date)
                count = len(codes)
                logger_debug.info(f"K线代码数量:{count}")
                fdata["today_history_k_bar_count"] = count
            except Exception as e:
                logger_debug.exception(e)
huaxin_client/l1_api_client.py
@@ -3,8 +3,9 @@
import threading
import time
import constant
import qcvalueaddproapi
from log_module.log import logger_system, logger_debug
from log_module.log import logger_system
from utils import tool
global g_userid, g_passwd, g_address, g_port, g_seqnum
@@ -250,7 +251,6 @@
    while True:
        try:
            val = request_queue.get()
            logger_debug.info(f"读取华鑫增值服务请求:{val}")
            type_ = val['type']
            request_id = val['request_id']
            data = val.get('data')
@@ -268,7 +268,7 @@
                results = thespi.queryBars(code, start_date, end_date)
                __set_response_data(request_id, results)
        except Exception as e:
            logger_debug.exception(e)
            pass
def run(request_queue: multiprocessing.Queue, response_queue: multiprocessing.Queue):
@@ -283,10 +283,10 @@
    g_port = 25556
    g_userid = "388000013942"
    g_passwd = "110808"
    # 内网
    g_address = "192.168.84.61"
    g_port = 25557
    if not constant.is_windows():
        # 内网
        g_address = "192.168.84.61"
        g_port = 25557
    #IP(192.168.84.61)、端口(25557
third_data/history_k_data_manager.py
@@ -24,7 +24,6 @@
        for code in codes_:
            try:
                datas = init_data_util.get_volumns_by_code(code, 150)
                logger_debug.info(f"获取到的K线:{datas}")
                if datas:
                    HistoryKDataManager().save_history_bars(code, datas[0]['bob'].strftime("%Y-%m-%d"), datas)
            except Exception as e:
@@ -187,3 +186,7 @@
                if file.find(day) >= 0:
                    codes.add(file.split("_")[1][:6])
        return codes
if __name__ == "__main__":
    print(HistoryKDataManager().get_history_bars_codes("2024-12-31"))
third_data/hx_qc_value_util.py
@@ -70,7 +70,6 @@
    @param end_date:
    @return:
    """
    logger_debug.info("get_history_k_bars开始")
    load_latest_trade_calendar()
    _count = -1
    start_date = None
@@ -85,7 +84,6 @@
            start_date = __trade_calendar_list[i]
        if _count >= count:
            break
    logger_debug.info(f"get_history_k_bars 获取到开始日期:{start_date}")
    request_id = __base_request("get_history_k_bars", {"start_date": start_date, "end_date": end_date, "code": code})
    return __read_response(request_id)