5-phase architecture · 20+ indicators · HMM regime detection · GARCH volatility · Claude-powered trade notes
A 5-phase quantitative analysis pipeline that generates institutional-quality trade recommendations through technical indicator analysis, regime detection, walk-forward backtesting, and LLM-powered narrative generation. Outputs a 247-field structured JSON with professional PDF/HTML/Markdown reports.
Pipeline · Indicators · Regime Detection · Backtesting · Getting Started
|
5-Phase Pipeline
|
Structured Output
|
Phase 1: Data Collection Phase 2: Indicators Phase 3: Regime
├─ yfinance OHLCV ├─ Momentum (25%) ├─ 3-state HMM
├─ 4-dimension quality scoring ├─ Trend (25%) ├─ GARCH(1,1)
├─ 7 volatility estimators ├─ Volatility (15%) ├─ Hurst exponent
├─ 5 hypothesis tests ├─ Volume (15%) └─ CUSUM breaks
└─ VIX regime classification └─ Ichimoku (20%)
Phase 4: Backtesting Phase 5: Trade Notes
├─ Walk-forward (5 periods) ├─ Claude Sonnet 4.5
├─ Monte Carlo (500 paths) ├─ Investment thesis
├─ Transaction cost modeling ├─ Bull/base/bear scenarios
├─ Kelly / vol-target sizing ├─ Risk analysis
└─ Risk attribution (52 fields) └─ Catalysts & risks
| Family | Weight | Indicators |
|---|---|---|
| Momentum | 25% | RSI (14), Stochastic %K/%D, Williams %R, ROC |
| Trend | 25% | MACD (12/26/9), ADX/DMI, Aroon, Supertrend |
| Volatility | 15% | Bollinger Bands, Keltner Channels, Donchian Channels |
| Volume | 15% | OBV, Chaikin Money Flow, MFI, VWMA |
| Ichimoku | 20% | Tenkan, Kijun, Senkou A/B, Chikou |
7 Volatility Estimators
| Estimator | Method |
|---|---|
| Close-to-Close | Baseline standard deviation |
| Parkinson (1980) | High-Low range based |
| Garman-Klass (1980) | Full OHLC utilization |
| Rogers-Satchell (1991) | Drift-adjusted |
| Yang-Zhang (2000) | Gap-adjusted (overnight returns) |
| GKYZ | Hybrid Garman-Klass / Yang-Zhang |
| Hodges-Tompkins | Bias-corrected finite sample |
Risk Attribution (52 fields)
- CAPM alpha/beta decomposition with t-stats and p-values
- Factor attribution analysis and information ratio
- Regime-conditional performance (Bull/Bear/Sideways)
- Historical stress testing (COVID crash, 2022 bear, 2018 Q4)
- VaR/CVaR at 95% and 99% confidence levels
- Drawdown analysis and recovery time estimation
git clone https://github.com/abailey81/Tamer_Technical_Agent.git
cd Tamer_Technical_Agent
python -m venv venv && source venv/bin/activate
pip install -r requirements.txt
# Set API key
echo "ANTHROPIC_API_KEY=sk-ant-..." > .env
# Run analysis
python run_demo.py # Default: AAPL
python run_demo.py --symbol MSFT # Custom ticker
python run_demo.py --years 10 # 10 years of data
python run_demo.py --skip-llm # Skip LLM (faster)Tamer_Technical_Agent/
├── run_demo.py # Main orchestrator (2,497 lines)
├── src/
│ ├── config.py # Configuration & enums
│ ├── data_collector.py # Phase 1: Data pipeline + quality scoring
│ ├── technical_indicators.py # Phase 2: 20+ indicators
│ ├── regime_detector.py # Phase 3: HMM + GARCH + Hurst
│ ├── backtest_engine.py # Phase 4: Walk-forward + Monte Carlo
│ ├── risk_analytics.py # Phase 4B: Risk attribution (52 fields)
│ ├── llm_agent.py # Phase 5: Claude trade notes
│ ├── report_generator.py # JSON/HTML/Markdown output
│ └── trade_note_reports.py # Professional PDF generation
├── requirements.txt
└── outputs/ # Generated reports
Built with Claude, vectorbt, hmmlearn, arch, and ReportLab