A reproducible PyTorch research stack for machine-learning multi-factor trading: 213 factors, bias correction, portfolio optimization, and vectorized backtesting.
python -m pip install mlquantx
mlquant demoThe demo needs no market-data account or API key. It runs the deterministic synthetic pipeline from data generation through 213 factor dimensions, model training, portfolio construction, cost-aware backtesting, and Markdown/JSON report generation. The default config ships inside the wheel, so the command works outside a repository checkout.
The wheel is the fastest way to try the project. Clone the repository when you want to change factors, models, portfolio constraints, data sources, or backtest assumptions:
git clone https://github.com/initial-d/ml-quant-trading.git
cd ml-quant-trading
python -m pip install -e '.[dev]'If the demo saves you setup time, consider starring the repository or sharing a reproducible run.
- 204 hand-crafted factors plus 9 curated Alpha101-style factors
- mask-aware PyTorch tensor primitives for cross-sectional panels
- limit-up, limit-down, halt, and missing-data bias handling
- MLP and Transformer research baselines
- constrained Markowitz portfolio construction
- vectorized backtesting with turnover and transaction costs
- AkShare, Baostock, yfinance, and deterministic synthetic data paths
- auditable public-data validation reports, including negative results
- Source and full documentation
- Google Colab quick start
- Public validation dashboard
- Research card and limitations
- 100,000-row synthetic dataset
- 213-input MLP checkpoint
- Paper: arXiv:2507.07107
mlquant is research and educational software. It is not investment advice or
a production trading system. Synthetic smoke tests verify engineering behavior,
not profitability. Public-data backtests depend on data quality, survivorship,
transaction costs, slippage, and modeling assumptions and do not represent live
or guaranteed out-of-sample performance.
MIT. See the repository license.