← Back to Portfolio
Python Exchange API Real-Time Data Telegram Bot systemd

Algorithmic Trading System

A fully automated crypto trading engine running 24/7 on a VPS — real-time market analysis, autonomous position management, PnL tracking, and instant Telegram notifications with zero manual intervention.

Overview

Built as an internal tool to automate cryptocurrency trading across multiple exchanges. The system connects via WebSocket for real-time market data streaming and REST APIs for order execution. A custom signal engine with configurable parameters evaluates market conditions using technical indicators and executes trades autonomously with multiple strategy support.

All positions, PnL calculations, and trade history are tracked in real-time with PnL reconciliation against exchange API (not just internal tracking). State is persisted atomically (tmp file then rename pattern) to prevent data corruption. Edge cases like concurrent trades, partial fills, and same-symbol consecutive trades are explicitly handled. The system runs as a systemd service with auto-restart. A Telegram bot provides a full operator dashboard — live PnL, open positions, trade history, manual override controls, and daily performance summaries.

Key Features

Architecture

The system runs as a persistent systemd service on a Linux VPS. Core components: a market data streamer (WebSocket), a signal evaluation engine, an order execution layer (REST API), a state manager (JSON with atomic writes), and a Telegram bot for operator control.

All components communicate through an event-driven architecture with strict error isolation — a failure in one subsystem cannot cascade to others.

Tech Stack

Python Exchange REST & WebSocket APIs Telegram Bot API systemd Linux VPS JSON State Management Technical Analysis Libraries