Skip to content

Commit 886fc1d

Browse files
committed
ENH: Plot: Make "OHLC" a togglable legend item
1 parent a78edf5 commit 886fc1d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

backtesting/_plotting.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -505,9 +505,10 @@ def _plot_superimposed_ohlc():
505505

506506
def _plot_ohlc():
507507
"""Main OHLC bars"""
508-
fig_ohlc.segment('index', 'High', 'index', 'Low', source=source, color="black")
508+
fig_ohlc.segment('index', 'High', 'index', 'Low', source=source, color="black",
509+
legend_label='OHLC')
509510
r = fig_ohlc.vbar('index', BAR_WIDTH, 'Open', 'Close', source=source,
510-
line_color="black", fill_color=inc_cmap)
511+
line_color="black", fill_color=inc_cmap, legend_label='OHLC')
511512
return r
512513

513514
def _plot_ohlc_trades():

0 commit comments

Comments
 (0)