Backtest. Paper trade. Go live.
A modular Python engine for crypto grid trading with real-time Grafana monitoring.
Documentation • Quick Start • Configuration • Grid Trading Concepts • Monitoring • Contributing
Define a price range and number of grid levels. The bot places layered buy and sell orders across the range, capturing profit from every price oscillation — no prediction needed.
- Configure your grid (pair, range, levels, spacing) in a single JSON file
- Backtest against historical data to validate the strategy
- Paper trade on exchange sandboxes with real market data
- Go live with crash recovery, real-time monitoring, and alerts
| Backtesting | Simulate strategies on historical OHLCV data (CSV or fetched via CCXT) |
| Paper Trading | Test against real market data using exchange sandbox APIs |
| Live Trading | Execute real trades with retry logic, exponential backoff, and circuit breakers |
| Grid Strategies | Simple grid and hedged grid with arithmetic or geometric spacing |
| Risk Management | Configurable take-profit, stop-loss, and slippage controls |
| Performance Analytics | ROI, max drawdown, Sharpe ratio, interactive Plotly charts |
| Crash Recovery | SQLite state persistence with exchange reconciliation on restart |
| Monitoring | Grafana dashboards with Loki log aggregation via Docker Compose |
| Notifications | Alerts via Apprise (Telegram, Discord, Slack, email, and 80+ services) |
| Multi-Exchange | Any exchange supported by CCXT (Binance, Kraken, Bybit, ...) |
- Python 3.12+ with
asyncio— async-first event-driven architecture - CCXT / CCXT Pro — unified exchange API with WebSocket support
- SQLite (WAL mode) — lightweight crash-recovery persistence
- Plotly — interactive backtest result visualization
- Grafana + Loki + Alloy — real-time log monitoring stack
- uv — fast Python package management
- Python 3.12+
- uv package manager
# Clone and install
git clone https://github.com/jordantete/grid_trading_bot.git
cd grid_trading_bot
uv sync --all-extras --dev
# Run a backtest
uv run grid_trading_bot run --config config/config.json# Start Grafana + Loki + Alloy
docker-compose up -dFull documentation — Installation, configuration, CLI usage, monitoring, architecture, and more.
| Resource | Description |
|---|---|
| Quick Start | Install and run your first backtest |
| Configuration | Full config.json parameter reference |
| Grid Trading Concepts | Understand grid trading strategies |
| Monitoring Setup | Set up Grafana dashboards for live bots |
| Architecture | Codebase design and patterns |
| Contributing | Help improve the project |
This project is licensed under the MIT License.
This project is intended for educational purposes only. The authors and contributors are not responsible for any financial losses incurred while using this bot. Trading cryptocurrencies involves significant risk and can result in the loss of all invested capital. Please do your own research and consult with a licensed financial advisor before making any trading decisions. Use this software at your own risk.