plot_trade_profit_distribution#

plot_trade_profit_distribution(df, bins=25, cap_profit=1.1, vmin=-1, vmax=0.5)[source]#

Create a histogram of won and lost trades based on trade analyzer expanded timeline output.

See also tradingstrategy.analysis.tradeanalyizer.expand_timeline().

Parameters:
  • df (DataFrame) – A DataFrame with a column PnL % raw

  • cap_profit – If profit is higher than this, cap the value so that one off mega profits to not break the diagram

Return type:

Figure