@@ -150,6 +150,7 @@ def plot(*, results: pd.Series,
150
150
plot_volume = True , plot_drawdown = False ,
151
151
smooth_equity = False , relative_equity = True ,
152
152
superimpose = True , resample = True ,
153
+ reverse_indicators = True ,
153
154
show_legend = True , open_browser = True ):
154
155
"""
155
156
Like much of GUI code everywhere, this is a mess.
@@ -494,6 +495,7 @@ def __eq__(self, other):
494
495
return self is other
495
496
496
497
ohlc_colors = colorgen ()
498
+ indicator_figs = []
497
499
498
500
for i , value in enumerate (indicators ):
499
501
value = np .atleast_2d (value )
@@ -509,7 +511,7 @@ def __eq__(self, other):
509
511
fig = fig_ohlc
510
512
else :
511
513
fig = new_indicator_figure ()
512
- figs_below_ohlc .append (fig )
514
+ indicator_figs .append (fig )
513
515
tooltips = []
514
516
colors = value ._opts ['color' ]
515
517
colors = colors and cycle (_as_list (colors )) or (
@@ -562,6 +564,7 @@ def __eq__(self, other):
562
564
# have the legend only contain text without the glyph
563
565
if len (value ) == 1 :
564
566
fig .legend .glyph_width = 0
567
+ return indicator_figs
565
568
566
569
# Construct figure ...
567
570
@@ -583,7 +586,10 @@ def __eq__(self, other):
583
586
584
587
ohlc_bars = _plot_ohlc ()
585
588
_plot_ohlc_trades ()
586
- _plot_indicators ()
589
+ indicator_figs = _plot_indicators ()
590
+ if reverse_indicators :
591
+ indicator_figs = indicator_figs [::- 1 ]
592
+ figs_below_ohlc .extend (indicator_figs )
587
593
588
594
set_tooltips (fig_ohlc , ohlc_tooltips , vline = True , renderers = [ohlc_bars ])
589
595
0 commit comments