Skip to content

BalanceReport

Amargedon edited this page Nov 3, 2023 · 3 revisions

BalanceReport bot helper named balancereport.py

Type = account management

What does it do?

A script which examins the connected exchanges, bots and deals on your account. Based on al this data, an overview is generated of funds in use and the amount available.

How does it work?

Summarized this script will examin the connected exchanges which are active on your configured account. For each exchange, the data of bots which have still active deals is fetched. Based on this data:

  • the current used amount of funds is calculated. This calculation is using the BO, SO, and SO Volume and Size of the active deal(s).
  • the maximum amount of funds is calculated. This calculation is using the configured BO, SO, and SO Volume and Size in the bot. The script does take into account that for a bot with a maximum of 8 deals and currently 6 active, the configuration could have changed in between. That's why for the 6 active deals the data of the deals is used, and for the 2 remaining deals the configuration of the bot is used.

The script does also take the difference between long and short deals into account. For long deals the fund usage is calculated as described above. For short deals the funds currently used (sold amount) are required later on to buy back the original coin, so these funds must still be available and are substracted from the free amount of funds.

So, based on al this data this script will create an overview per exchange with the total amount and free amount of funds for the following assets:

  • stable/fiat: BUSD, EUR, USD, USDT
  • coins: BNB, BTC, ETH

This data serves multiple purposes:

  1. Give an overview how much risk you are taking. It's always good to have some funds on the sideline for deals which have all there SO's filled and require extra funds in order to close them later.
  2. Help you to determine if you can run that extra bot you want with the required funds, or if the number of deals or BO/SO settings can be changed on a running bot.
  3. Overview and information about your funds and profits.

Configuration

The configuration file for balancereport has the following settings:

  • timezone - timezone. (default is 'Europe/Amsterdam')
  • timeinterval - update timeinterval in Seconds. (default is 3600)
  • debug - set to true to enable debug logging to file. (default is False)
  • logrotate - number of days to keep logs. (default = 7)
  • 3c-apikey - your 3Commas API key value.
  • 3c-apisecret - your 3Commas API key secret value.
  • 3c-apikey-path - path to your own generated RSA private key, or empty.
  • notifications - set to true to enable notifications. (default = False)
  • notify-urls - one or a list of apprise notify urls, each in " " seperated with commas. See Apprise website for more information.
  • conditional-botids - a list of bot id's separated with commas. Bot(s) can be enabled and disabled by the BotUpdater script, or you, and when disabled the required funds are not included in the overview. In order to make sure these funds are included the id of the bot(s) can be added to this list.

Example: (keys are bogus)

[settings]
timezone = Europe/Amsterdam
timeinterval = 86400
debug = False
logrotate = 7
3c-apikey = 4mzhnpio6la4h1158ylt2
3c-apisecret = 4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt4mzhnpio6la4h1158ylt
3c-apikey-path = 
notifications = True
notify-urls = [ "tgram://9995888120:BoJPor6opeHyxx5VVZPX-BoJPor6opeHyxx5VVZPX/" ]
conditional-botids = [12345, 67890]

Example output

BalanceReport