Download daily metals prices from oanda.
getMetals(Metals,
from = Sys.Date() - 179,
to = Sys.Date(),
base.currency="USD",
env = parent.frame(),
verbose = FALSE,
warning = TRUE,
auto.assign = TRUE, ...)
Data will be assigned
automatically to the environment specified (the parent environment by default).
If auto.assign = FALSE
, the data from a single metal
request will simply be returned from the function call.
If auto.assign = TRUE
is used (the default)
a vector of downloaded symbol names will be returned.
See getSymbols
and getSymbols.oanda
for more detail.
metals expressed in common name or symbol form
start date expressed in ISO CCYY-MM-DD format
end date expressed in ISO CCYY-MM-DD format
which currency should the price be in
which environment should they be loaded into
be verbose
show warnings
use auto.assign
additional parameters to be passed to getSymbols.oanda method
Jeffrey A. Ryan
A convenience wrapper to getSymbols(x,src='oanda')
.
The most useful aspect of getMetals is the ability to specify the Metals in terms of underlying 3 character symbol or by name (e.g. XAU (gold) , XAG (silver), XPD (palladium), or XPT (platinum)).
There are unique aspects of any continuously traded commodity, and it is recommended that the user visit https://www.oanda.com for details on specific pricing issues.
See getSymbols
and getSymbls.oanda
for more detail.
Oanda.com https://www.oanda.com
getSymbols
, getSymbols.oanda
if (FALSE) {
getMetals(c("gold","XPD"))
getMetals("plat",from="2005-01-01")
}
Run the code above in your browser using DataLab