This repository implements a systematic equity strategy replicating the Betting Against Beta (BAB) factor, famously documented by Frazzini & Pedersen (2013).
The strategy challenges the core CAPM assumption that higher risk (beta) equals higher return. Instead, it exploits the low-beta anomaly by constructing a leverage-neutral portfolio that is:
- Long Low-Beta assets (Leveraged to match market risk).
- Short High-Beta assets (De-leveraged to match market risk).
Standard CAPM implies
Betas are calculated using a 12-month rolling window against the SPY benchmark:
To make the strategy market-neutral in terms of risk, we apply a leverage factor (
The backtest accounts for real-world frictions:
- Borrowing Costs: Applied to the leveraged long leg.
- Transaction Costs: Applied to turnover on rebalancing.
- Python: Core logic and data processing.
- Pandas/NumPy: Vectorized timeseries operations.
- Statsmodels: Rolling covariance and regression metrics.
- YFinance: Data ingestion (CRSP/Compustat proxy).
The system outputs a tear sheet including:
-
Sharpe Ratio
-
Maximum Drawdown
-
Annualized Volatility
-
Average Leverage Ratio required to maintain beta-neutrality.
Not Financial Advice. This project is for educational and research purposes only. Past performance of the strategy does not guarantee future results. The code is provided "as is" without warranty of any kind.