Skip to content
All library documents

Hummingbot History: Calculating Portfolio Value and Trading P&L

Article SuperMind

Summary

This documentation explains how Hummingbot’s history command summarizes trading activity, asset inventory, pair prices, fees, and performance. It defines average execution price as total quote volume divided by total base volume, then compares the current portfolio value with a hypothetical hold value based on the starting assets and the current market price. Their difference is trade P&L; adding fees gives total P&L, and dividing by hold value produces a return percentage.

A sample output illustrates these calculations for one trading pair, including trade counts, asset changes, and a negative return. The example is explanatory rather than evidence of a general strategy outcome. The page also notes that the displayed return can differ from the client’s bottom navigation figure because the history calculation incorporates price changes. Its figures depend on the chosen valuation price, start and current inventories, trade records, and fee accounting.

Key ideas

  • The history command reports trades, asset balances, pair prices, fees, and portfolio performance.
  • Average price is calculated from total quote volume divided by total base volume.
  • Trade P&L compares the current portfolio value with the value of holding the starting inventory.
  • Total P&L includes fees, and return is measured against hold portfolio value.
  • The displayed return may differ between the history command and the client interface because their calculations differ.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.