chart {cryptoQuotes} | R Documentation |
Build interactive financial charts
Description
chart()
creates interactive financial charts using plotly::plot_ly()
as backend. It's a high-level function which collects
and structures the passed chart elements.
Usage
chart(
ticker,
main = kline(),
sub = list(volume()),
indicator = list(bollinger_bands()),
event_data = NULL,
options = list()
)
Arguments
ticker |
A |
main |
A |
sub |
An optional list of |
indicator |
An optional list of |
event_data |
An optional data.frame with event line(s) to be added to the |
options |
Details
Options
-
dark
A logical-value of length 1. TRUE by default. Sets the overall theme of thechart()
-
slider
A logical-value of length 1. FALSE by default. If TRUE, aplotly::rangeslider()
is added. -
deficiency
A logical-value of length 1. FALSE by default. If TRUE, allchart()
-elements are colorblind friendly -
size
A numeric-value of length 1. The relative size of the main chart. 0.6 by default. Must be between 0 and 1, non-inclusive.
Value
Returns a plotly::plot_ly()
object.
Author(s)
Serkan Korkmaz
See Also
Other chart indicators:
add_event()
,
alma()
,
bollinger_bands()
,
dema()
,
ema()
,
evwma()
,
fgi()
,
hma()
,
lsr()
,
macd()
,
rsi()
,
sma()
,
volume()
,
vwap()
,
wma()
,
zlema()
Other price charts:
kline()
,
ohlc()
Examples
# script: scr_charting
# date: 2023-10-25
# author: Serkan Korkmaz, serkor1@duck.com
# objective: Charting in general
# script start;
## charting the klines
## with indicators as
## subcharts
chart(
ticker = BTC,
main = kline(),
sub = list(
volume(),
macd()
),
indicator = list(
bollinger_bands(),
sma(),
alma()
),
options = list(
dark = TRUE,
deficiency = FALSE
)
)
## charting the MACD-indicator
## with klines as subcharts
chart(
ticker = BTC,
main = macd(),
sub = list(
volume(),
kline()
),
indicator = list(
bollinger_bands(),
sma()
),
options = list(
dark = TRUE,
deficiency = FALSE
)
)
# script end;