fix: 数据源路由修复与因子计算改进
1. 修复期货路由逻辑:NYMEX期货(.NYM)走YFinance而非Tushare 2. 添加SSH隧道路径修复(原引擎) 3. 因子计算只使用close列(处理部分指数只有收盘价的情况) 4. 添加数据不足和缺失率剔除日志 收益对比: - 原引擎(剔除国债): 累计1804%, 调仓459次 - 新框架: 累计772%, 调仓1276次 差异原因待查: - 国债剔除逻辑不同 - 调仓频率差异
This commit is contained in:
@@ -226,8 +226,10 @@ class TushareSource:
|
||||
return code.endswith(".SH") or code.endswith(".SZ") or code.endswith(".SS") or code.endswith(".CSI")
|
||||
|
||||
def is_futures(self, code: str) -> bool:
|
||||
"""判断是否为期货"""
|
||||
return ".SHF" in code or ".NYM" in code or ".DCE" in code or ".CZC" in code
|
||||
"""判断是否为中国期货(仅支持上期所、大商所、郑商所)"""
|
||||
# 只支持中国交易所期货(.SHF上期所、.DCE大商所、.CZC郑商所)
|
||||
# NYMEX (.NYM) 和 ICE (.ICE) 走 YFinance
|
||||
return ".SHF" in code or ".DCE" in code or ".CZC" in code
|
||||
|
||||
def fetch(self, code: str, start_date: str, end_date: str) -> Optional[pd.DataFrame]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user