Discover and explore top open-source AI tools and projects—updated daily.
whchienAlgorithmic trading backtesting and LLM interaction
Top 71.3% on SourcePulse
This project provides a comprehensive, Backtrader-powered backtesting framework for algorithmic trading strategies. It targets engineers, researchers, and professional traders seeking to efficiently test, optimize, and deploy strategies across diverse markets. The framework offers a reproducible, config-driven workflow, advanced strategy implementations, and novel integration capabilities with LLMs via an MCP server.
How It Works
Built upon the robust backtrader library, this framework introduces a modern architecture centered around a Command Line Interface (CLI) and YAML configuration files for reproducible, version-controlled backtests. It supports multi-market data sources (US stocks, TW stocks, crypto, forex) and features advanced, adaptive trading strategies like AlphaRSI variants. The design prioritizes ease of use for production workflows while offering deep customization.
Quick Start & Requirements
Installation involves cloning the repository, then using either Poetry (poetry install) or pip (pip install -r requirements.txt). For CLI access, install the package with pip install -e .. Running a backtest can be done via Python API (e.g., run_backtest(strategy=CrossSMAStrategy, data_source=None)) or the recommended CLI (ai-trader run config/backtest/classic/sma_example.yaml). Data fetching for various markets is integrated via CLI commands (e.g., ai-trader fetch AAPL --market us_stock). No specific hardware or OS prerequisites beyond a standard Python environment are detailed.
Highlighted Details
Maintenance & Community
The project is authored by Will Chien (@whchien). No specific details regarding active maintenance, community channels (like Discord/Slack), sponsorships, or partnerships are provided in the README.
Licensing & Compatibility
The project is licensed under the MIT License. This permissive license generally allows for commercial use and integration into closed-source projects.
Limitations & Caveats
Forex market data is noted to have zero volume due to its decentralized nature. The AITrader class has been deprecated since v0.2.0, requiring users to migrate their existing code.
6 days ago
Inactive