Easy-to-use automatic trading for Binance Spot with Telegram integration
- You can run it fast and it's easy to use.
- There are no complexities and no database usage in this project. Even dependencies are a few.
- It's easy for modifying and customization.
- It automatically stores recent candles that can be used for machine learning model input.
- You can read the code for educational purposes.
- You can be notified with Telegram messages
- Clone the repository.
- Generate a Binance API key (with Spot access) and put it in
credentials.py
. - Run
pip3 install -r requirements.txt
. - Run
python3 init_indicators_dict.py
. - Run
python3 main.py
.
This will run an example bot on trading Bitcoin.
To write custom bots you can:
- Set an initial indicators setting in
init_indicators_dict.py
(because we are handling indicators in the client side with pickle files). - Set an initial orders setting in
init_orders_dict.py
(because we are handling orders in the client side with pickle files). - Define new indicators in
indicators.py
. - Define a new strategy in
main.py
(especially insideis_it_time_to_open_long_position
andis_it_time_to_open_short_position
functions). - Config your bot settings in
config.py
.
Note: If you define any machine learning model, you can use recent_prices_list
as its input.
- Firstly, you need to create a Telegram bot, so talk to @botfather.
- Secondly, need to know your own Telegram user ID, so the bot will know who to send messages to. Talk to @userinfobot to get this information.
- Thirdly, you have to
/start
your bot. Open up a private message with your bot by searching its username, then hit the start button. - Finally, set
TELEGRAM_API_KEY
andTELEGRAM_USER_ID
incredentials.py
, andSEND_TELEGRAM_MESSAGE
inconfig.py
.
- Import modules, not variables.
- Use classes and make
main.py
smaller. - Add more indicators to
indicators.py
. - Find a better way for handling error codes.