Quantcast
Channel: r software hub
Viewing all articles
Browse latest Browse all 1015

Candlestick charts using Plotly and Quantmod

$
0
0

By Riddhiman

This post is dedicated to creating candlestick charts using Plotly’s R-API.

For more information on candlestick charts visit www.stockcharts.com.

We’ll also showcase Plotly’s awesome new range selector feature !

plotlyCandleStick = startdate]
  
  # Convert to dataframe
  prices  x[5]){
      mat ",
                    "High: ", round(prices$high,2),"
", "Low: ", round(prices$low,2),"
", "Open: ", round(prices$open,2),"
", "Close: ", round(prices$close,2)) # Base plot for High / Low prices p close price p End: ", format(max(prices$time), "%b-%Y")), ax = 0, ay = 0, align = "left", xref = "paper", yref = "paper", xanchor = "left", yanchor = "top", font = list(size = 10, color = fontcolor)) )) return(p) }
library(plotly)
library(quantmod)

plotlyCandleStick("TSLA")

Related

To leave a comment for the author, please follow the link and comment on their blog: R – Modern Data.

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such …read more

Source:: r-bloggers.com


Viewing all articles
Browse latest Browse all 1015

Trending Articles