cd /Users/zheyuanzhao/workspace/quantlab
source .venv/bin/activateOption A: Liquid Universe (Recommended)
cd qlib_repo/examples
uv run qrun ../../configs/lightgbm_liquid_universe.yamlOption B: Fixed Dates (2024 only)
cd qlib_repo/examples
uv run qrun ../../configs/lightgbm_fixed_dates.yamlOption C: Full Universe (All stocks)
cd qlib_repo/examples
uv run qrun ../../configs/lightgbm_external_data.yamlThe backtest will output:
- IC and Rank IC metrics
- Portfolio analysis
- Results saved to
results/mlruns/
Find your experiment ID from the output, then:
# Edit scripts/analysis/visualize_results.py
# Update EXP_DIR to your experiment ID
cd /Users/zheyuanzhao/workspace/quantlab
uv run python scripts/analysis/visualize_results.pyOutput: results/visualizations/backtest_visualization.png
IC: 0.066
ICIR: 0.622
Rank IC: -0.006
Sharpe Ratio: 3.94
Max Drawdown: -39.19%
- IC over time (predictive power)
- Rank IC over time (ranking ability)
- Cumulative returns chart
- Drawdown analysis
- Daily returns distribution
- IC > 0.05: Model has predictive power
- ICIR > 0.5: Predictions are consistent
- Sharpe > 2: Good risk-adjusted returns
- Rank IC ≈ 0: Model can't rank stocks well
- Extreme returns: May indicate data quality issues
- High drawdown: Needs better risk controls
results/
├── mlruns/489214785307856385/
│ ├── [run_id_1]/artifacts/
│ │ ├── pred.pkl # Model predictions
│ │ ├── sig_analysis/ # IC analysis
│ │ └── portfolio_analysis/ # Backtest results
│ └── [run_id_2]/artifacts/
│ └── ...
└── visualizations/
└── backtest_visualization.png
- Read the analysis:
docs/BACKTEST_SUMMARY.md - Try different models: Edit configs to use XGBoost, MLP
- Improve features: Add custom Alpha features
- Better universe: Filter by market cap, volume
ls results/mlruns/489214785307856385/cd results
mlflow ui
# Open http://localhost:5000rm -rf results/mlruns/.trashpython scripts/data/refresh_today_data.pyuv pip install qlibCheck: /Volumes/sandisk/quantmini-data/data/qlib/stocks_daily/
Make sure you're in project root when running scripts
uv pip install matplotlib seaborn pandas- README.md - Full project overview
- docs/BACKTEST_SUMMARY.md - Detailed analysis
- docs/USE_QLIB_ALPHA158.md - Feature guide
- PROJECT_STRUCTURE.md - Directory layout
- Start with
lightgbm_liquid_universe.yaml- it's the most realistic - Check IC before trusting backtest returns
- Compare multiple runs to validate results
- Read the docs - lots of insights there!
Happy backtesting! 🎯