Sign inSign up

pkumaschow/cryptotrader

By pkumaschow

•Updated 8 days ago

Python-based algorithmic trading bot for Kraken, with a live Textual TUI and SQLite trade log.

Image
0

4.3K

pkumaschow/cryptotrader repository overview

⁠CryptoTrader

Python-based algorithmic trading bot for Kraken, with a live Textual TUI and SQLite trade log.

⁠Features

  • Multiple strategies — threshold, EMA crossover, Bollinger Bands, and trend-pullback, running in parallel for comparison (test mode) or individually per pair (production)
  • Live TUI — real-time bid/ask/last prices, account balance, trade log, and per-strategy P&L via a Textual terminal UI
  • SQLite trade log — all trades and deposits recorded with WAL mode for concurrent read access
  • Multi-arch image — published for both linux/amd64 and linux/arm64

⁠Mode: test vs. production

Mode is set by config/settings.toml ([mode] active = "test" or "production"), which is baked into the image at build time — it is not controlled by an environment variable. test mode paper-trades against live prices with no real orders and no Kraken keys required; production mode places real orders and requires KRAKEN_API_KEY/KRAKEN_API_SECRET, or the container exits immediately with an error.

Check which mode the tag you're pulling ships with before running it unattended. To run in test mode regardless of what's baked in, mount your own settings.toml with mode.active = "test" over /app/config/settings.toml.

⁠Quick Start

# Copy and configure your Kraken API keys (required if the image is in production mode)
cp .env.example .env

# Run headless
docker run --rm \
  --env-file .env \
  -v $(pwd)/cryptotrader.db:/app/cryptotrader.db \
  docker.io/pkumaschow/cryptotrader:latest

# Run with interactive TUI
docker run --rm -it \
  --env-file .env \
  -v $(pwd)/cryptotrader.db:/app/cryptotrader.db \
  docker.io/pkumaschow/cryptotrader:latest --tui

Environment Variables

Required only when the image is running in production mode.

┌───────────────────┬──────────────────────────────────────────────────┐
│     Variable      │                   Description                    │
├───────────────────┼──────────────────────────────────────────────────┤
│ KRAKEN_API_KEY    │ Kraken API key (required for production mode)    │
├───────────────────┼──────────────────────────────────────────
│ KRAKEN_API_SECRET │ Kraken API secret (required for production mode) │
└───────────────────┴──────────────────────────────────────────

Makefile

A Makefile is included for convenience. Supports both Docker an

make build              # build locally
make run                # run headless
make tui                # run with TUI
make run CTR=podman     # use Podman instead of Docker

▎ Podman / SELinux note: On Fedora/RHEL the volume mount requires the :Z relabel flag. The Makefile handles this automatically.

Database Persistence

The SQLite database is bind-mounted from the host. The file is created automatically on first run. Mount it to preserve trade history across container
restarts:

-v $(pwd)/cryptotrader.db:/app/cryptotrader.db

Source

github.com/pkumaschow/cryptotrader

Docs

https://pkumaschow.github.io/cryptotrader/

Tag summary

Content type

Image

Digest

sha256:3b1f5b789…

Size

58.9 MB

Last updated

8 days ago

docker pull pkumaschow/cryptotrader