An extensible trading bot - write your own plugins for planning trades, execute and manage them.
tbot is a flexible trading bot framework that allows users to create and implement their own trading strategies through a rich plugin system. The repository contains the core that runs the strategies provided by the user.
- Extensible architecture through a comprehensive plugin system
- Support for multiple trading strategies
- Docker-based deployment for easy setup and management
- Docker
-
Create a
.env
file in the root of the repository, containing:- Required strategies file path
- Required mnemonic of the wallet used for trading configs
- Optional logs path and frequency
-
Run the bot using Docker Compose:
docker compose up -d
tbot supports three types of plugins:
- Plan: Used to plan for a trade based on candles. Can return long, short, or nothing.
- Execute: Used to execute when a plan plugin returns long or short. Determines how/when to open an order (e.g., triggers, etc.).
- Manage: A general-purpose plugin, mostly used for managing open positions (e.g., increasing/decreasing size, closing old non-filled orders, etc.).
A strategy in tbot consists of:
- ID
- Platform (the exchange used for trading - currently only dYdX is supported)
- Type (testnet/mainnet)
- Trading pair
- Timeframe
- Plugins information (name, URL, and config for plan, execute, and manage plugins)
These components together create a unique strategy. Multiple strategies with different pairs, timeframes, and plugins can be implemented.
- Plugin examples can be found in the
plugin-examples
directory. - Strategy examples are available in the
strategies
directory.
Currently, only dYdX is supported as a trading platform.
The MVP of this project was developed as part of ConnecMent.
Mentor: @mkermani144
Mentees: @Mr-MRF-Dev, @raminLgh