Skip to content

NeuZhou/finclaw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

311 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FinClaw

AI trading strategies that evolve themselves. 41 dimensions. 24/7. No human intervention.

PyPI CI License Python 3.9+ GitHub Stars

FinClaw Architecture

FinClaw is an open-source quantitative finance engine that uses genetic algorithms to continuously evolve trading strategies across 41 factor dimensions — technical, fundamental, and quality — without human intervention.

Disclaimer

This project is for educational and research purposes only. Not financial advice. Past performance does not guarantee future results.

Table of Contents

Why FinClaw?

  • Self-evolving strategies — Genetic algorithm optimizes 41 trading factors 24/7
  • Walk-forward validated — 70/30 train/test split + Monte Carlo simulation prevents overfitting
  • Global markets — US stocks, crypto, and Chinese A-shares from free data sources
  • AI-powered research — Chat with any LLM about stocks. Configure in finclaw.config.ts
  • Production dashboard — TradingView charts, screener, watchlist, real-time prices
  • Zero API keys neededpip install finclaw-ai && finclaw demo just works

Current Best Strategy (Gen 1,500+)

Metric Gross (before costs) Net (after costs)
Annual Return 309.6% ~180-220%*
Sharpe Ratio 3.42 ~2.0-2.5*
Max Drawdown 13.8% ~15-18%*
Win Rate 62.9% ~55-60%*
Factor Dimensions 41 41
Generations Evolved 1,500+ 1,500+

*Net estimates include 0.03% commission, 0.1% stamp tax (A-shares), and 0.1% slippage per trade.

Important: These results are from historical backtesting on A-share data (2024-2026). Past performance does not guarantee future results. This is a research and education tool — not a production trading system. Always validate strategies with paper trading before risking real capital.

Quick Start

CLI (no dashboard needed)

pip install finclaw-ai
finclaw demo          # See all features — zero API keys
finclaw quote AAPL    # Real-time quote

Dashboard

git clone https://github.com/NeuZhou/finclaw.git
cd finclaw/dashboard
npm install && npm run dev
# Open http://localhost:3000

Dashboard

FinClaw Dashboard

  • Real-time prices (US, Crypto, A-Shares)
  • TradingView professional charts
  • Stock screener with filters + CSV export
  • AI chat assistant (OpenAI, Anthropic, DeepSeek, Ollama)
  • E2E tested with Playwright (28 tests)

Strategy Evolution Engine

FinClaw uses a genetic algorithm to continuously discover optimal trading strategies:

  1. Seed — Start with basic technical indicators
  2. Mutate — Random parameter variations (30 per generation)
  3. Backtest — Test each variant across 500+ stocks
  4. Select — Keep the top 5 performers
  5. Repeat — 24/7 on your compute node

The engine optimizes 41 factor dimensions:

Category Factors
Technical RSI, MACD, Bollinger, KDJ, OBV, ATR, ADX, ROC, CCI, MFI, Aroon
Fundamental PE, PB, ROE, revenue growth (YoY/QoQ), profit growth, debt ratio
Quality Gross margin, cashflow quality, PEG ratio
# Start 24/7 evolution
python scripts/run_evolution.py --generations 999999 --population 30

MCP Server (for AI Agents)

Expose FinClaw as tools for Claude, Cursor, VS Code, or any MCP-compatible client:

{
  "mcpServers": {
    "finclaw": {
      "command": "finclaw",
      "args": ["mcp", "serve"]
    }
  }
}

10 tools available: get_quote, get_history, list_exchanges, run_backtest, analyze_portfolio, get_indicators, screen_stocks, get_sentiment, compare_strategies, get_funding_rates.

Data Sources

FinClaw pulls real-time and historical data from multiple sources:

Market Source Coverage
US Stocks Yahoo Finance All NYSE/NASDAQ
Cryptocurrency ccxt (100+ exchanges) BTC, ETH, SOL, and 10,000+ pairs
China A-Shares AKShare + BaoStock All SSE/SZSE stocks
Indices Yahoo Finance + Sina S&P 500, Nasdaq, Shanghai Composite

No API keys required for basic market data.

Contributing

git clone https://github.com/NeuZhou/finclaw.git
cd finclaw && pip install -e ".[dev]"
pytest

See CONTRIBUTING.md for guidelines.

License

MIT

Limitations

FinClaw is a research and education tool. Key limitations:

  • No live trading — signals are generated but not executed automatically
  • Free data sources — subject to delays, gaps, and API rate limits
  • Simplified backtesting — does not model order book depth, partial fills, or market microstructure
  • Single-asset long-only — no short selling, no multi-asset portfolio optimization (yet)
  • Historical bias — backtested strategies may not perform similarly in live markets

For production trading, consider validated platforms with exchange connectivity and proper risk management.

Star History

Star History