TradingBot series — Architecture for a trading bot

Matt Gosden
5 min readApr 23, 2019

In this post, we outline the architecture of our latest trading bot, built using Python, Backtrader, Telegram and Django

What this bot does …

This trading bot monitors over 1000 markets daily to identify buy and sell signals.

The triggers are generated by a number of relatively sophisticated Technical Analysis patterns which are overlaid onto the market candles fetched from a number of exchange APIs.

The bot then ‘paper trades’ (so it does not place live trades on the exchange) on these markets and monitoring positions. It makes the orders available to a separate live trading bot via an API for live trading on an exchange where required.

The bot has a web front-end for our collaborators showing current status, technical analysis charts for each market, open orders, recent paper trades, etc.

The bot also uses the Telegram API so that trade messages and orders can be posted there to give real-time updates.

Architecture overview

The diagram shows how the various pieces fit together in this bot architecture.

Database — the brain

--

--