First you load the data from the package

library(mladv)
data(SSI_data)
head(SSI_data,3)

With the data_set, we can convert the raw market data into different bars such as time bars or volume bars as examples below with SSI_data

volume6000 <- volumebarr(SSI_data, 15000)
head(volume6000)
minute_bar <- timebar(SSI_data, "minute")
head(minute_bar)

We can still use functions from popular packages such as quantmod or ggplot2 with the return data.frame

library(xts)
library(quantmod)
minute_plot <- xts(minute_bar[,2:6], order.by=minute_bar$Date)
candleChart(minute_plot, theme="white", multi.col=T, name="Minute bar chart")

"He who gives up [code] safety for [code] speed deserves neither." (via)



thanhuwe8/mladv documentation built on June 9, 2019, 9:26 p.m.