library(RCurl)
library(plotly)
url_bitstamp <- "http://www.quandl.com/api/v1/datasets/BCHARTS/BITSTAMPUSD.csv?rows=14"
data <- getURL(url_bitstamp, ssl.verifypeer=0L, followlocation=1L)
csv_bitstamp <- read.csv(text=data)
csv_bitstamp$Date <- as.Date(as.character(csv_bitstamp$Date))
p <- plot_ly(csv_bitstamp, x = ~Date[1:14], y = ~Close[1:14], type = "scatter",
mode = "lines", showlegend = TRUE, name = "BTC Closing Price") %>%
add_trace(y = ~High[1:14], type="scatter", mode="lines", fill = "tonexty",
fillcolor = "rgba(0,100,80,0.2)", line = list(color="transparent"),
showlegend = TRUE, name="Day High") %>%
add_trace(y = ~Low[1:14], type="scatter", mode="lines", fill = "tonexty",
fillcolor = "rgba(0,80,80,0.2)", line = list(color="transparent"),
showlegend = TRUE, name="Day Low") %>%
layout(xaxis = list(title="Date"), yaxis = list(title="BTC/USD"))