BTrader is a program that creates, deploys, and moderates an unlimited number of trade bots to trade in the cryptocurrency market on any coin and at any time interval using limitlessly expandable trading strategies. Deployed on an AWS server running 24/7, It has made more than 250 successful trades in 2024 for my personal use and is cleansed of any bugs as far as I've explored.
As for now, I will not be sharing the full project 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 and guide them while also showcasing my skills. While systems in this repository are fully functional, they are meant to be used with other systems therefore might be incomplete without.
The repository contains the following:
- Flask app connecting the backend to frontend in
app.py. - The bTrader class to handle real-time trading on the market in
btrader.py. Asynchronicity and multithreaded architecture. - The strategy interface and two strategy implementations with both real-time and backtesting classes.
- bTraderManager class to handle multiple traders in
btmanager.py - Structures of environment variables.
Some of the missing parts in this repository:
- Client connections for authorization handling and order processing through the cryptocurrency exchange.
- Trade pair price step adjustments(10-18 precision), auto order safety for up to %10 account balance deficit.
- Backtesting with historical data using any date-span, trade pair, interval, strategy.
- Frontend.
- Log handling.
- Market history.
- etc.
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
.envfile at./app/.envwith your API keys using./app/.env.template. -
Run The Program: Go to the
./appfolder 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.Strategyclass, and the other for live trading subclassing thebStrategyclass. After that, edit theapp/strategy_manager.pyand your.envfiles 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.