From 4b4b315e61f4d9c7fefb72e9660dae6be3f21055 Mon Sep 17 00:00:00 2001 From: Kernc Date: Sat, 22 Feb 2020 03:03:28 +0100 Subject: [PATCH] ENH: Show number of trades on OHLC plot legend --- backtesting/_plotting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backtesting/_plotting.py b/backtesting/_plotting.py index 2d3e890..1e6a4ce 100644 --- a/backtesting/_plotting.py +++ b/backtesting/_plotting.py @@ -402,7 +402,7 @@ return this.labels[index] || ""; 'position_lines_ys') fig_ohlc.multi_line(xs='position_lines_xs', ys='position_lines_ys', source=trade_source, line_color=trades_cmap, - legend_label='Trades', + legend_label='Trades ({})'.format(len(trade_data)), line_width=8, line_alpha=1, line_dash='dotted') def _plot_indicators():