Unable to return currency data for a specific date or period with yahoo

1 vue (au cours des 30 derniers jours)
Erik
Erik le 12 Août 2014
hello!
I am unable to return currency (e.g. EURUSD=X) data for a specific date or period with yahoo. It works for stocks (e.g. IBM).
Any ideas what is going on? Help much appreciated.
>> fetch(yahoo,'EURUSD=X','03-Jun-2014') Error using yahoo/fetch (line 314) Unable to return data for given security and date.
>> fetch(yahoo,'IBM','03-Jun-2014')
ans =
1.0e+06 *
0.7358 0.0002 0.0002 0.0002 0.0002 2.5171 0.0002
Cheers!

Réponses (1)

Supreeth Subbaraya
Supreeth Subbaraya le 14 Août 2014
Modifié(e) : Supreeth Subbaraya le 14 Août 2014
You can only access the present currency data using the yahoo fetch command.
fetch(yahoo,'EURUSD=X');
This returns the fields as shown below
Symbol: {'EURUSD=X'}
Last: 1.3366
Date: 735825
Time: 0.6931
Change: NaN
Open: NaN
High: NaN
Low: NaN
Volume: NaN
Apart from that there is no feature currently to obtain the data from previous dates.
Instead you can use other service providers from the Datafeed Toolbox to obtain historical currency data.
For example, the FRED data server from the Federal Reserve offers free historical currency exchange data for some currencies. The following website lists the daily exchange rates available from the FRED server:
You can obtain the data for June 3 using the following lines of code:
>> connect = fred;
>> d = fetch(connect, 'DEXUSEU', '06/3/2014')
d =
Title: ' U.S. / Euro Foreign Exchange Rate'
SeriesID: ' DEXUSEU'
Source: ' Board of Governors of the Federal Reserve System'
Release: ' H.10 Foreign Exchange Rates'
SeasonalAdjustment: ' Not Seasonally Adjusted'
Frequency: ' Daily'
Units: ' U.S. Dollars to One Euro'
DateRange: ' 1999-01-04 to 2014-08-08'
LastUpdated: ' 2014-08-11 3:46 PM CDT'
Notes: ' Noon buying rates in New York City for cable transfers payable in foreign currencies.'
Data: [735812 1.3436]
You can access the currency from the Data field in the structure

Catégories

En savoir plus sur Financial Data dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by