Candlestick graph
Candlestick graphs are most commonly used by professional traders in the stock market to predict price movement based on past data. dygraph can easily plot this graph just in one line of command. Here, we are storing the last 30 days stock data to create a candlestick graph. Red bar shows down in stock and the green bar shows up in stock.
R
TSLA <- tail (TSLA, n=30) graph <- dygraph ( OHLC (TSLA)) dyCandlestick (graph) |
Output:
How to use interactive time series graph using dygraphs in R
Dygraphs refer to as Dynamic graphics which leads to an easy way to create interaction between user and graph. The dygraphs are mainly used for time-series analysis. The dygraphs package is an R interface to the dygraphs JavaScript charting library in R Programming Language.