HIP-10 [DG] External analysis and visualisation tool for hummingbot client

Author: jamesPmagic 0x4eF

Original Post Date: 9 Jun 2022

Snapshot Proposal Link

Summary:

Script to visualise and analyse performance of high-frequency crypto trading bots using Hummingbot

Linked HGP:

https://snapshot.org/#/hbot.eth/proposal/0x649beb18fc251ba2be18b76612e5ce1a29a1be96b41bdd31ec3a045b79512821

Snapshot proposal (approved):

https://snapshot.org/#/hbot-ip.eth/proposal/0xd917721c8250a504b659cfc9f515e83c6767741bd0196d1b9b1c2060461a3013

The tool is available at this link:

Description:

This is a python script for studying and visualising the performance of HB bots.

To use the script, provide the following inputs [examples in brackets]:

  • Exchange [ascendex / binance / kucoin / gate / ftx / any other exchange supported by ccxt]
  • Trading pair [BTC/USDT]
  • Start time for the analysis in the format datetime(Year, Month, Day, Hour, Minute, Second) [datetime(2022, 6, 17, 4, 0, 00)]
  • Path where trades data is stored for the bot you are analysing (/Users/xxx/hummingbot_data/trades.csv)
  • Fees percent (0.2)

The script does the following:

  • Calculates a suitable candlestick interval based on the time elapsed between Start Time and Current Time.
  • Fetches candlestick data for the Exchange and Trading Pair provided from ccxt (CCXT — ccxt 1.90.35 documentation)
  • Fetches trade data for the interval between Start Time and Current Time from the bot’s trades.csv file.
  • Makes a plot that shows the high and low of all candles, along with all buy and sell trades.
  • Calculates the following data for printing:
    • Market change percentage
    • Number of buy trades
    • Number of sell trades
    • Average buy price
    • Average sell price
    • Average spread
    • Fees paid (in quote)
    • Trade PNL after fees (in quote)
    • Trade volume (in quote)
    • Change in base asset
    • PNL as percentage of trade volume

Sample run is shown below: