add extended and sentiment factors handling in factor calculation
This commit is contained in:
parent
574a7c2682
commit
9912d2a26a
@ -585,12 +585,23 @@ def _compute_security_factors(
|
|||||||
volume_ratio = latest_fields.get("daily_basic.volume_ratio")
|
volume_ratio = latest_fields.get("daily_basic.volume_ratio")
|
||||||
results[spec.name] = _volume_ratio_score(volume_ratio)
|
results[spec.name] = _volume_ratio_score(volume_ratio)
|
||||||
else:
|
else:
|
||||||
LOGGER.info(
|
# 检查是否为扩展因子
|
||||||
"忽略未识别的因子 name=%s ts_code=%s",
|
from app.features.extended_factors import EXTENDED_FACTORS
|
||||||
spec.name,
|
extended_factor_names = [spec.name for spec in EXTENDED_FACTORS]
|
||||||
ts_code,
|
|
||||||
extra=LOG_EXTRA,
|
# 检查是否为情绪因子
|
||||||
)
|
sentiment_factor_names = ["sent_momentum", "sent_impact", "sent_market", "sent_divergence"]
|
||||||
|
|
||||||
|
if spec.name in extended_factor_names or spec.name in sentiment_factor_names:
|
||||||
|
# 扩展因子和情绪因子将在后续统一计算,这里不记录日志
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
LOGGER.info(
|
||||||
|
"忽略未识别的因子 name=%s ts_code=%s",
|
||||||
|
spec.name,
|
||||||
|
ts_code,
|
||||||
|
extra=LOG_EXTRA,
|
||||||
|
)
|
||||||
|
|
||||||
# 计算扩展因子值
|
# 计算扩展因子值
|
||||||
calculator = ExtendedFactors()
|
calculator = ExtendedFactors()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user