Skip to content

Automated Binance trading bot - Trade multiple cryptocurrencies. Buy low/sell high with Grid Trading. Integrated with TradingView technical analysis

License

Notifications You must be signed in to change notification settings

dmitriz/binance-trading-bot

Repository files navigation

Binance Auto Trading Bot

Build CodeCov MIT License

This is a test project. I am just testing my code. I cannot guarantee whether you can make money or not.

So use it at your own risk! I have no responsibility for any loss or hardship incurred directly or indirectly by using this code.

How it works

Simple-Stop-Chaser

This method is buying at lowest price without any indicator, never sell under purchase price. And chase rising money. Stop chaser methodology was the idea from @d0x2f. I have found MACD indicators often mislead buying signal. In box pattern market, buy signal with lowest price is effective than using MACD indicators.

Note

  • This method is only tested and working with USDT pair in the FIAT market such as BTCUSDT, ETHUSDT.
  • This method can monitor multiple symbols.

Process

  1. Get next symbol

  2. Detect buy signal

    • Get lowest closed price with period
    • If current closed price is lower than lowest closed price, then buy NOW.
      • It will only purchase maximum purchase amount or less.
      • It will not purchase if base asset, such as BTC, has enough balance to place stop loss limit order.
    • If current closed price is higher than lowest closed price, then do not buy.
  3. Chase Stop-Loss-Limit order

    • If there is no open order but have coins that bought by the buy signal, then check
      • Get last purchase price
      • If current closed price is higher than minimum profit percentage * last purchase price, then place Stop-Loss-Limit order.
      • Otherwise, do not place Stop-Loss-Limit order.
    • If there is an open Stop-Loss-Limit order, then check current closed price.
      • If current closed price is higher than stop price, then cancel the open order. So it can be place new Stop-Loss-Limit order.

Environment Parameters

Use environment parameters to adjust parameters. Check /config/custom-environment-variables.json to see list of available environment parameters.

Or use frontend setting to adjust values after launching the bot. Note that if you restart bot, it will reset frontend adjusted value from frontend.

How to use

  1. Create .env file based on .env.dist.

  2. Check docker-compose.yml for BINANCE_MODE environment parameter

  3. Launch docker compose

    docker-compose up -d

    or using latest build image

    docker-compose -f docker-compose.server.yml up -d

    asciicast

  4. Open browser http://0.0.0.0:8080 to see frontend statistics

Frontend + WebSocket

React.js based frontend communicating via Web Socket

  • List monitoring coins with buy/sell signals
  • Manage settings
Frontend Mobile Setting
Screenshot1 Screenshot2
Frontend Desktop
Screenshot

Trades

First trade

Chart Order History
Screenshot1 Screenshot2

Last 30 days trade

Trade History PNL Analysis
Screenshot3 Screenshot4

Todo

  • Support multiple symbols
  • Removed unused methods - Bollinger Bands, MACD Stop Chaser
  • Support maximum purchase amount per symbol
  • Develop backend to send cache values for frontend
  • Develop simple frontend to see statistics
  • Fix the issue with configuration
  • Update frontend to remove cache
  • Fix the issue with rounding when places an order
  • Fix the issue with persistent redis

About

Automated Binance trading bot - Trade multiple cryptocurrencies. Buy low/sell high with Grid Trading. Integrated with TradingView technical analysis

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 98.5%
  • CSS 0.7%
  • HTML 0.5%
  • Shell 0.1%
  • Dockerfile 0.1%
  • Python 0.1%