admin
2 天以前 cc71c85009471c1dfce6cc4644267657c2a14263
utils/hx_qc_value_util.py
@@ -71,6 +71,8 @@
    @param end_date:
    @return:
    """
    if not end_date:
        end_date = tool.get_now_date_str()
    load_latest_trade_calendar()
    _count = -1
    start_date = None
@@ -110,6 +112,7 @@
    end_date = tool.get_now_date_str()
    end_date = tool.date_sub(end_date, -30)
    days = get_trade_calendar(tool.date_sub(end_date, 365), end_date)
    logger_debug.info(f"华鑫API获取交易日历结果:{days}")
    for i in range(0, len(days)):
        if 0 < i < len(days) - 1:
            __trade_calendar_dict[days[i]] = (days[i - 1], days[i + 1])
@@ -161,6 +164,7 @@
                    """
                   值的格式为:
                    {
                       "PreClosePrice":pStockIndexData,
                       "LastPrice": pStockIndexData.LastPrice,
                       "SecurityID": pStockIndexData.SecurityID,
                       "UpdateTime": pStockIndexData.UpdateTime,
@@ -170,7 +174,7 @@
                   }
                   """
                    d = data[k]
                    data_cache.stock_index_dict[k] = (round(d["LastPrice"], 2), d["Volume"], d["Turnover"])
                    data_cache.stock_index_dict[k] = (round(d["LastPrice"], 2), d["Volume"], d["Turnover"], d["PreClosePrice"])
        except:
            pass