feat: signal abstraction layer + sizer + HS300 universe + PnL/IC reports

This commit is contained in:
Yuxuan Yan
2026-06-07 09:44:33 +08:00
parent 085e51abf1
commit da01312292
20 changed files with 610 additions and 23 deletions
+22
View File
@@ -0,0 +1,22 @@
"""Short-horizon reversal signal."""
import pandas as pd
from signals.base import AlphaSignal
class ReversalSignal(AlphaSignal):
"""Negative trailing return: oversold stocks score high.
The signal is ``-close.pct_change(lookback)``, so a stock that fell over the
lookback window gets a positive (bullish) score.
"""
def __init__(self, lookback: int = 5):
self.lookback = lookback
def compute(self, df: pd.DataFrame) -> pd.Series:
return -df["close"].pct_change(self.lookback)
@property
def name(self) -> str:
return f"reversal_{self.lookback}d"