MCPcopy Index your code
hub / github.com/kernc/backtesting.py / _plot_ohlc_trades

Function _plot_ohlc_trades

backtesting/_plotting.py:518–525  ·  view source on GitHub ↗

Trade entry / exit markers on OHLC plot

()

Source from the content-addressed store, hash-verified

516 return r
517
518 def _plot_ohlc_trades():
519 """Trade entry / exit markers on OHLC plot"""
520 trade_source.add(trades[['EntryBar', 'ExitBar']].values.tolist(), 'position_lines_xs')
521 trade_source.add(trades[['EntryPrice', 'ExitPrice']].values.tolist(), 'position_lines_ys')
522 fig_ohlc.multi_line(xs='position_lines_xs', ys='position_lines_ys',
523 source=trade_source, line_color=trades_cmap,
524 legend_label=f'Trades ({len(trades)})',
525 line_width=8, line_alpha=1, line_dash='dotted')
526
527 def _plot_indicators():
528 """Strategy indicators"""

Callers 1

plotFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected