Investigating Cryptocurrencies (Part II)
This is the second in a series of posts designed to show how the R programming language can be used with cryptocurrency related data sets. A number of R packages are great for analyzing stocks and bonds and similar financial instruments. These can also be applied to working with cryptocurrencies. In this post we will focus on Bitcoin.
Bitcoin has garnered enough attention that it is available through Yahoo’s finance data under the symbol BTCUSD=X. The quantmod package is comprised of a set of packages and utilities geared towards time series analysis traditionally associated with stocks. You can load Bitcoin along with other Stock symbols using the loadSymbols function. In this example we will also load AMD, which makes graphics cards used by cryptocurrency miners.
library(quantmod)
loadSymbols(c(‘BTCUSD=X’,’AMD’))
If you have any issue downloading the data, make sure you update to the latest version of quantmod. If all goes well, you will have two objects in your global environment named AMD and BTCUSD=X.
ls()
[1] “AMD” “BTCUSD=X”
You can plot AMD by simply passing it to the plot function.
plot(AMD)
Bitcoin is slightly different simply because the symbol in use includes an equal sign. To ensure that R evaluates the code properly, the symbol must be surrounded in back ticks.
plot(`BTCUSD=X`)
There is data missing for certain days. There are other sources for cryptocurrency data which can be substituted if needed. We will ignore this anomaly for the remainder of this post. There is data for the last 4 weeks. We can construct a candle chart that focuses on this subset of data.
chartSeries(`BTCUSD=X`, subset=’last 4 weeks’)
This chart can then be modified to include technical analysis – for instance Bollinger Bands.
addBBands()
The capabilities of the quantmod package in an earlier post (see http://ift.tt/2tkTADf) where a listing of other functions that can be applied is included.
Inasmuch as cryptocurrencies behave like traditional equities, they lend themselves to similar types of analysis. The quantmod package is a great place to start when analyzing cryptocurrencies.
R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...
This comment has been removed by the author.
ReplyDeleteI think this is one of the best posts on this topic. I am very happy to see your amazing post and thank you for your sharing with us. I like a more advanced level of information from your post and please keep it up...
ReplyDeleteSAS Training in Chennai
SAS Course in Chennai
Social Media Marketing Courses in Chennai
Tableau Training in Chennai
Html5 Training in Chennai
Node JS Training in Chennai
Informatica Training in Chennai
SAS Training in Adyar
SAS Training in Velachery
Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
ReplyDeleteJava Training in Chennai
Java Course in Chennai
Angularjs Training in Chennai
Selenium Training in Chennai
German Classes in Chennai
Java Training in Anna Nagar
I would like to thanks for your comprehensive article and these concepts are very helped to increase my knowledge. I hope more unique information from your post...
ReplyDeleteExcel Training in Chennai
Advanced Excel Training in Chennai
Excel Advanced course
corporate training in chennai
Embedded System Course Chennai
Linux Training in Chennai
Excel Training in Chennai
Advanced Excel Training in Chennai