Skip to main content

No project description provided

Project description

Ziplime Ziplime

The first open-source backtester with native AI support

Write trading strategies in plain English. Backtest them in seconds.

Built on the legacy of Zipline. Rebuilt for the age of AI.

Python version PyPi version PyPi downloads Star this repo

Quick StartAI StrategiesDocumentationCommunity


The Problem

Zipline was the gold standard of backtesting — until it was abandoned. Pinned to legacy pandas, Python 3.6, and deprecated dependencies, it became unusable. Dozens of forks tried to patch it. None truly modernized it.

Meanwhile, AI can now write trading strategies — but every tool forces you to copy-paste between ChatGPT and your terminal, manually fixing imports, data formats, and API quirks.

There had to be a better way.


The Solution

Ziplime is Zipline reborn from scratch for 2026:

  • 🧠 AI generates strategies natively — describe what you want in plain English, Ziplime writes the code, runs the backtest, and returns the results. No copy-paste. No glue code. Everything runs locally and privately.
  • Polars replaces pandas & NumPy — dramatically faster data pipelines, especially on Apple Silicon.
  • 🔴 Live trading built in — the same algorithm file works for backtesting and live execution via Lime Trader SDK. No rewrite required.
  • 📊 Any data, any frequency — 1-minute, hourly, daily, weekly, monthly, or any custom period. OHLCV + fundamentals (P/E, revenue, margins, earnings).

Ziplime is not a wrapper around an LLM. It is a full-featured, production-grade backtesting engine that also understands natural language.


🧠 AI-Powered Strategies

Describe your trading idea in plain English. Ziplime does the rest.

"Buy AAPL when its 20-day moving average crosses above the 50-day moving average.
 Sell when it crosses back below. Use 100% of capital."

The AI engine will:

  1. Generate clean, production-ready algorithm code
  2. Download the required historical data automatically (Yahoo Finance, free)
  3. Run the backtest on your local machine
  4. Return full performance metrics and a QuantStats tearsheet

Everything stays on your machine. Your strategies are yours.

Ziplime AI assistant in action

# Install dependencies
pip install ziplime
pip install -r ai_assistant/requirements.txt

# Set your OpenRouter API key (free at https://openrouter.ai)
export OPENROUTER_API_KEY=your_key_here

# Launch the AI assistant
python -m ai_assistant
╔══════════════════════════════════════════════════════╗
║          Ziplime AI Backtesting Assistant            ║
║                                                      ║
║  Describe any trading strategy in plain language.    ║
║  The AI will generate and run the backtest for you.  ║
║                                                      ║
║  Data source: Yahoo Finance (free, no API key)       ║
║  Type 'help' for examples, 'quit' to exit.           ║
╚══════════════════════════════════════════════════════╝

You: RSI mean-reversion on AAPL for 2023

⚡ Performance That Matters

Ziplime replaces the entire pandas/NumPy data layer with Polars — a lightning-fast DataFrame library written in Rust.

Benchmark: 5 years daily data, 500 assets, SMA crossover strategy

Ziplime (Polars)  ████████░░░░░░░░░░░░░░░░░░  12.4s
Zipline (pandas)  █████████████████████████░  38.7s
Backtrader        ████████████████████████████ 52.1s

Tested on Apple Silicon M3, Python 3.12


🚀 Quick Start

pip install ziplime

Traditional way — write your strategy in Python:

# my_strategy.py
from ziplime.finance.execution import MarketOrder

async def initialize(context):
    context.asset = await context.symbol("AAPL")
    context.invested = False

async def handle_data(context, data):
    if not context.invested:
        await context.order_target_percent(
            asset=context.asset, target=1.0, style=MarketOrder()
        )
        context.invested = True
import asyncio
import datetime
from ziplime.core.run_simulation import run_simulation

asyncio.run(run_simulation(
    algorithm_file="my_strategy.py",
    start_date=datetime.datetime(2023, 1, 1, tzinfo=datetime.timezone.utc),
    end_date=datetime.datetime(2023, 12, 31, tzinfo=datetime.timezone.utc),
    total_cash=100_000,
    trading_calendar="NYSE",
))

AI way — describe your strategy in English:

pip install -r ai_assistant/requirements.txt
export OPENROUTER_API_KEY=your_key_here
python -m ai_assistant

📡 Multiple Data Sources

Source Type Cost
Yahoo Finance Historical OHLCV Free
CSV files Any custom data Free
Lime Trader SDK Real-time & historical Broker account
LimexHub Professional-grade data + fundamentals Subscription

🔴 From Backtest to Live in Zero Lines

The same algorithm file. The same logic. Just change the execution mode.

# Backtest
python -m ziplime run -f my_strategy.py --start-date 2023-01-01 --end-date 2023-12-31

# Live trade (via Lime Trader SDK)
python -m ziplime run -f my_strategy.py --mode live

No adapter classes. No rewriting logic. No "paper trading wrapper." Your backtest IS your live strategy.


Comparison with original Zipline

Feature Zipline Ziplime
Data engine NumPy / HDF5 Polars / Parquet
Performance Baseline 2–5× faster
Data frequencies Daily only Any frequency
Fundamental data Yes
Async support Full asyncio
Live trading Lime Trader SDK
Multiple data sources Limited LimexHub, Yahoo Finance, CSV, SDK
AI strategy generation ✅ Native
Python requirement 3.6 3.12+
Maintained ❌ Abandoned ✅ Active

🤝 Community & Support


Zipline is dead. Long live Ziplime. 🍋

⭐ Star this repo if you believe backtesting should be fast, intelligent, and free.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ziplime-1.19.16.tar.gz (378.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ziplime-1.19.16-py3-none-any.whl (537.0 kB view details)

Uploaded Python 3

File details

Details for the file ziplime-1.19.16.tar.gz.

File metadata

  • Download URL: ziplime-1.19.16.tar.gz
  • Upload date:
  • Size: 378.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1018-azure

File hashes

Hashes for ziplime-1.19.16.tar.gz
Algorithm Hash digest
SHA256 8a79e2412549c04d1f5ea581642d8f65cfa48beb4c9c628f83a996a34bb4c4a7
MD5 58eea24e0f821893fe342847f89b64d1
BLAKE2b-256 438f1753ea8efd4e8da668bbe50b2960b3896fc230166b130616147d064c3a2b

See more details on using hashes here.

File details

Details for the file ziplime-1.19.16-py3-none-any.whl.

File metadata

  • Download URL: ziplime-1.19.16-py3-none-any.whl
  • Upload date:
  • Size: 537.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.12.3 Linux/6.17.0-1018-azure

File hashes

Hashes for ziplime-1.19.16-py3-none-any.whl
Algorithm Hash digest
SHA256 ae379c6656f285f55f158143623feafb21c0ab601957144c4a0f7369f17738a1
MD5 6af9721b4cb0ec882dc24cee8a03cd27
BLAKE2b-256 69604a49c9e6106206b2773da413e1e79c74a0dea36157b19511a622b79754e2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page