项目作者: titulebolide

项目描述 :
Monitor your Binance portfolio
高级语言: Python
项目地址: git://github.com/titulebolide/binance-report-bot.git
创建时间: 2021-05-14T13:32:09Z
项目社区:https://github.com/titulebolide/binance-report-bot

开源协议:MIT License

下载


Binance Report Bot

The intent of this bot is to take a snapshot of your binance wallet, e.g. the current balances and store it for further plotting.

Install

Create the file conf_user.py based on conf_default.py. If a field is missing in conf_user.py, it will defaults to the one in conf_default.py.

Then run

  1. pip3 install -r requirements.txt

Basic Usage

To save a snapshot of the binance account run:

  1. python3 -m brb snapshot

To show the previously saved snapshots

  1. python3 -m brb output # --help for options

Deployment

One can use crontab to use this code:

  1. 0 * * * * cd [FOLDER] ; python3 -m brb snapshot
  2. 2 19 * * * cd [FOLDER] ; python3 -m brb output --quiet

To have a snaphsot made every hour and a report made every day at 19:02.

The output can be sent to an external service, that can be configured with the APPRISE_URL parameter. See here to choose your external service and to create your APPRISE_URL. Please use a service that supports attachment, in order to send images. Recommended services : Discord, Telegram or Email.

Output example

Plot EOS equivalent holdings:

  1. python3 -m brb output --symbol EOS

Plot ICX relative equivalent holdings:

  1. python3 -m brb output --symbol ICX --relative

Plot ICX and EOS equivalent holdings since three days ago:

  1. python3 -m brb output --symbol ICX,EOS --days 3

Plot the equivalent holdings of all soins registered in the conf file:

  1. python3 -m brb output --symbol * # or '*' if using zsh

Plot the price of EOS and BTC over the last 10 days expressed in WIN:

  1. python3 -m brb output --symbol EOS,BTC --graph-type price --price-in WIN

Note : The equivalent holding is your portfolio’s value in a certain currency. It represents what you would be holding if all your portfolio was under this single currency.

CLI specification

  1. $ python3 -m brb --help
  2. Usage: python -m brb [OPTIONS] COMMAND [ARGS]...
  3. Binance Report Bot
  4. Take a snapshot of your binance wallet, e.g. the current balances and store
  5. it for further plotting.
  6. Options:
  7. --debug / --no-debug Prints debug data
  8. --help Show this message and exit.
  9. Commands:
  10. output Output the previously stored data
  11. snapshot Take a snapshot of your wallet
  1. $ python3 -m brb snapshot --help
  2. Usage: main.py snapshot [OPTIONS]
  3. Take a snapshot of the binance wallet and save it for further plotting
  4. Options:
  5. --help Show this message and exit.
  1. $ python3 -m brb output --help
  2. Usage: python -m brb output [OPTIONS
  3. Output the previously stored data with 'snapshot'
  4. Options:
  5. --quiet / --no-quiet Set to true if you don't want to print in
  6. the console or display an image
  7. --text / --no-text Can be used to prevent the generation of the
  8. text report
  9. --graph / --no-graph Can be used to prevent the generation of the
  10. graph report
  11. -r, --relative / --no-relative If the graph should be plotted relative to
  12. its initial value
  13. -s, --symbol TEXT The currency the graph will be plotted on.
  14. To plot several symbols on the same graph,
  15. separate them by a coma. If plotting several
  16. symbols, the --relative option is enabled.
  17. To plot all symbols, use '*'. Default : FIAT
  18. -d, --days INTEGER The number of days over which the graph will
  19. be plotted. If set to 0, the graph will plot
  20. all the records. Default : 7 days
  21. -t, --graph-type [amount|price]
  22. Graph type. Amount : shows the equivalent
  23. amount that you are holding on your wallet.
  24. Price : shows price over time
  25. -p, --price-in TEXT Currency in which to express the prices.
  26. Default : USD
  27. --help Show this message and exit.