Welcome

Describe trading strategies in natural language. Get executable Python. Backtest and deploy to any exchange.

pip install vibetrading

What is VibeTrading?

VibeTrading is an open-source trading framework where users describe strategies in natural language and AI agents generate, backtest, and deploy executable code across exchanges.

How It Works

1. Describe — Tell the agent what you want in plain English.

2. Generate — AI produces framework-compatible strategy code with proper risk management.

3. Backtest — Fetch historical data, then backtest. Deploy to a live exchange with the same code.


Quick Example

import vibetrading.strategy
import vibetrading.backtest
import vibetrading.tools
from datetime import datetime, timezone

start = datetime(2025, 1, 1, tzinfo=timezone.utc)
end = datetime(2025, 6, 1, tzinfo=timezone.utc)

generator = vibetrading.strategy.StrategyGenerator(model="gpt-4o")
code = generator.generate(
    "ETH mean reversion with Bollinger Bands, short when price hits upper band, "
    "long when price hits lower band, 5x leverage",
    assets=["ETH"],
    max_leverage=5,
)

data = vibetrading.tools.download_data(
    ["ETH"], exchange="binance", start_time=start, end_time=end, interval="1h",
)

results = vibetrading.backtest.run(code, start_time=start, end_time=end, interval="1h", data=data)

if results:
    metrics = results["metrics"]
    print(f"Return: {metrics['total_return']:.2%}")
    print(f"Sharpe: {metrics['sharpe_ratio']:.2f}")
    print(f"Max Drawdown: {metrics['max_drawdown']:.2%}")

Package Modules


Last updated