Last chance! 50% off unlimited learning
Sale ends in
vwap(x, units, trunc_ceiling = "trunc")
amount==0
(normally should not happened) should be filtered before passing the tick data to the function.
suppressPackageStartupMessages(library(dwtools))
# populate tick data
suppressPackageStartupMessages(library(Rbitcoin))
tick = market.api.process("hitbtc",c("BTC","USD"),"trades")[["trades"]]
print(tick)
# ohlc + vwap
DT = vwap(tick, "30 mins")
print(DT)
# same with timing
DT = timing(vwap(tick, "30 mins"), nrow(tick))
get.timing()
# ohlc + vwap, aggregate using ceiling
DT = vwap(tick, "30 mins", "ceiling")
print(DT)
Run the code above in your browser using DataLab