peRm R group. Review of packages for r for market data downloading and analysis

2,128 views

Published on

Published in: Economy & Finance
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,128
On SlideShare
0
From Embeds
0
Number of Embeds
1,074
Actions
Shares
0
Downloads
8
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

peRm R group. Review of packages for r for market data downloading and analysis

  1. 1. Arbuzov Vyacheslav Review of packages for R for market data downloading1
  2. 2. What is R? There is more than 4300 packages that allow to use  R is statistical and graphical specialized statistical programming environment techniques, graphical devices, import/export capabilities, reporting tools, etc. Appeared in 1993 and designed by Ross Ihaka and Robert Gentleman  R is a GNU project R – a free implementation of the S language  It runs on a variety of platforms including Windows, Unix and MacOS  It contains advanced statistical routines not yet available in other packages 2
  3. 3. Information from 59 exchanges (http://finance.yahoo.com/e xchanges)3
  4. 4. Information from 35 exchanges (http://www.google.com/goo glefinance/disclaimer/)4
  5. 5. FOREX: • 191 currencys • 36000 currency pairs5
  6. 6. Package quantmod Package tseriesgetSymbols("GOOG",src="yahoo", get.hist.quotefrom = "2007-01-01“, to = (instrument="AAPL“,Sys.Date()) provider = "yahoo")getSymbols.google(MSFT,verbose=TRUE)getSymbols("USD/EUR",src="oanda") 6
  7. 7. Package quantmod getSymbols(CPIAUCNS,src=FRED‘) 55 000 economic timeseries from 45 databases 7
  8. 8. 8
  9. 9. Russian market: • Stock • Bond • derivatives • others9
  10. 10. install.packages("rusquant", repos="http://R-Forge.R-project.org") install.packages("rusquant", contriburl="http://r-forge.r-project.org/bin/windows/contrib/latest/") getSymbols("SPFB.RTS", from="2011-01-01", src="Finam“, period="hour") 1min, 5min, 10min, 15min, 30min, hour, day, week, month 10
  11. 11. 100 million time series from different datasources: http://datamarket.com/• Eurostat,• World Bank• UN 11
  12. 12. Package rdatamarketdmlist("http://datamarket.com/data/set/1loo/#!display=line&ds=1loo!1n6s=2eu&e=-ag9")dminfo("http://datamarket.com/data/set/1loo/#!display=line&ds=1loo!1n6s=2eu&e=-ag9") 12
  13. 13. Morningstar provides data on more than 385,000 investment offerings,including stocks, mutual funds, and similar vehicles, along with real -timeglobal market data on more than 8 million equities, indexes, futures,options, commodities, and precious metals, in addition to foreignexchange and Treasury markets 13
  14. 14. One of the leading providers of financial informationinstall.packages("RBloomberg", repos ="http://r.findata.org")conn <- blpConnect() 14
  15. 15. Package twitteRsearchTwitter("#rstats", n=300)searchTwitter("patriots", geocode=’42.375,-71.1061111,10mi’)searchTwitter("trading", since="2012-10-01", until="2012-10-02")->ttwListToDF(t)getTrends("daily") 15
  16. 16. Package rfishbase16
  17. 17. Data in the packages data(package = "ggplot2") data(msleep, package = "ggplot2")17
  18. 18. Package ggplot2 http://www.diamondse.info ~ 54 000 round diamonds with characteristics:• carat• colour• clarity• total depth• width• height• price18
  19. 19. Package ggplot2Full information about 38 popular cars from1999 to 2008 data(mpg, package = "ggplot2") 19
  20. 20. Package ggplot2US economic time series from 1967 to 2007 г. data(economics , package = "ggplot2") 20
  21. 21. Package datasets~ 1000 Earthquakes off Fiji since1964 year data(quakes, package = "datasets") 21
  22. 22. Package datasetsDistances Between data(eurodist, package = "datasets") European Cities 22
  23. 23. download.file help(download.file )23
  24. 24. Quantmod getSymbols("AAPL",src="yahoo")barChart(AAPL) candleChart(AAPL,multi.col=TRUE,theme="white") chartSeries(AAPL,up.col=white,dn.col=blue) addMACD() addBBands() to.weekly(AAPL) to.monthly(AAPL) dailyReturn(AAPL) weeklyReturn(AAPL) monthlyReturn(AAPL) 24
  25. 25. BEFORE: you think R like25 “Swiss Army Knife”
  26. 26. AFTER: R really like this:26

×