fix: 数据源路由修复与因子计算改进

1. 修复期货路由逻辑:NYMEX期货(.NYM)走YFinance而非Tushare
2. 添加SSH隧道路径修复(原引擎)
3. 因子计算只使用close列(处理部分指数只有收盘价的情况)
4. 添加数据不足和缺失率剔除日志

收益对比:
- 原引擎(剔除国债): 累计1804%, 调仓459次
- 新框架: 累计772%, 调仓1276次

差异原因待查:
- 国债剔除逻辑不同
- 调仓频率差异
This commit is contained in:
2026-05-12 00:47:43 +08:00
parent a7a4a69153
commit 19131c41dd
6 changed files with 76 additions and 36 deletions

View File

@@ -34,8 +34,8 @@ class SSHTunnelManager:
# 处理 key_path如果是相对路径转换为绝对路径
key_path = config.get("key_path", "")
if key_path and not os.path.isabs(key_path):
# 相对于项目根目录
project_root = Path(__file__).parent.parent.parent
# 相对于项目根目录需要跳5层datasource->core->legacy_core->archive->etf
project_root = Path(__file__).parent.parent.parent.parent.parent
key_path = str(project_root / key_path)
self.key_path = key_path
print(f"SSH 私钥路径: {self.key_path}")

View File

@@ -32,8 +32,8 @@ class SSHTunnelManager:
# 处理 key_path如果是相对路径转换为绝对路径
key_path = config.get("key_path", "")
if key_path and not os.path.isabs(key_path):
# 相对于项目根目录
project_root = Path(__file__).parent.parent.parent
# 相对于项目根目录需要跳5层datasource->core->legacy_core->archive->etf
project_root = Path(__file__).parent.parent.parent.parent.parent
key_path = str(project_root / key_path)
self.key_path = key_path