Open-source trading framework

VibeTrading

Open-source trading framework for generating, backtesting, analyzing, and evolving strategies with LLM-powered feedback.

Generate strategies.Backtest instantly.Evolve with AI.

Core Capabilities

Strategy Generation

Generate structured strategies from prompts or templates. Output is framework-compatible and validated.

Backtest Analysis

LLM evaluates backtest results: scores performance (1-10), identifies weaknesses, and suggests actionable improvements.

Built-in Backtesting

Backtest using the same strategy logic used for live trading. No duplicate implementation.

Strategy Evolution

One call to iteratively improve strategies. Generate → backtest → analyze → regenerate with feedback, automatically.

Quickstart

Install

pip install vibetrading

Example

import vibetrading
import vibetrading.strategy
import vibetrading.backtest
import vibetrading.tools

# 1. Generate strategy from a prompt
code = vibetrading.strategy.generate(
    "BTC momentum: RSI(14) oversold entry, SMA crossover, "
    "3x leverage, 8% TP, 4% SL",
    model="gpt-4o",
)

# 2. Backtest on historical data
data = vibetrading.tools.download_data(["BTC"], interval="1h")
results = vibetrading.backtest.run(code, data=data)

# 3. Analyze with LLM
report = vibetrading.strategy.analyze(results, strategy_code=code)
print(f"Score: {report.score}/10")
print(report.suggestions)

# 4. Or evolve in one call (generate → backtest → analyze loop)
result = vibetrading.evolve("BTC momentum with RSI", iterations=3)
print(result.best_code)

Architecture

Modular Pipeline

Strategies flow through a modular pipeline — from generation to backtesting, LLM-powered analysis, and iterative evolution. Each iteration feeds analysis back to the generator.

Strategy Layer

Define trading logic

Backtest Engine

Simulate on historical data

Analysis Layer

LLM scores & suggests fixes

Evolution Loop

Feedback → regenerate → repeat

feedback

Start building with a unified trading framework.