Skip to content

Binance Auto Trading Bot - Buy low/Sell high with stop loss limit/Trade multiple coins

License

Notifications You must be signed in to change notification settings

Treamz/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. I have found MACD indicators often mislead buying signal. In box pattern market, buy signal with lowest price is effective than using MACD indicators.

This method can monitor multiple symbols.

  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.
    • 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.

MACD-Stop-Chaser

The concept of MACD-Stop-Chaser is simple. Buy at low price, never sell under purchase price. Chase rising money. Stop chaser methodology was the idea from @d0x2f

  1. Detect buy signal

    • Get previous MACD trend (Rising/Falling or Unknown)
    • Get last two MACD trend (All rising or all falling)
    • If previous MACD trend is falling and last two MACD trend is all rising, then check
      • If current closed price is higher than lowest price within 24 hours, then do not buy.
      • If current closed price is lower or similar than lowest price within 24 hours, then buy NOW.
  2. 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.

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

Environment Parameters

Use environment parameter to adjust parameters. Checkout /config/custom-environment-variables.json

Trades

First trade

Chart Order History
Screenshot1 Screenshot2

Last 30 days trade

Trade History PNL Analysis
Screenshot3 Screenshot4

Todo

  • Support multiple symbols
  • Frontend to see statistics

About

Binance Auto Trading Bot - Buy low/Sell high with stop loss limit/Trade multiple coins

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 96.0%
  • CSS 1.9%
  • HTML 1.7%
  • Dockerfile 0.4%