trade_analyser#

tradeexecutor.analysis.trade_analyser module.

Module description#

Analyze the trade performance of algorithm.

Calculate success/fail rate of trades and plot success distribution.

Example analysis include:

  • Table: Summary of all trades

  • Graph: Trade won/lost distribution

  • Timeline: Analysis of each individual trades made

Note

A lot of this code has been lifted off from trading-strategy package where it had to deal with different trading frameworks. It could be simplified greatly now.

Classes#

AssetTradeHistory

How a particular asset traded.

SpotTrade

Track spot trades to construct position performance.

TradeAnalysis

Analysis of trades in a portfolio.

TradePosition

How a particular asset traded.

TradeSummary

Some generic statistics over all the trades

Functions#

build_trade_analysis(portfolio)

Build a trade analysis from list of positions.

expand_timeline(exchanges, pair_universe, ...)

Expand trade history timeline to human readable table.