Giter VIP home page Giter VIP logo

binance-stoploss's Introduction

Binance Stop-Loss Bot Go Report Card

Binance Trailing Stop-Loss Bot and optional Telegram notifications.

A trailing stop order sets the stop price at a fixed amount below the market price with an attached "trailing" amount. As the market price rises, the stop price rises by the trail amount, but if the stock price falls, the stop loss price doesn't change, and a market order is submitted when the stop price is hit.

Run

Require API Keys.
Set Environment variables:

  • BINANCE_APIKEY
  • BINANCE_SECRET
  • TELEGRAM_TOKEN (optional to notify)

Simple command to run bot stoploss

Sell all BTC balance to market price when down 3%.

./binance -pair=BTC/USDT -percent=3

For buy orders

Buy 0.01 BTC when price up 0.5%

./binance -type=BUY -pair=BTC/USDT -percent=0.5 -amount=0.01

For sell orders with static stoploss

SELL 0.1 BTC when BTC down to 9400 USDT

./binance -pair=BTC/USDT -price=9400 -amount=0.1

Notifications

  • Telegram.
./binance -pair=BTC/USDT -percent=3 -interval=60 -telegram.chat=<user-id>

telegram binance bot

For get user id, talk to the userinfobot

  • Mailing.
./binance -pair=BTC/USDT -percent=3 \
      -mail.host="smtp.example.com" \
      -mail.port=587 \
      -mail.user="[email protected]" \
      -mail.pass="xxxx" \
      -mail.from="[email protected]" \
      -mail.to="[email protected]"

You can notify both: telegram, mail.

Docker

You can run in docker container.

docker pull giansalex/binance-stoploss
# create container
docker run -d --name binance_sell_BTC giansalex/binance-stoploss \
      -type=BUY \
      -pair=BTC/USDT \
      -percent=5 \
      -amount=0.01

List available parameters

  -amount string
        (optional) amount to order (sell or buy) on stoploss
  -interval int
        interval in seconds to update price, example: 30 (30 sec.) (default 30)
  -mail.from string
        (optional) email sender
  -mail.host string
        (optional) SMTP Host
  -mail.pass string
        (optional) SMTP Password
  -mail.port int
        (optional) SMTP Port (default 587)
  -mail.to string
        (optional) email receptor
  -mail.user string
        (optional) SMTP User
  -pair string
        market pair, example: BNB/USDT
  -percent float
        percent (for trailing stop loss), example: 3.0 (3%)
  -price float
        price (for static stop loss), example: 9200.00 (BTC price)
  -stop-change
        Notify on stoploss change (default: false)
  -telegram.chat int
        (optional) telegram User ID for notify
  -type string
        order type: SELL or BUY (default "SELL")

binance-stoploss's People

Contributors

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