Git Product home page Git Product logo

tradefinder's Introduction

TradeFinder

A discord bot that gives you more time for everyday tasks without needing to stare at charts all the time...

Features

  1. Scrape the Binance exchange for high volume breakouts
  2. Create alerts on coins and get alerted when the coin reaches the price target of the alert
  3. Get a quick 24H chart of 5m candles for a symbol pair together with the trading volume
  4. Show indicator value for symbol pair, eg. BTCUSDT 1w ema 8 for 8-week EMA on weekly timeframe.

Installing

As with many other programs written in python, the required packages can be retreived with pip:

pip install -r requirements.txt

You may need to install py-cord with the following command to allow the use of slash-commands:

python -m pip install -U git+https://github.com/Pycord-Development/pycord

This will require python version >=3.8.0.

NOTE WHEN ADDING BOT TO SERVER - Remember to give the bot permission to use commands and to be a bot when adding the bot to your server!
https://discord.com/developers/applications/your-application-id/oauth2/url-generator
And remember to add the bot token as well, in the config.json file...

Running on Raspberry pi

Some Raspberry pi devices may throw an error like, Importing the numpy c-extensions failed. For this, run:

sudo apt-get install libatlas-base-dev

This is taken from this GitHub issue.

Customizing the bot

In config.json one can set the chat in which the bot should send alerts in. This includes different types of alerts: Volume breakouts and added price/volume alerts. It is also in the config file that one can change the time interval in seconds that the bot scrapes the market/checks if alerts are triggered together with the required volume multiplier for a low timeframe volume breakout.

{
    "token": "token",
    "parameters": {
        "scrape_interval": 300,
        "vol_breakout_threashold": 3,
        "vol_breakout_timeframe": "1h",
        "rank_by_marketcap": 0
    },
    "ids": {
        "guild_id": 01234567890123456789,
        "alerts_channel": 09876543210987654321,
        "volume_breakout_channel": ""
    },
    "pairs": []
}

One should also add the guild id (server id) when using the bot. This will make slash-commands available immediately after the bot is run.
NOTE that the "volume_breakout_channel" is left empty, or rather as "". This will disable high volume breakout scraping. If this is not desired, please insert the id of the channel you wish to receive alerts in.

The same goes for the pairs: [] list, which is left empty by defult. If any symbol pairs are added to this list, then the bot will only look for high volume breakouts on these trading pairs. The rank_by_marketcap option allows the user to limit the scraped coins by market cap rank between 1-1000. Leaving this at 0 will include all coins no matter market cap.

Features

This section will cover the available commands and how to use them. This will be updated as commands change and when commands are removed/added.

Price alert (/pricealert)

Do you want to know exactly when a certain trading pair, BTCUSDT, ADAUSDT, BTCETH and etc, cross a certain valuation price? If so, this command is for you.

Requirements

  • Symbol (BTCUSDT etc)
  • Type (up/down)
  • Price (self-explanatory)

Example usage:

/pricealert symbol:btcusdt type:up price:50000 

This will generate the following alert in alerts.json:

{
    "symbol": "BTCUSDT",
    "userid": 1234567890,
    "type": "up",
    "price": "50000",
    "timeframe": "",
    "vol_multiple": 0,
    "delete": true
}

With every alert the user id of the user who created the alert will be stored. This is used to ping the user when the alert is triggered and to check if someone has the permission to remove the alert (see command for removing alerts).
Also note the keyword delete which by default is true and optional when adding an alert. If set to false then the alert will not be removed after being triggered. The alert can still be removed with the /removealert command.

Volume alert (/volumealert)

Are you watching for a breakout for a certain coin? If so, this command might be for you.

Requirements

  • Symbol
  • Timeframe (1m, 5m, 15m, 4h, 1d...)
  • Volume multiple (2, 3, 4, 10...)

This alert will compare the volume of the latest candle on the chosen timeframe to the 20 candle volume moving average. If the volume of the current candle is greater than Volume multiple * VMA then the alert will be triggered.

Example usage:

/volumealert symbol:btcusdt timeframe:15m volume_multiple:3 

This will create the following alert:

{
    "symbol": "BTCUSDT",
    "userid": 328543383771414528,
    "type": "volume",
    "price": 0,
    "timeframe": "15m",
    "vol_multiple": "3"
}

Get alerts (/getalerts)

Get all alerts created for certain symbol.

Requirements

  • Symbol

Example usage:

/getalerts symbol:btcusdt 

This will send the following message from the two alerts created above:
/getalerts example output

Remove alert (/removealert)

Rather self explanatory, this alert is used to remove a certain alert. However, you can only delete alerts that you created!

Requirements

  • Alert

Use the /getalerts command to get the alert you wish to remove and copy it into the message field.

Example usage:

/removealert alert:{"symbol": "BTCUSDT", "userid": 1234567890, "type": "up", "price": "50000", "timeframe": "", "vol_multiple": 0}

The bot will then reply if the alert was removed succesfully.

Chart (/chart)

This command creates a candle stick chart for a given symbol the previous 24H on 5m candles.

Requirements

  • Symbol

Example usage:

/chart symbol:btcusdt

Which generates the following chart and sends it in the chat.
Chart from chart command

Latest TradeFinder signal (/tfs)

Find the date and time of the latest volume breakout trigger for a given trading pair

Requirements

  • Symbol

Example usage:

/tfs symbol:btcusdt

The bot will then reply with the date and time of the latest triggered volume breakout for BTCUSDT.

TODO

  • Testing and bug-fixing
  • Code optimization and refactoring

tradefinder's People

Contributors

byggemandboesen avatar

Stargazers

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