A modular algorithmic Paper trading system for equities using a combination of machine learning, technical strategies, and risk management. Supports historical backtesting and live/paper trading via Alpaca API.
- Fetches and processes live or historical data (via
yfinanceandAlpaca) - Calculates technical indicators and fundamental data
- Trains and uses an XGBoost model for directional prediction
- Supports strategies: Mean Reversion, Momentum, Statistical Arbitrage, and Combined
- Risk-managed position sizing and loss limits
- Modular backtester and live trading loop
- Performance: Current backtests show negative Sharpe ratio and drawdowns.
- Signal Quality: Combined strategy often produces unprofitable trades.
- Machine Learning: Functional but needs tuning and better features.
- Execution: No real trades are placed unless performance thresholds are passed.
- Pair Arbitrage: Only tested on
AAPLandBA.
- Improve feature engineering and model selection
- Tune XGBoost hyperparameters
- Broaden to more tickers
- Log executed trades in live mode
- Refactor signal-weight logic in CombinedStrategy
- Add unit tests
Install all required dependencies:
pip install -r requirements.txt
