Skip to contents

Three panels. The upper one is the volatility of every month_days-day period over the whole history, annualized, with its median and 95th percentile: where the line is now shows how rough the last month was. The middle one shows each of the last days days as a bar of its move in the standard deviations the GARCH model expected for it, red for falls and green for rises, with lines at 2 and 4 standard deviations. The lower one shows the last context_days closes and the forecast of the next days: the median close, and the ranges of the middle half and of probability level (see volatility_analysis()). Without a GARCH model only the upper panel is drawn.

Usage

plot_volatility(analysis, mode = "light", days = 90, context_days = 30)

Arguments

analysis

The result of volatility_analysis().

mode

"light" (the default) or "dark", to suit a light or dark page.

days

Days of the middle panel.

context_days

Closes before the forecast in the lower panel.

Value

A plotly object.

Examples

btc <- get_history("Bitcoin (BTC)", as.Date("2013-04-29"))
plot_volatility(volatility_analysis(btc))