k_rrenko is an in-development R package to build Ranko plots and tables.
Just copy and paste the code.
https://github.com/Kinzel/k_rrenko/blob/master/Renko.R
krenko_plot(Ativo, size, threshold, withDates)
- Ativo = a xts with close price
- size = the size of the renko bricks (no default)
- threshold = threshold size of trend brick (default = 1)
library(xts)
library(data.table)
library(ggplot2)
set.seed(10)
data <- xts(x=abs(cumsum(rnorm(250))), order.by=as.POSIXct(Sys.Date()+1:250), born=as.POSIXct("1899-05-08"))
krenko_plot(data, 1,withDates = F)
Gaps in xts will create abnormal bricks in the plot. The first brick of the above plot is a example - there is a jump. Plot work perfectly in smooth continuous time-series. The table (krenko) is not affected.
- Bug fixes.
- Working fine.
- Experimental use only.