FactorHub is an open-source modern quantitative factor analysis platform designed specifically for the Chinese A-share market.
FactorHub = Factor + Hub
A full-stack quantitative investment research system integrating factor management, analysis, mining, portfolio optimization, and strategy backtesting.
- π¨π³ δΈζ (Chinese) - README_ZH.md
- π―π΅ ζ₯ζ¬θͺ (Japanese) - README_JP.md
| Value Pillar | Description |
|---|---|
| π― Complete Factor Lifecycle Management | Full support from factor creation, validation, analysis to deployment |
| π§ͺ Scientific Factor Evaluation System | Professional indicators including IC/IR analysis, monotonicity test, turnover analysis |
| 𧬠Intelligent Factor Mining | Genetic algorithm-based automated factor mining to discover alpha signals |
| π Professional Backtesting Engine | Support for multi-factor combination, strategy comparison, and performance attribution analysis |
- β Custom Factor Definition - Supports Tongda Xinhua (MyLanguage) syntax and TALib functions
- β Formula Validation - Real-time syntax checking and logical verification
- β Version Control - Factor modification history and version rollback
- β Pre-built Factor Library - Built-in common technical factors (MA, RSI, MACD, Bollinger Bands, etc.)
- β IC/IR Analysis - Information Coefficient and Information Ratio calculation (supports 1-day, 5-day, 10-day prediction cycles)
- β Factor Exposure Analysis - Analyze stock exposure distribution on factors
- β Factor Effectiveness Testing - Multi-dimensional assessment of factor predictive power
- β Factor Attribution Analysis - Decompose factor contribution to returns
- β Dynamic Monitoring - Factor performance tracking across time series dimensions
- β Genetic Algorithm Mining - DEAP-based evolutionary algorithm for automatic factor search
- β Multi-objective Optimization - Simultaneously optimize IC, IR, monotonicity, and other objectives
- β Factor Generation - Supports basic operators, function calls, and time window operations
- β Parallel Computing - Parallel population evaluation for acceleration
- β Multi-factor Portfolio - Supports equal weight, market cap weighting, IC_IR maximization, etc.
- β Risk Modeling - Factor neutralization processing
- β Optimization Configuration - Factor weight optimization based on historical performance
- β Portfolio Performance - Annual return, Sharpe ratio, maximum drawdown, and other metrics
- β Single Factor Backtesting - Factor quantile-based stock selection backtesting
- β Multi-factor Strategies - Composite factor signal generation
- β Strategy Comparison - Multi-strategy parallel backtesting and comparison analysis
- β Performance Metrics - Complete metric system including returns, risk, and turnover
- β Visualization Charts - Equity curves, drawdowns, factor performance charts, etc.
Backend:
- FastAPI 0.135+ - High-performance web framework
- SQLAlchemy 2.0 - ORM database operations
- SQLite - Lightweight data storage
- Pandas 2.0+ / NumPy - Data processing
- TA-Lib - Technical analysis library
- VectorBT 0.25+ - Backtesting engine
- DEAP 1.3+ - Genetic algorithm framework
- XGBoost 2.0+ - Machine learning models
- SHAP 0.42+ - Model interpretation
- akshare 1.12+ - Chinese A-share data source
Frontend:
- React 19 - UI framework
- TypeScript - Type safety
- Ant Design 6 - UI component library
- ECharts 6 - Data visualization
- React Router 7 - Routing management
- Axios - HTTP client
- Vite - Build tool
FactorHub/
βββ backend/ # Backend code
β βββ api/ # API layer
β β βββ main.py # FastAPI main application
β β βββ routers/ # API routers
β β βββ factors.py # Factor management interface
β β βββ analysis.py # Factor analysis interface
β β βββ mining.py # Factor mining interface
β β βββ portfolio.py # Portfolio analysis interface
β β βββ backtest.py # Strategy backtesting interface
β β βββ data.py # Data management interface
β βββ services/ # Business logic layer
β βββ strategies/ # Strategy implementation
β βββ repositories/ # Data access layer
β βββ models/ # ORM models
β βββ core/ # Core configuration
βββ frontend/ # Frontend code
β βββ react-antd/ # React + Ant Design version
βββ config/ # Configuration files
βββ data/ # Data directory
βββ docs/ # Documentation
βββ tests/ # Tests
βββ scripts/ # Utility scripts
βββ README.md
- Python 3.11+
- Node.js 18+
- pnpm (package manager)
- TA-Lib (technical analysis library)
# Install pnpm
npm install -g pnpm
# Install Python dependencies (using uv)
uv sync
# Install frontend dependencies
cd frontend/react-antd
pnpm installpython start_all.pyThis script will automatically:
- Check environment prerequisites
- Install dependencies if needed
- Start backend service (http://localhost:8000)
- Start frontend development server (http://localhost:5173)
- Open browser automatically
uv run python start_api.py
# API available at http://localhost:8000
# API docs at http://localhost:8000/docscd frontend/react-antd
pnpm dev
# Frontend available at http://localhost:5173Personal Use:
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
You are free to:
- β Use this software for personal learning, research, and non-commercial purposes
- β Modify and improve this software
- β Distribute modified versions (must retain the same license)
- β Reference this project in your own projects
Commercial Use:
- Integrating this project into commercial products
- Using this project to provide paid services
- Using this project for production quantitative trading
- Using this project internally within companies for investment research)
Requires separate commercial authorization.
Email: yl_zhangqiang@foxmail.com
When contacting, please specify:
- Your company/organization name
- Your usage scenario and requirements
- Expected scale of use
- Contact information
We will respond within 3 business days.
Project Maintainer: FactorHub Team
Email: yl_zhangqiang@foxmail.com
Feedback Welcome:
- Bug reports
- Feature suggestions
- Technical discussions
- Cooperation inquiries
Last Updated: 2026-03-14





