Drawdown section
()
| 412 | figs_above_ohlc.append(fig) |
| 413 | |
| 414 | def _plot_drawdown_section(): |
| 415 | """Drawdown section""" |
| 416 | fig = new_indicator_figure(y_axis_label="Drawdown", height=80) |
| 417 | drawdown = equity_data['DrawdownPct'] |
| 418 | argmax = drawdown.idxmax() |
| 419 | source.add(drawdown, 'drawdown') |
| 420 | r = fig.line('index', 'drawdown', source=source, line_width=1.3) |
| 421 | fig.scatter(argmax, drawdown[argmax], |
| 422 | legend_label='Peak (-{:.1f}%)'.format(100 * drawdown[argmax]), |
| 423 | color='red', size=8) |
| 424 | set_tooltips(fig, [('Drawdown', '@drawdown{-0.[0]%}')], renderers=[r]) |
| 425 | fig.yaxis.formatter = NumeralTickFormatter(format="-0.[0]%") |
| 426 | return fig |
| 427 | |
| 428 | def _plot_pl_section(): |
| 429 | """Profit/Loss markers section""" |
no test coverage detected