SkillAgentSearch skills...

MyCryptoBot

Open source crypto trading platform to automate trading strategies.

Install / Use

npx skills add diogomatoschaves/MyCryptoBot

Installs into whichever agent you are using.

README

MyCryptoBot

build_badge build_badge build_badge codecov

<p align="middle"> <img src="shared/utils/drawings/dashboard.png" style="width: 48%" /> <img src="shared/utils/drawings/trades.png" style="width: 48%" /> </p>

Welcome to the MyCryptoBot repository, a free, open source, and extensible trading platform that utilizes a microservices architecture. The platform empowers you to run your own trading bots and strategies locally or in the cloud. At present, the app is integrated with Binance, supporting both the testnet and live Futures accounts.

For those looking to validate trading strategies against historical data, stratestic offers a comprehensive backtesting framework and integrates seamleassly with this trading platform.

Please check the disclaimer before using this repository.

Installation & Usage

The detailed steps for installing and using this application locally and remotely on Heroku are provided in the INSTALLATION.md file. However, we recommend that you understand the app's structure before diving into the installation steps.

Deployment

MyCryptoBot can be run in a few ways:

  • Locallydocker-compose up --build brings up all services on your machine (see INSTALLATION.md).
  • On your own server — clone the repo on any VPS and run the same docker-compose stack; pull and rebuild to update.
  • On Heroku — the repository ships with GitHub Actions workflows that build and release each service to Heroku. This is opt-in: set the repository variable ENABLE_HEROKU_DEPLOY=true (plus the HEROKU_* secrets) to deploy on pushes to master. Left unset, CI only runs the tests and builds the images — nothing is deployed. See the Github section of the installation guide.

Introduction

The primary goal of this repository is to provide a platform that enables you to deploy your strategies, run them locally or on a remote server, and manage all your trading activities with a user-friendly web UI. The app comprises three micro-services that are interconnected via a database and served by a frontend web app. There is a ready-made functionality to deploy the services to Heroku, which will require an account and associated monthly costs.

The app's architecture consists of the following:

MyCryptoBot Architecture

Data Service

This service acts as the data warehouse of the app. It acquires data from external sources, such as exchanges, preprocesses it, and stores it in a database. When a new trading bot is initiated through the user interface, a new data pipeline is initiated, fetching live data from the various sources. Whenever a new candle is completed, a request is sent to the Model app for processing the new data according to the strategy.

This service can also be used to retrieve historical data for any symbol.

from data.sources.binance import get_historical_data
data = get_historical_data("BTCUSDT", "1h", "2021-01-01", "2021-01-31", save_file=True)

Model Service

The Model service is responsible for processing the data and generating a signal (Buy or Sell) according to the selected strategy. Whenever a request is received to generate a new signal, the data is loaded, processed, and a signal is produced, which is then sent to the Order Execution service with an order to be executed.

This is also the module where you can add a new strategy. Check ADD_NEW_STRATEGY.md for more details on how to do this.

Order Execution Service

The Order Execution service acts as a layer to handle the communication between the app and the exchange. It receives buy and sell orders from the Model service with a signal, assesses whether an action is required (if the received signal differs from the current one), and responds accordingly.

Web App

The user interface enables the user to start and stop trading bots, view open positions, executed trades, statistics, and more. The following are brief descriptions of the various views of the app.

Dashboard

<p align="middle"> <img src="shared/utils/drawings/dashboard.png" style="width: 60%" /> </p>

This serves as the main view of the application, presenting a comprehensive overview of the equity evolution, trading bot data, open positions, and associated trades over time. Summary statistics are displayed to provide key insights. Users can easily navigate to different sections of the app by clicking on the corresponding section or utilizing the left-hand side menu.

Trading Bots

<p align="middle"> <img src="shared/utils/drawings/trading-bots.png" style="width: 60%" /> </p>

This page provides an overview of all existing trading bots along with their current status. Users have the ability to edit, start, and stop these bots directly from this view. Clicking on a specific trading bot leads to a detailed page, showcasing the equity evolution, statistics, and a comprehensive list of all trades associated with that bot.

<p align="middle"> <img src="shared/utils/drawings/trading-bot-detail.png" style="width: 60%" /> </p>

Additionally, users can create a new trading bot by selecting the New Trading Bot button. Simply fill in all the required details, and the new bot will be created and initiated automatically.

<p align="middle"> <img src="shared/utils/drawings/create-new-bot.png" style="width: 60%" /> </p>

Positions

<p align="middle"> <img src="shared/utils/drawings/positions.png" style="width: 60%" /> </p>

This page displays the currently open positions linked to the trading bots.

Trades

<p align="middle"> <img src="shared/utils/drawings/trades.png" style="width: 60%" /> </p>

This page shows all the trades executed by any of the trading bots. It is possible to filter by live or testnet trades.

Alerts

<p align="middle"> <img src="shared/utils/drawings/alerts.png" style="width: 60%" /> </p>

The app can push operational alerts to your phone via a Telegram bot: pipeline stops and deactivations, position mismatches between the local records and the exchange, failed or unconfirmed orders, restart attempts, and unreachable services or workers. This page shows whether alerting is configured, lets you send a test alert, and includes a step-by-step setup guide.

To enable alerts:

  1. In Telegram, open @BotFather, send /newbot and follow the prompts. Copy the bot token.
  2. Open your new bot's chat and press Start (bots can only message users who have messaged them first).
  3. Get your chat ID: visit https://api.telegram.org/bot<TOKEN>/getUpdates in a browser and read the number at "chat": {"id": ...} — or message @userinfobot and it replies with your ID.
  4. Press Configure on the Alerts page and paste the bot token and chat ID. Alternatively, set the TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID environment variables — when present, they take precedence over settings saved in the dashboard.

The bot token is write-only: it is stored server-side and never sent back to the browser. If neither the dashboard settings nor the environment variables are set, alerting is simply disabled.

Software Requirements

  • Poetry (For creating an environment for local development.)
  • Docker (For running the app locally.)
  • Heroku CLI (For deploying the app to a Heroku.)
  • AWS S3 (For storing machine learning models in the cloud.)

Related Skills

View on GitHub
GitHub Stars141
CategoryDevelopment
Updated8d ago
Forks28

Languages

Python

Security Score

85/100

Audited on Jul 30, 2026

No findings