AI-Powered Financial Intelligence Engine. 8 Master Strategies, 3 Markets, 227 Tests.
Project description
๐ FinClaw
AI Trading Engine with Verified Alpha
English | ไธญๆ | ๆฅๆฌ่ช | ํ๊ตญ์ด | Franรงais
100ไธ โ 354ไธ (5ๅนด, ๅนดๅ29.1%)
Tested on 100+ real stocks across US, China, Hong Kong
30/34 individual stock backtests outperform market
What does it do?
FinClaw scans stocks, picks winners, manages risk, and validates everything with real data.
# Pick 5 best US stocks with Soros-style momentum strategy
python FinClaw.py scan --market us --style soros --top 5
# Backtest any stock
python FinClaw.py backtest --ticker NVDA --period 5y
# Run full test suite
python FinClaw.py test
Why FinClaw?
Most "AI trading" projects generate signals and stop there. No backtesting, no risk management, no validation.
FinClaw is different:
- Verified: Every claim backed by reproducible backtests
- Complete: Selection โ Entry โ Position Management โ Exit โ Portfolio
- Tested: 34 automated regression tests, every commit validated
- Multi-market: US stocks, China A-shares, Hong Kong
- Honest: We show where we lose, not just where we win
Performance
5-Year Real Data (2020-2025)
| Strategy | Annual Return | 5Y Total | Risk Level |
|---|---|---|---|
| v10 Unified Top-5 | +29.1%/y | +254% | High |
| LLM-Enhanced Top-10 | +24.8%/y | +202% | Medium-High |
| Balanced Top-10 | +19.5%/y | +142% | Medium |
| Conservative Top-15 | +11.8%/y | +74% | Low |
Tested on 100+ real stocks from Yahoo Finance. No synthetic data.
Individual Stock Win Rate
Tested head-to-head against AHF's technical analysis on 34 stocks:
FinClaw wins: 30/34 (88%)
Average edge: +10.8% per year
Quick Start
1. Install
git clone https://github.com/user/FinClaw.git
cd FinClaw
pip install -r requirements.txt # aiohttp, yfinance
2. Verify
python FinClaw.py test
# Expected: 34/34 tests passed
3. Pick Stocks
# US market, aggressive style
python FinClaw.py scan --market us --style druckenmiller
# China A-shares, balanced
python FinClaw.py scan --market china --style buffett
# All markets
python FinClaw.py scan --market all --style soros
4. Backtest
python FinClaw.py backtest --ticker NVDA --period 5y
python FinClaw.py backtest --ticker 688256.SS --period 3y
8 Built-in Strategies
| Strategy | Philosophy | Risk | Target |
|---|---|---|---|
druckenmiller |
Momentum. "When you see it, bet big." | Very High | 25-40%/y |
soros |
Reflexivity. Self-reinforcing trends. | High | 25-35%/y |
cathie_wood |
Disruptive innovation. 5-year horizon. | Very High | 20-40%/y |
buffett |
Quality + value. Buy fear, hold forever. | Medium | 20-30%/y |
lynch |
Growth/volatility ratio. "Boring" winners. | Medium | 20-27%/y |
simons |
Pure quant. Highest Sharpe ratio. | Medium | 15-25%/y |
dalio |
All-weather. Low correlation, risk parity. | Low | 12-18%/y |
conservative |
Low-vol blue chips. Capital preservation. | Very Low | 8-12%/y |
How It Works
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ FinClaw v10 โ
โ โ
โ 1. SCAN Multi-factor + AI disruption analysis โ
โ 2. RANK 7 master strategies vote โ
โ 3. SELECT Top-N by conviction score โ
โ 4. ENTER Regime-adaptive timing (7 regimes) โ
โ 5. MANAGE Trailing stop + pyramiding + sizing โ
โ 6. EXIT Regime shift + trend breakdown โ
โ 7. VALIDATE 34 TDD tests + real data backtest โ
โ โ
โ Selection engine: 3 layers โ
โ โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โ โ Quant โ+โ Fundamentals โ+โ AI Disruption โ โ
โ โ 6 factorโ โ P/E, growth โ โ Who wins in AI? โ โ
โ โโโโโโโโโโโ โโโโโโโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Selection Engine (3 Layers)
Layer 1 โ Quantitative (always on)
- Multi-timeframe momentum (1M/3M/6M/1Y)
- EMA trend alignment (8/21/55)
- RSI, Bollinger Bands, volume confirmation
- Sharpe ratio, max drawdown, volatility
Layer 2 โ Fundamental (yfinance)
- P/E, P/B, PEG ratio
- Revenue growth, profit margins
- Return on equity, debt ratios
Layer 3 โ AI Disruption Analysis
- Is this company an AI winner or victim?
- Competitive moat in the AI era
- Narrative strength (self-reinforcing?)
- Example: NVIDIA (+0.25 boost) vs Salesforce (-0.21 penalty)
Signal Engine (7 Regimes)
| Regime | Max Position | Strategy |
|---|---|---|
| CRASH | 0% | Emergency exit |
| STRONG_BEAR | 10% | Defensive bounces only |
| BEAR | 15% | Small counter-trend |
| RANGING | 45-68% | Mean reversion |
| VOLATILE | 65% | Direction-dependent |
| BULL | 80% | Trend following |
| STRONG_BULL | 92% | Maximum conviction |
Project Structure
FinClaw/
โโโ FinClaw.py # CLI entry point
โโโ agents/
โ โโโ signal_engine_v7.py # 6-factor signal engine
โ โโโ backtester_v7.py # Full lifecycle backtester
โ โโโ stock_picker.py # Multi-factor stock picker
โ โโโ llm_analyzer.py # AI disruption analysis
โ โโโ ahf_simulator.py # Competitor simulator
โ โโโ statistics.py # Sharpe, drawdown, etc.
โโโ tests/
โ โโโ test_engine.py # 34 regression tests
โโโ benchmark_v10.py # Unified engine benchmark
โโโ benchmark_multimarket.py # Global market test
โโโ benchmark_real.py # Real data validation
โโโ docs/
โ โโโ README_zh.md # ไธญๆๆๆกฃ
โ โโโ README_ja.md # ๆฅๆฌ่ชใใญใฅใกใณใ
โ โโโ README_ko.md # ํ๊ตญ์ด ๋ฌธ์
โ โโโ README_fr.md # Documentation franรงaise
โโโ _scratch/ # Archived experiments
Development
Run Tests
python FinClaw.py test
# or directly:
python tests/test_engine.py
Test Coverage
| Test | What it checks |
|---|---|
| Golden Thresholds | 9 scenarios must meet minimum alpha |
| Average Alpha | Portfolio average must exceed 9% |
| No Catastrophic Loss | No single trade > 35% loss |
| Regime Detection | Bull/bear/ranging correctly identified |
| Determinism | Same input โ same output |
| Warmup Protection | No trades in first 20 bars |
| vs Freqtrade | Must beat on all 9 sim scenarios |
Contributing
# 1. Make your change
# 2. Run tests (must pass all 34)
python tests/test_engine.py
# 3. Run quick benchmark
python benchmark_real.py
# 4. If alpha improved or neutral, submit PR
Roadmap
Done โ
- 6-factor signal engine with 7 regimes
- Full lifecycle backtester
- Multi-factor stock picker (quant + fundamental)
- AI disruption analysis layer
- 7 master strategy presets
- CLI with one-command scanning
- 34 TDD regression tests
- Multi-market support (US, China, HK)
- Multi-language docs (EN, ZH, JA, KO, FR)
Next ๐จ
- Live market data streaming
- Paper trading mode
- Web dashboard
- Telegram/WeChat alert bot
- QuantStats HTML report integration
- Options/futures support
- Walk-forward validation
FAQ
Q: Is this financial advice? A: No. This is a research tool. Use at your own risk.
Q: Can it trade automatically? A: Not yet. Currently analysis and backtesting only. Live trading is on the roadmap.
Q: How is this different from ai-hedge-fund? A: AHF generates signals. FinClaw is a complete system โ it selects, enters, manages, exits, and validates. We beat AHF on 88% of stocks tested.
Q: What data does it need? A: Just an internet connection. Uses Yahoo Finance (free) for price data.
Q: Can I add my own stocks? A: Yes. Any ticker supported by Yahoo Finance works.
License
MIT License. Not financial advice. Past performance does not guarantee future results.
Built by an engineer who believes trading systems should be engineered, not hoped. ๐
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file finclaw_ai-1.0.0.tar.gz.
File metadata
- Download URL: finclaw_ai-1.0.0.tar.gz
- Upload date:
- Size: 99.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b92e8e6ca9dfbbf06776a62c795fb854b5dd6e6107c3a86e3c66799adec09b5
|
|
| MD5 |
ec80dfe52c804d596985dbdf3d183d3d
|
|
| BLAKE2b-256 |
b4646fb83a3d7aa23ffc477ee871c21e6c28502ca9b91a7c445650df03fe4d09
|
Provenance
The following attestation bundles were made for finclaw_ai-1.0.0.tar.gz:
Publisher:
publish.yml on NeuZhou/finclaw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finclaw_ai-1.0.0.tar.gz -
Subject digest:
4b92e8e6ca9dfbbf06776a62c795fb854b5dd6e6107c3a86e3c66799adec09b5 - Sigstore transparency entry: 1107810054
- Sigstore integration time:
-
Permalink:
NeuZhou/finclaw@a921af920dc507dd0018eb01437864ccf59b545f -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/NeuZhou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a921af920dc507dd0018eb01437864ccf59b545f -
Trigger Event:
push
-
Statement type:
File details
Details for the file finclaw_ai-1.0.0-py3-none-any.whl.
File metadata
- Download URL: finclaw_ai-1.0.0-py3-none-any.whl
- Upload date:
- Size: 93.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
922e82fddb3185075716c7ca2404c65bd4207962237aec127611429f1ccb8bb7
|
|
| MD5 |
534eb356bbe5a1c545a9e72b5ad66dbe
|
|
| BLAKE2b-256 |
aeae726e02a2019a0620446c7e8045cf6d643467ae519814b8573c58976d0aa6
|
Provenance
The following attestation bundles were made for finclaw_ai-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on NeuZhou/finclaw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
finclaw_ai-1.0.0-py3-none-any.whl -
Subject digest:
922e82fddb3185075716c7ca2404c65bd4207962237aec127611429f1ccb8bb7 - Sigstore transparency entry: 1107810056
- Sigstore integration time:
-
Permalink:
NeuZhou/finclaw@a921af920dc507dd0018eb01437864ccf59b545f -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/NeuZhou
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a921af920dc507dd0018eb01437864ccf59b545f -
Trigger Event:
push
-
Statement type: