[R-SIG-Finance] Commodity prices
G See
gsee000 at gmail.com
Thu Mar 8 03:08:22 CET 2012
Look in the FinancialInstrument package in the directory
FinancialInstrument/inst/parser the following files:
download.tblox.R
download.pitrader.R
download.goldPrices.R
https://r-forge.r-project.org/scm/viewvc.php/pkg/FinancialInstrument/inst/parser/?root=blotter
Below is an example of getting "CL" and "GC" data from tradingblox.com
Garrett
> source("http://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/FinancialInstrument/inst/parser/download.tblox.R?root=blotter")
> getSymbols(c("CL", "GC"), src='tblox')
trying URL 'http://www.tradingblox.com/Data/DataOnly.zip'
Content type 'application/zip' length 3865871 bytes (3.7 Mb)
opened URL
==================================================
downloaded 3.7 Mb
[1] "CL" "GC"
> tail(CL)
CL.Adj.Open CL.Adj.High CL.Adj.Low CL.Adj.Close CL.Volume CL.OpInt
2012-02-28 109.17 109.45 107.15 107.49 614103 1517833
2012-02-29 107.54 108.39 105.71 107.86 691115 1543447
2012-03-01 107.77 110.25 107.10 109.19 864500 1563716
2012-03-02 109.17 109.30 106.83 107.71 625949 1559219
2012-03-05 107.42 108.19 106.32 107.83 511740 1560593
2012-03-06 108.10 108.10 106.13 106.44 737509 1560593
CL.ExpMth CL.Unadj.Close
2012-02-28 201212 107.49
2012-02-29 201212 107.86
2012-03-01 201212 109.19
2012-03-02 201212 107.71
2012-03-05 201212 107.83
2012-03-06 201212 106.44
> tail(GC)
GC.Adj.Open GC.Adj.High GC.Adj.Low GC.Adj.Close GC.Volume GC.OpInt
2012-02-28 1770.2 1792.7 1767.0 1788.4 172415 479044
2012-02-29 1786.2 1792.3 1688.4 1711.3 366754 461741
2012-03-01 1695.6 1727.3 1695.1 1722.2 259338 456944
2012-03-02 1719.7 1725.4 1705.4 1709.8 163519 446068
2012-03-05 1712.4 1718.0 1694.4 1703.9 176224 444415
2012-03-06 1707.4 1709.8 1663.4 1672.1 251061 444415
GC.ExpMth GC.Unadj.Close
2012-02-28 201204 1788.4
2012-02-29 201204 1711.3
2012-03-01 201204 1722.2
2012-03-02 201204 1709.8
2012-03-05 201204 1703.9
2012-03-06 201204 1672.1
>
On Wed, Mar 7, 2012 at 7:58 PM, Belmont <belmont.lounge at yahoo.com> wrote:
> Is anyone aware of a free source for commodity prices that can be downloaded through R (e.g. from Yahoo! or FRED)? In particular, I'm hoping to get Crude and Gold.
>
> [[alternative HTML version deleted]]
>
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
More information about the R-SIG-Finance
mailing list