BTrader is a program to create, deploy, and moderate an unlimited number of trade bots to trade on the cryptocurrency market on any coin and any time interval using limitlessly expandable trading strategies. Deployed on a server running 24/7, It has made more than 250 successful trades so far for my personal use and is cleansed of any bugs as far as I've explored.
As for now, I am not comfortable with sharing my full work on the internet as open source. I believe this much of the codebase should be enough to satisfy some of the curiosity of people who want to build a similar project while also showcasing my skills. While systems in this repository are fully functional, they are only a part of the bigger system and therefore incomplete without it.
The repository contains the following:
- Flask app connecting backend and frontend in
app.py
. - The bTrader class to handle real-time trading on the market in
btrader.py
. double-layered Asynchronicity and multithreaded architecture. - The strategy interface and two strategy implementations with both real-time and backtesting classes.
- Structures of environment variables.
- Frontend examples.
Some of the missing parts in this repository:
- Client connections handling to authorize and trade using a cryptocurrency exchange.
- Bigger structure to moderate multiple traders from the user interface and backend.
- Backtesting.
- Frontend.
- Log handling.
- Market history.
- Serving of the flask app.
- And more.
This project uses Binance API to trade crypto in real-time using technical analysis. And gives the option to backtest the strategies using backtrader. Any amount of traders can be deployed with any pair/interval/strategy. It also supports the development of new trading strategies. The Program is running a Flask application with user-friendly UI and has a quick trading option with lightweight-charts implemented
-
Trade With Multiple Trade Bots At The Same Time Using Different Strategies.
-
Backtest The Strategies On Whichever Trading Pair and Trade Interval You Want.
-
Quick Trade Your Assets On All Trading Pairs.
-
Do It All In A User-Friendly Interface.
-
Clone the repository:
git clone https://github.com/BeratDM/BinanceTrader-Extended.git cd BinanceTrader-Extended
-
Set up a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install the required Python packages:
pip install -r requirements.txt
-
Environment Setup: Create your
.env
file at./app/.env
with your API keys using./app/.env.template
. -
Run The Program: Go to the
./app
folder and runmain.py
. Make sure you are using the virtual environment if you set it up. A flask application will start and you can visit the url in your browser. -
Strategy Development: New trading strategies can be developed inside the
app/TradeStrategies/
folder by making a new Python file for your strategy and creating two classes, one for backtesting subclassing thebacktrader.Strategy
class, and the other for live trading subclassing thebStrategy
class. After that, edit theapp/strategy_manager.py
and your.env
files similarly to the examples to reference your classes.
Disclaimer: This project is developed for personal purposes. Trading and investing involve significant risks, and using this software does not guarantee any profits. Please conduct thorough testing and research before deploying any trading strategy.