WA

whchien/ai-trader

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

1.1천 stars 144 forks 품질 72 트렌드 25GPL-3.0

whchien/ai-trader는 [[T0]에서 가져온 MCP 서버 후보입니다.

개요

whchien/ai-trader는 [[T0]에서 가져온 MCP 서버 후보입니다.

개요(AI 번역)

中文版說明 (중국어 서브페이지)

Backtrader를 기반으로 구축된 알고리즘 거래를 위한 전문적이고 설정 기반 백테스트 프레임워크입니다. 주식, 암호화폐, 외환 시장에서 대형 언어 모델(LLM)을 통해 거래 전략을 원활하게 테스트, 최적화, 통합할 수 있습니다.

주요 특징

  • 구성 기반 워크플로우: 버전 제어 가능한 YAML 파일로 백테스트를 정의하고 관리하여 재현 가능한 결과를 제공합니다.
  • 원활한 LLM 통합: 내장된 MCP(모델 컨텍스트 프로토콜) 서버를 통해 Claude와 같은 AI 어시스턴트가 백테스트를 실행하고, 데이터를 가져오며, 전략을 분석할 수 있습니다.
  • 다중 시장 지원: 미국 주식, 대만 주식, 암호화폐, 외환에 대한 전략 테스트
  • 방대한 전략 라이브러리: 고전 지표부터 고급 적응형 모델까지 20가지 이상의 내장된 전략이 포함되어 있습니다.
  • 강력한 CLI: 백테스트 실행, 시장 데이터 가져오기, 전략 목록 작성을 위한 풍부한 명령줄 인터페이스.
  • 개발자 친화적: 간단한 도우미와 명확한 구조로 맞춤형 전략을 쉽게 만들고 테스트할 수 있습니다.

퀵 스타트

**1. 설치

옵션 A: PyPI에서 설치하기(CLI 사용 권장)

원한다면 이걸 사용하세요:

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

AI-Trader

中文版說明 (Chinese Subpage)

A professional, config-driven backtesting framework for algorithmic trading, built on Backtrader. Seamlessly test, optimize, and integrate trading strategies with Large Language Models (LLMs) across stocks, crypto, and forex markets.

Key Features

  • Config-Driven Workflows: Define and manage backtests with version-controllable YAML files for reproducible results.
  • Seamless LLM Integration: Built-in MCP (Model Context Protocol) server allows AI assistants like Claude to run backtests, fetch data, and analyze strategies.
  • Multi-Market Support: Test strategies on US stocks, Taiwan stocks, cryptocurrencies, and forex.
  • Extensive Strategy Library: Comes with over 20 built-in strategies, from classic indicators to advanced adaptive models.
  • Powerful CLI: A rich command-line interface to run backtests, fetch market data, and list strategies.
  • Developer Friendly: Easily create and test custom strategies with simple helpers and a clear structure.

Quick Start

1. Installation

Option A: Install from PyPI (Recommended for using the CLI)

pip install ai-trader

Use this if you want to:

  • Use the CLI commands: ai-trader run, ai-trader fetch, ai-trader quick
  • Run backtests on your own data files
  • Use as a library in your Python projects

Option B: Install from Source (Recommended for examples and config templates)

git clone https://github.com/whchien/ai-trader.git
cd ai-trader

# Install dependencies (choose one method)
uv sync        # Recommended (fastest, modern tool)
# poetry install   # Or use Poetry
# pip install -e .  # Or traditional pip with editable install

Use this if you want to:

  • Run the config-based examples in config/backtest/
  • Use the example data files in data/
  • Run the example scripts in scripts/examples/
  • Contribute or customize strategies

2. Run a Backtest via CLI

If you cloned from source, run a predefined backtest using a configuration file:

# Run a backtest from a config file (requires source installation)
ai-trader run config/backtest/classic/sma_example.yaml

Or, run a quick backtest on any data file (works with both pip and source installation):

# Quick backtest on your own data file
ai-trader quick CrossSMAStrategy your_data.csv --cash 100000

3. Fetch Market Data

Download historical data for any supported market:

# US Stock (default: saves to CSV)
ai-trader fetch TSM --market us_stock --start-date 2020-01-01

# Taiwan Stock (台灣股票)
ai-trader fetch 2330 --market tw_stock --start-date 2020-01-01

# Cryptocurrency
ai-trader fetch BTC-USD --market crypto --start-date 2020-01-01

# With SQLite persistent caching (NEW!)
GitHub에서 전체 README 보기

설치

This server does not publish a one-line install command.

Open the repository installation guide MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "ai-trader": { "command": "python3", "args": ["-m", "ai_trader.mcp"], "cwd": "/path/to/ai-trader" } } }