Coder Social home page Coder Social logo

bc67da8d / binance-futures-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from conor19w/binance-futures-trading-bot

0.0 0.0 0.0 97.78 MB

A Technical Analysis Bot that trades leveraged USDT futures markets on Binance.

Python 99.90% Dockerfile 0.10%

binance-futures-bot's Introduction

Binance-Futures-Trading-Bot Tweet

Technical Analysis driven Crypto Trading bot on Binance Futures ๐Ÿ“ˆ โ‚ฟ ๐Ÿš€ Tweet

Join My public Discord Server & Follow The Twitter

  • Comes with 11 pre-built strategies found in TradingStrats.py
  • See Documentation below to implement your TA strategies.
  • If you enjoy the repo please share it around to friends & tweet about it using the tweet button above ๐Ÿ˜ƒ
    or Buy me a Coffee
  • Utilizes python-Binance Client to execute orders and pull data from Binance
  • Utilizes ta library for Technical indicators
  • Set up windows to sync time once a day if you don't do this binance will eventually reject orders with a timestamp error.

Creating Custom Strategies:

Strategies are implemented in Bot_Class as functions in Make_decision()

  • Make_decision() must return Trade_Direction, stop_loss_val, take_profit_val for the strategy to work properly
  • You might draw inspiration for a strategy from one of the samples in TradingStrats.py
    Create Custom Strategies
    [Create Custom TP/SL functions](files/Custom TP_SL functions.pdf)

Binance Setup

  • Create a Binance Account (This link uses my referral which gives you 5% kickback on trades & would be greatly appreciated)
  • Enable Two-factor Authentication in the security section to keep your crypto safe.
  • Create a new API key under the API Management section.
  • [โœ“] Read Info [โœ“] Enable Trading [โœ“] Enable Futures [X] Enable Withdrawals
  • Whitelist your IP address to further secure your account, and so that your API keys don't expire after 3 months.
  • Fill in your api keys into api_secret and api_key in Config_File.py

For running Bot with cloud provider, Run directly from Live_Bot.py as you can't use the GUI through ssh

Run strategies at your own risk I am not responsible for your trading decisions, futures are risky and proper risk management should be adhered to at all times, always have a stoploss

python3 Live_Bot.py
  • Settings are in Config_File.py
  • Trade a single position at a time by setting Number_Of_Trades = 1, to trade multiple coins just increment this value.
  • Choose the Interval you want to trade and the buffer of candlesticks your strategy will need this will be dependent on indicators you need to ensure you have a sufficient buffer, or you will get errors.
  • leverage and order_Size should be changed according to your preference
  • symbol[] is a list of the symbols you wish to trade, If you wish to trade all symbols set Trade_All_Coins = True.
  • Trailing stop: set use_trailing_stop = 1 and change trailing_stop_percent to suit your strategy to use the trailing stop (Min val .001 i.e .1%, Max 5 i.e. 5%). The trailing stop will be placed when the take profit value margin of increase/decrease is reached from your strategy.
  • To close a trade based off a condition check_close_pos() must return a close_pos flag.
  • strategy is the name of the strategy you want to use, see below for adding your own custom strategies.
  • There are 11 default strategies to choose from: StochRSIMACD, tripleEMAStochasticRSIATR, tripleEMA, breakout, stochBB, goldenCross, candle_wick, fibMACD, EMA_cross, heikin_ashi_ema2 & heikin_ashi_ema
  • TP_SL_choice correspond to the type of SL/TP seen in the dropdowns in the GUI see below for adding custom ones.
  • SL_mult and TP_mult correspond to the numbers preceding the TP and SL choice dropdowns.

Docker container creation (Recommended for anyone having issues running the bot):

  • Navigate to the project directory in your terminal window
  • Run the following Command this will create a docker image with the current state of your Config.py and choice of strategy in Bot_Class.py:

Sample docker commands that I use, note yours may be different (sudo may not be needed for you, I am on Linux):

sudo docker build --tag live_bot .
sudo docker run -it live_bot

GUI for Backtesting and Live Trading

Just Run app.py to get the GUI

python3 app.py

  • Backtests are displayed in the terminal while running, the results are then saved to a csv file in the current directory along with a graph image.


YouTube Channels with Strategy Ideas:

Silicon Trader | Trade Pro | Strategy Testing | Trading Journal | The Moving Average


TO-DO List:

Trello Board


Contact me Tweet

binance-futures-bot's People

Contributors

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