feat(factors): 添加 cs_mean 函数并增强 max_/min_ 单参数支持

- 新增 cs_mean 截面均值函数,支持 GTJA Alpha127 等因子转换
- max_/min_ 支持单参数调用,默认使用 252 天(约 1 年)滚动窗口
This commit is contained in:
2026-03-15 18:00:48 +08:00
parent c6ebab0e58
commit f943cc98d0
21 changed files with 1204 additions and 3980 deletions

View File

@@ -86,7 +86,9 @@ SELECTED_FACTORS = [
]
# 因子定义字典完整因子库用于存放尚未注册到metadata的因子
FACTOR_DEFINITIONS = {}
FACTOR_DEFINITIONS = {
'test': '[([(col("close")) - (col("close").shift([dyn int: 5]).over([col("ts_code")]))]) / (col("close").shift([dyn int: 5]).over([col("ts_code")]))]'
}
def get_label_factor(label_name: str) -> dict: