| | |
| | | @param end_date: |
| | | @return: |
| | | """ |
| | | if not end_date: |
| | | end_date = tool.get_now_date_str() |
| | | load_latest_trade_calendar() |
| | | _count = -1 |
| | | start_date = None |
| | |
| | | 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]) |
| | |
| | | """ |
| | | 值的格式为: |
| | | { |
| | | "PreClosePrice":pStockIndexData, |
| | | "LastPrice": pStockIndexData.LastPrice, |
| | | "SecurityID": pStockIndexData.SecurityID, |
| | | "UpdateTime": pStockIndexData.UpdateTime, |
| | |
| | | } |
| | | """ |
| | | 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 |
| | | |