A research-grade quantitative trading framework for backtesting and strategy development.
Download → Extract → Run in 3 commands:
# 1. Download ZIP from GitHub and extract
# 2. Open terminal in extracted folder
# 3. Run the portable backtest:
python .\一键回测_portable.py --mode fast --years 3That's it! The script will:
- ✅ Automatically create virtual environment (
.venv/) - ✅ Install minimal dependencies (2-3 minutes first time)
- ✅ Download market data (Yahoo Finance with Stooq fallback)
- ✅ Run backtest using simple SMA strategy
- ✅ Generate JSON report in
backtest_reports/
Advanced features (optional):
# Enable AI-powered strategies (requires OpenAI API key)
python .\一键回测_portable.py --mode fast --ai
# Quick test with 1 year, 2 stocks
python .\一键回测_portable.py --mode turbo --years 1 --symbols AAPL MSFT
# Custom symbols
python .\一键回测_portable.py --symbols AAPL GOOGL NVDA TSLAC:\Stock_Deepseeker\)
This is an active research project focused on building a solid quantitative trading infrastructure. It is NOT production-ready and should NOT be used for live trading without substantial additional work.
- ✅ Event-driven backtest engine with no-lookahead bias enforcement
- ✅ 62+ quantitative factors across 6 categories
- ✅ Basic risk management modules (VaR, position limits, stop-loss)
- ✅ Multiple strategy templates
- ✅ Data providers (Yahoo Finance, Alpha Vantage)
- ✅ Performance analytics and reporting
- ❌ Production trading system
- ❌ "Institutional-grade" or "Enterprise-level"
- ❌ Fully tested and validated
- ❌ Ready for live trading
- ❌ Complete or feature-complete
Stock_Deepseeker/
├── src/ # Core library
│ ├── backtest/ # Event-driven backtest engine
│ ├── data/ # Data providers and loaders
│ ├── factors/ # Quantitative factor library (62+ factors)
│ ├── strategies/ # Strategy templates
│ ├── risk/ # Risk management modules
│ ├── execution/ # Order execution simulation
│ ├── monitoring/ # System monitoring
│ └── analytics/ # Performance analytics
├── examples/ # Usage examples (educational)
├── tests/ # Test suite (partial coverage)
└── docs/ # Documentation
Event-driven architecture designed to prevent lookahead bias:
engine_v2.py: Main backtest engine with strict time-orderingevents.py: Event system (Market, Signal, Order, Fill)portfolio_v2.py: Portfolio tracking and managementexecution.py: Order execution simulation
62+ quantitative factors across:
- Momentum (13 factors)
- Value (14 factors)
- Quality (13 factors)
- Volatility (12 factors)
- Growth (10 factors)
- Liquidity (11 factors)
- Momentum
- Mean Reversion
- Pairs Trading
- Value Investing
- Multi-Factor
- Volatility Arbitrage
- Sector Rotation
- Breakout
- Trend Following
- Market Neutral
# Clone repository
git clone https://github.com/YOUR_USERNAME/Stock_Deepseeker.git
cd Stock_Deepseeker
# Install dependencies
pip install -e .
# Optional: Install development dependencies
pip install -e ".[dev]"最简单的方式 - 使用完整的回测脚本:
# 使用模拟数据运行回测(用于演示)
python run_backtest.py --mock
# 使用真实数据(需要网络连接)
python run_backtest.py --symbols AAPL
# 自定义参数
python run_backtest.py --symbols AAPL MSFT --start 2023-01-01 --capital 50000 --mock
# 查看所有选项
python run_backtest.py --help特性:
- ✅ 完整的端到端回测示例
- ✅ 使用真实的 Yahoo Finance 数据或模拟数据
- ✅ 双均线交叉策略(可定制参数)
- ✅ 详细的回测结果报告
- ✅ 100% 可运行,无需额外配置
查看 examples/ 目录了解更多用法:
python examples/basic_backtest.py注意: 示例代码是教学性骨架,run_backtest.py 是完整实现。
# Run all tests
pytest tests/
# Run with coverage
pytest tests/ --cov=src --cov-report=htmlCurrent test status:
- 191 tests collected (imports work)
- Partial test coverage
- Some tests are templates/incomplete
- Clean up architecture
- Remove duplicate code
- Complete test coverage for core modules
- Validate no-lookahead enforcement
- Document actual capabilities
- Robust data ingestion
- Corporate actions handling
- Survivorship bias elimination
- Data quality checks
- Connect risk modules to backtest
- Real-time risk monitoring
- Position sizing
- Portfolio constraints
- Standardized strategy interface
- Factor integration
- Signal generation
- Portfolio optimization
- Comprehensive testing
- Performance optimization
- Broker integrations
- Live trading capabilities
- Test Coverage: Many tests are incomplete or template-based
- Integration: Components not fully integrated (data → strategy → backtest → risk)
- Documentation: Some docs describe planned, not actual features
- Performance: Not optimized for large-scale backtesting
This is a research project. Contributions welcome, but please:
- Write tests for new features
- Update documentation to reflect actual capabilities
- Follow existing code style
- Be honest about limitations
This software is for educational and research purposes only.
- NOT financial advice
- NOT production-ready
- NOT guaranteed to be correct
- NO warranty of any kind
Use at your own risk. Past performance does not predict future results.
[Your License Here]
[Your Contact Info]
Built with honesty in mind 🎯