No project description provided
Project description
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.
Quick Start • AI Strategies • Documentation • Community
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:
- Generate clean, production-ready algorithm code
- Download the required historical data automatically (Yahoo Finance, free)
- Run the backtest on your local machine
- Return full performance metrics and a QuantStats tearsheet
Everything stays on your machine. Your strategies are yours.
# 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
- 📖 Documentation
- 🐛 Issues
- 🏠 Limex
Zipline is dead. Long live Ziplime. 🍋
⭐ Star this repo if you believe backtesting should be fast, intelligent, and free.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ziplime-1.15.5.tar.gz.
File metadata
- Download URL: ziplime-1.15.5.tar.gz
- Upload date:
- Size: 374.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17166728788062f1b974b885ef1732494d3915396ad86ca0270e6155f95b0648
|
|
| MD5 |
48960b0f8812d6d1772445d89f150238
|
|
| BLAKE2b-256 |
a82f24012aa4c42e106928c6bbc4073b1155580d9c486abddcdce1af794ecf1c
|
File details
Details for the file ziplime-1.15.5-py3-none-any.whl.
File metadata
- Download URL: ziplime-1.15.5-py3-none-any.whl
- Upload date:
- Size: 529.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.12.3 Linux/6.14.0-1017-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83a67eb178930999df00001ab6aff9133c247f6e3393907cfda1a8d649f1c9f7
|
|
| MD5 |
2358d58980263df2241e8a5f91b6a056
|
|
| BLAKE2b-256 |
a6c02b34948d78ed1ab9fb0955d6b702f687522dd5aa607e44f4bd1a6ee49f8a
|