Open N0talent opened 4 years ago
This works
AAPL <- tq_get("AAPL", from = "2019-09-01")
AAPL %>% ggplot(aes(x = date, y = close)) +
geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
geom_ma(color = "darkgreen") +
coord_x_date(xlim = c(today() - weeks(8), today()))
geom_candlestick
seems to produce a barplot with a datetime
as the x-axis.
The example with AAPL above does work, but stops working if you convert the x-axis to a datetime.
Reprex:
library(tidyquant)
library(dplyr)
library(ggplot2)
AAPL <- tq_get("AAPL", from = "2020-09-01")
#> Warning: `type_convert()` only converts columns of type 'character'.
#> - `df` has no columns of type 'character'
AAPL %>%
mutate(date = lubridate::as_datetime(date)) %>%
ggplot2::ggplot(aes(x = date, y = close)) +
geom_candlestick(aes(open = open, high = high, low = low, close = close)) +
coord_x_datetime(xlim = c(today() - weeks(8), today()))
Created on 2021-09-24 by the reprex package (v2.0.0)
Hello tidy quant!!
I'm having an issues plotting geom_barchart / geom_candlestick function. Using a Simple code to Test the plot, I plot a barchart but there is no difference in width for the shadow and body.
Code:
Plot:
Im i missing some dependencies? Thank you in advance!