Giter Site home page Giter Site logo

fredmichel / binance-trading-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chrisleekr/binance-trading-bot

0.0 1.0 0.0 3.57 MB

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

License: MIT License

JavaScript 96.28% Dockerfile 0.28% CSS 1.98% HTML 1.47%

binance-trading-bot's Introduction

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 the 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 the 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 the next symbol to process

  2. Process buy signal

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

    • If there is no open order but have coins enough to sell, then check
      • Get last buy price from the cache
      • If the current price is higher than the minimum profit percentage last buy price, then place Stop-Loss-Limit order.
      • Otherwise, do not place Stop-Loss-Limit order.
    • If there is an opened Stop-Loss-Limit order, then check the current price.
      • If the current price is higher than stop price, then cancel the open order. Then it will place new Stop-Loss-Limit order in next process.

Environment Parameters

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

Or use the frontend to adjust configurations after launching the application.

How to use

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

    Environment Key Description Sample Value
    BINANCE_LIVE_API_KEY Binance API key for live (from Binance)
    BINANCE_LIVE_SECRET_KEY Binance API secret for live (from Binance)
    BINANCE_TEST_API_KEY Binance API key for test (from Binance)
    BINANCE_TEST_SECRET_KEY Binance API secret for test (from Binance)
    BINANCE_SLACK_WEBHOOK_URL Slack webhook URL (from Slack)
    BINANCE_SLACK_CHANNEL Slack channel "#binance"
    BINANCE_SLACK_USERNAME Slack username Chris
    BINANCE_LOCAL_TUNNEL_SUBDOMAIN Local tunnel public URL subdomain binance
  2. Check docker-compose.yml for BINANCE_MODE environment parameter

  3. Launch the application with docker-compose

    docker-compose up -d

    or using the latest build image

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

    asciicast

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

    • When launching the application, it will notify public URL to the Slack.

Frontend + WebSocket

React.js based frontend communicating via Web Socket:

  • List monitoring coins with buy/sell signals/open orders
  • View account balances
  • Manage settings including symbols
  • Delete caches that are not monitored
  • Link to public URL
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
  • Remove unused methods - Bollinger Bands, MACD Stop Chaser
  • Support a 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
  • Fix the bug last buy price not removed
  • Update frontend to be exposed to the public using the local tunnel
  • Display account balances in the frontend
  • Update frontend to change symbols in the configuration
  • Update frontend to change last buy price per symbol
  • Secure frontend with the password to disable the configuration
  • Change to more persistence database

binance-trading-bot's People

Contributors

chrisleekr avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.