Trade entry / exit markers on OHLC plot
()
| 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""" |