Giter Site home page Giter Site logo

savasadar / binance-trailing-stop-loss Goto Github PK

View Code? Open in Web Editor NEW

This project forked from szferguson/binance-trailing-stop-loss

0.0 1.0 0.0 28 KB

Provides a dynamic stop-loss that automatically adjusts as the price increases or decreases (depending on mode specified)

License: GNU General Public License v3.0

Python 100.00%

binance-trailing-stop-loss's Introduction

Binance Trailing Stop-Loss

Provides a dynamic stop-loss that automatically adjusts as the price increases or decreases (depending on mode specified)

Installation

Clone the repository

git clone https://github.com/sf04/Binance-Trailing-Stop-Loss

Install required libraries

apt-get install python-pip -y
pip install ccxt

Configure API keys

Obtain an API key here

Then modify config.py and insert your API key and secret

Running

Usage

$ python main.py --help
usage: main.py [-h] --symbol SYMBOL --size SIZE --type TYPE
               [--interval INTERVAL]

optional arguments:
  -h, --help           show this help message and exit
  --symbol SYMBOL      Market Symbol (Ex: NEO/BTC - NEO/USDT)
  --size SIZE          How many satoshis (or USD) the stop loss should be
                       placed above or below current price
  --type TYPE          Specify whether the trailing stop loss should be in
                       buying or selling mode. (Ex: 'buy' or 'sell')
  --interval INTERVAL  How often the bot should check for price changes

Important note

If you are running in sell mode, it is assumed that you have already purchased the coins. If you are running in buy mode, it will use the total available balance in the base (USDT, BTC, etc). I will likely add an option later to specify investment ratio.

About the bot

Buy mode

If the buy option is set, the bot will initially place a stop-loss size satoshis (or USD) above the current market price. As the price goes lower, the stop-loss will get dragged with it, staying no higher than the size specified. Once the price crosses the stop-loss price, a buy order is executed.

Sell mode

If the sell option is set, the bot will initially place a stop-loss size satoshis (or USD) below the current market price. As the price goes higher, the stop-loss will get dragged with it, staying no lower than the size specified. Once the price crosses the stop-loss price, a sell order is executed.

Size

This is the amount in satoshis (or USD) you would like the stop-loss to be retained at. The difference between the current price and stop-loss will never be larger than this amount.

License

Released under GPLv3.

binance-trailing-stop-loss's People

Contributors

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