4

Is there a function that can return the list of all symbols I can access using getSymbols function from quantmod? I am interested in the downloadable CFDs symbol list for src = 'oanda'.

Thanks, Vladimir

1 Answers1

4

Try

library(quantmod)
values <- oanda.currencies
#> head(values)
#    oanda.df.1.length.oanda.df...2....1.
#USD                            US Dollar
#AFN                  Afghanistan Afghani
#ALL                         Albanian Lek
#DZD                       Algerian Dinar
#ADF                       Andorran Franc
#ADP                      Andorran Peseta

This yields a data frame with one column containing a total of 191 currencies that are available from src="oanda".

The symbols are stored as row names:

#> rownames(values)
#  [1] "USD" "AFN" "ALL" "DZD" "ADF" "ADP" "AOA" "AON" "ARS" "AMD" "AWG" "AUD" "ATS" "AZM" "AZN" "BSD" "BHD" "BDT"
# [19] "BBD" "BYR" "BEF" "BZD" "BMD" "BTN" "BOB" "BAM" "BWP" "BRL" "GBP" "BND" "BGN" "BIF" "XOF" "XAF" "XPF" "KHR"
# [37] "CAD" "CVE" "KYD" "CLP" "CNY" "COP" "KMF" "CDF" "CRC" "HRK" "CUC" "CUP" "CYP" "CZK" "DKK" "DJF" "DOP" "NLG"
# [55] "XEU" "XCD" "ECS" "EGP" "SVC" "EEK" "ETB" "EUR" "FKP" "FJD" "FIM" "FRF" "GMD" "GEL" "DEM" "GHC" "GHS" "GIP"
# [73] "XAU" "GRD" "GTQ" "GNF" "GYD" "HTG" "HNL" "HKD" "HUF" "ISK" "INR" "IDR" "IRR" "IQD" "IEP" "ILS" "ITL" "JMD"
# [91] "JPY" "JOD" "KZT" "KES" "KWD" "KGS" "LAK" "LVL" "LBP" "LSL" "LRD" "LYD" "LTL" "LUF" "MOP" "MKD" "MGA" "MGF"
#[109] "MWK" "MYR" "MVR" "MTL" "MRO" "MUR" "MXN" "MDL" "MNT" "MAD" "MZM" "MZN" "MMK" "ANG" "NAD" "NPR" "NZD" "NIO"
#[127] "NGN" "KPW" "NOK" "OMR" "PKR" "XPD" "PAB" "PGK" "PYG" "PEN" "PHP" "XPT" "PLN" "PTE" "QAR" "ROL" "RON" "RUB"
#[145] "RWF" "WST" "STD" "SAR" "RSD" "SCR" "SLL" "XAG" "SGD" "SKK" "SIT" "SBD" "SOS" "ZAR" "KRW" "ESP" "LKR" "SHP"
#[163] "SDD" "SDP" "SDG" "SRD" "SRG" "SZL" "SEK" "CHF" "SYP" "TWD" "TZS" "THB" "TOP" "TTD" "TND" "TRL" "TRY" "TMM"
#[181] "UGX" "UAH" "UYU" "AED" "VUV" "VEB" "VND" "YER" "YUN" "ZMK" "ZWD"
RHertel
  • 23,412
  • 5
  • 38
  • 64
  • Hi, thanks for a prompt response. Can I get the list of CFDs as well? – Volodymyr Kruglov Jun 24 '15 at 12:54
  • I don't think so. CFDs are traded only in a few countries. I suspect that one has to check their availability from various brokers (in the countries where CFDs aren't banned). – RHertel Jun 24 '15 at 12:56
  • I can see the Oanda traded CFDs but for most of them I cannot quess what their names are in getSymbols.oanda – Volodymyr Kruglov Jun 24 '15 at 13:00
  • 1
    Thanks. It is unfortunate CFDs are not available through the getSymbols.oanda but what can you do. – Volodymyr Kruglov Jun 24 '15 at 13:14
  • FWIW, that list hasn't been updated [since 2007](https://github.com/joshuaulrich/quantmod/blob/7c02e40f0a61029bba8a4f71fd0d81f33fe75775/R/oanda.R) even though the list of instruments that Oanda actually supports probably has. There's probably a way to pull the list of instruments from their API (I know there is if you authenticate) – GSee Jun 24 '15 at 13:42
  • I will leave this as unanswered, maybe there is a chance some historical data for CFDs is available for download through Oanda – Volodymyr Kruglov Jun 24 '15 at 13:45
  • @VolodymyrKruglov Best way to thank me is to vote my answer up, if you found it helpful - or to accept it, unless you want to wait for other answers ;) – RHertel Jun 24 '15 at 16:46
  • @RHertel, I would like to see if there are any further answers. If not, I will surely do :) – Volodymyr Kruglov Jun 24 '15 at 22:17