candle_chart: Function for plotting beautiful candle-charts in ggplot

Description Usage Arguments Details Examples

View source: R/candle-chart.R

Description

Function for plotting beautiful candle-charts in ggplot

Usage

1
2
3
4
candle_chart(data, na.rm = FALSE, title = NULL, sub.title = NULL,
  y.title = NULL, x.title = NULL, x.interval = NULL, lwd = 0.2,
  bar.width = 1, dc.lines = "both", dc.window = 10,
  output.length = NULL, ...)

Arguments

data

data frame containing data for plotting

na.rm

a logical indicating whether NA values should be stripped before plotting

title

character string specifying chart title

sub.title

character string specifying chart sub title

y.title

character string specifying y-axis title

x.title

character string specifying x-axis title

x.interval

numeric used to set number of breaks when scaling the x variable

dc.lines

character specifying if "both", "none", the "high", or the "low" Donchian channel line should be used

dc.window

integer specifying the with of the time window used in the Donchian channel calculation

output.length

integer. Specifying the number of output observations

Details

No further comments...

Examples

1
2
3
4
5
n <- 30
data <- data.frame(open = rnorm(n), high = rnorm(n)+1, low = rnorm(n)-1, close = rnorm(n))
rownames(data) <- Sys.Date() + 1:n
candle_chart(data, na.rm = T, title = "Example of candle-chart - might look funny due to random numbers",
             sub.title = NULL, y.title = "prices", dc.lines = "both", base.size = 14, x.interval = 5)

pgarnry/ggplotHelper documentation built on May 25, 2019, 2:54 a.m.