Two panels over the whole history. The upper one is the
close on a log scale with the all-time high so far; the lower one is the
drawdown, how far each close is below that high (see drawdown()), with
a dashed line at min_depth percent. The falls of the analysis are shaded
from their peak to their recovery, the current one in amber, and their
troughs carry their rank, as in drawdown_table(); hover over a trough
for its dates.
Arguments
- analysis
The result of
drawdown_analysis().- mode
"light"(the default) or"dark", to suit a light or dark page.
Examples
if (FALSE) { # interactive()
spx <- get_history("S&P 500", as.Date("1950-01-01"))
plot_drawdowns(drawdown_analysis(spx))
}