Giter VIP home page Giter VIP logo

trailing-profit-bot's Introduction

trailing-profit-bot

What is it?

An automated trading bot for use with TradingView Strategies to execute cryptocurrency trades on Binance.com, written in Python. The python script runs its own trailing loss/profit vs using built-in trailers from the exchanges. This gives users more flexibility in terms of how and when to trail stops.

Requirements:

For an out of the box solution, you'll need:

Tradingview - for creating trading strategies and algorithms (https://www.tradingview.com/)
Binance - Broker/Exchange (https://www.binance.com)
Telegram Messaging - for message notifications (https://telegram.org/)
ngrok - webserver for receiving webhook calls from TradingView (https://ngrok.com/)

These can be substituted for your preferred services, with some modifications to the api calls.

How it all works:

This bot is intended for those who have preconfigured trading strategies/algorithms created on software platforms that supports webhook calls, i.e TradingView. Here is the order flow:

  1. Create trade alerts for your strategy/algorithm on TradingView
  2. Alert message should be formated as json (for example, run generate_alert_message.py)
  3. Include the listening webhook url to forward the message to your webserver
  4. Webserver receives the message and checks states and config
  5. Orders are sent to Binance (order logic is in order.py)

Configuration files:

config.txt - telegram and webserver port config
state.cfg - can be used to hold state information, such as the multi-timeframe trends (not currently implemented in this version). It also checks wheher there is already a trade running of the same security (see example file).

Troubleshooting:

  • ngrok Webserver authentication is configured in auth.py. Running generate_alert_message.py will give you the auth key in the message.
  • A logs/ subfolder will need to be created for logs
  • Binance api key/secret reads from your system profile (~/.profile for most *nix distro)
  • Use this link for a guide on how to set up your Telegram notification bot: https://core.telegram.org/bots
  • Modify util.py to use with your telegram bot

trailing-profit-bot's People

Contributors

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