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
+28
View File
@@ -0,0 +1,28 @@
"""Base class for cross-sectional alpha signals."""
from abc import ABC, abstractmethod
import pandas as pd
class AlphaSignal(ABC):
"""A signal that maps a single stock's OHLCV history to a per-bar score.
Higher scores indicate a stronger expected forward return. Implementations
operate on one stock at a time; cross-sectional ranking happens downstream.
"""
@abstractmethod
def compute(self, df: pd.DataFrame) -> pd.Series:
"""Compute the signal for one stock.
Args:
df: OHLCV DataFrame with at least a ``close`` column, ordered by date.
Returns:
Signal series aligned to ``df`` (NaN where undefined).
"""
@property
@abstractmethod
def name(self) -> str:
"""Human-readable signal identifier."""