renko_add_corridor <- function(data, size){
require(data.table)
# add corridor
data[, corridor_bottom := size * floor(close / size)]
data[, corridor_top := corridor_bottom + size]
# add sequence group by corridor
data <- data[, head(.SD, 1), by=.(corridor_bottom, rleid(corridor_bottom))]
return(data)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.