GetExchangeData

For questions about EViews Add-ins available from the EViews Add-ins webpage. Note each add-in available on our webpage will have its own individual thread.

Moderators: EViews Gareth, EViews Moderator, EViews Esther

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

GetExchangeData

Postby EViews Esther » Tue Feb 08, 2011 5:22 pm

This thread is about the GetExchangeData add-in that provides an easy way to download historical exchange rate data into EViews.

Even though the top 21 currencies are currently avaiable, you can add a new currency by editing the program.
In particular, when you open the program GetExchangeData.prg, you will see the following two lines:

Code: Select all

%currency_list = """US Dollar"" ""Euro"" ""Australian Dollar"" ""Brazilian Real"" ""British Pound"" ""Canadian Dollar"" ""Chinese Yuan"" ""Danish Krone"" ""Hong Kong Dollar"" ""Indian Rupee"" ""Japanese Yen"" ""Korean Won"" ""Malaysian Ringgit"" ""Mexican Peso"" ""New Zealand Dollar"" ""Norwegian Krone"" ""Singapore Dollar"" ""South African Rand"" ""Sri Lanka Rupee"" ""Swedish Krona"" ""Swiss Franc"""

%currency_code = "USD EUR AUD BRL GBP CAD CNY DKK HKD INR JPY KRW MYR MXN NZD NOK SGD ZAR LKR SEK CHF"

Now suppose that you want to download the exchange rate between the US Dollars and the Argentine Peso.
By filling the last element of %currency_list and %currency_code with "Argentine Peso" and "ARS", respectively, you can download the series of interest.

Code: Select all

%currency_list = """US Dollar"" ""Euro"" ""Australian Dollar"" ""Brazilian Real"" ""British Pound"" ""Canadian Dollar"" ""Chinese Yuan"" ""Danish Krone"" ""Hong Kong Dollar"" ""Indian Rupee"" ""Japanese Yen"" ""Korean Won"" ""Malaysian Ringgit"" ""Mexican Peso"" ""New Zealand Dollar"" ""Norwegian Krone"" ""Singapore Dollar"" ""South African Rand"" ""Sri Lanka Rupee"" ""Swedish Krona"" ""Swiss Franc"" ""Argentine Peso"""

%currency_code = "USD EUR AUD BRL GBP CAD CNY DKK HKD INR JPY KRW MYR MXN NZD NOK SGD ZAR LKR SEK CHF ARS"

*Note that "Argentine Peso" and "ARS" should be in the same order as each other.

[Change log]
    2011/02/11 Able to retrieve the data with more than 500 observations
Last edited by EViews Esther on Fri Feb 11, 2011 9:36 am, edited 1 time in total.

MantaRay
Posts: 6
Joined: Wed Apr 07, 2010 9:07 am

Re: GetExchangeData

Postby MantaRay » Thu Feb 10, 2011 1:10 am

Hi there:


It seems like to get the identical data series when the requested sample is larger than 500.

Thanks for your consideration.

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: GetExchangeData

Postby EViews Esther » Thu Feb 10, 2011 9:33 am

MantaRay wrote:It seems like to get the identical data series when the requested sample is larger than 500.

I am sorry that I do not get your question. Can you tell me more about your "identical series"?

As you know, when a currently active workfile has the series of interest (say "UDS2EUR"),
you will see the identical series with a different name (i.e. "USD2EUR01").

MantaRay
Posts: 6
Joined: Wed Apr 07, 2010 9:07 am

Re: GetExchangeData

Postby MantaRay » Thu Feb 10, 2011 11:05 pm

Hi Esther:

Eviews will obtain the FRX data series matching with the chosen currency when data numbers are no more than 500.

When data numbers equal to 501, Eviews will report the error message, Sorry, couldn't create table, because you entered incorrect dates....

When data numbers set to be more than 501, Eviews will obtain the identical series with different series name no matter which currency you choose.

In the three different time interval, for example, data numbers <500, =500 and >500 respectively, let Eviews retrieve two FRX data series, say usd2eur and usd2jpy, together in each time interval.

Both data series will be they should be when data numbers no more than 500.
It will get the mentioned error message showed in the data series when data numbers equal to 501.
Both data series will be identical when data numbers set to be more than 501.

Thanks for your patience and consideration.

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: GetExchangeData

Postby EViews Esther » Fri Feb 11, 2011 9:23 am

I fix the problem. You can reinstall the updated "GetExchangeData" add-in.

Thank you.

MantaRay
Posts: 6
Joined: Wed Apr 07, 2010 9:07 am

Re: GetExchangeData

Postby MantaRay » Fri Feb 11, 2011 10:45 am

Hi Esther:

Many thanks for your quick responses and admirable efforts.

The fixed version works like charm except for the data numbers set to be just equal to 501.

Best Regards,
MantaRay

EViews Esther
EViews Developer
Posts: 149
Joined: Fri Sep 03, 2010 7:57 am

Re: GetExchangeData

Postby EViews Esther » Fri Feb 11, 2011 11:09 am

Thank you for your valuable comments. The new version will allow you to retrieve the data with >500, including 501 observations.

MantaRay
Posts: 6
Joined: Wed Apr 07, 2010 9:07 am

Re: GetExchangeData

Postby MantaRay » Fri Feb 11, 2011 11:19 am

Hi Esther:

The attached please find the available information regarding the issue.

Regards,
Attachments
exchange.wf1
(55.29 KiB) Downloaded 908 times

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: GetExchangeData

Postby EViews Gareth » Fri Feb 11, 2011 11:20 am

Try re-downloading the add-in.
Follow us on Twitter @IHSEViews

MantaRay
Posts: 6
Joined: Wed Apr 07, 2010 9:07 am

Re: GetExchangeData

Postby MantaRay » Fri Feb 11, 2011 11:36 am

Dear Gareth:

Many many thanks for your excellent job.

The issue finally gets resolved in the second revised version.
It now works great without any problem.

Best regards,

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: GetExchangeData

Postby EViews Gareth » Fri Feb 11, 2011 11:38 am

Thank Esther not me :D

Glad to see you're getting use out of the add-in anyway.
Follow us on Twitter @IHSEViews

MantaRay
Posts: 6
Joined: Wed Apr 07, 2010 9:07 am

Re: GetExchangeData

Postby MantaRay » Fri Feb 11, 2011 11:47 am

Sure, thank both of you, Gareth and Esther. :D

statcon
Posts: 4
Joined: Mon Jul 04, 2011 12:33 am

Re: GetExchangeData

Postby statcon » Fri Aug 23, 2013 7:28 am

Hi EViews-team,

one of our customers just asked for a bug-fix in this addin. As it seems the addin fails when you want to update an exchange rate in an existing workfile. I got the feeling that something with the import command might have changed with eviews8 because getting the exchange-rates in a new workfile works for me.

Is there a solution available for the problem?

Thanks in advance!

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13306
Joined: Tue Sep 16, 2008 5:38 pm

Re: GetExchangeData

Postby EViews Gareth » Fri Aug 23, 2013 7:54 am

Could you provide more details, or, possibly, an example?
Follow us on Twitter @IHSEViews

statcon
Posts: 4
Joined: Mon Jul 04, 2011 12:33 am

Re: GetExchangeData

Postby statcon » Tue Aug 27, 2013 12:41 am

Hi Gareth,

now I was able to figure out where the problem is, but sadly not how to solve it. On my machine the addin works perfectly fine. But when running the addin with "logmode all" on our customers pc we get the following log.

setmaxerrs 100
%currency_list = """US Dollar"" ""Euro"" ""Australian Dollar"" ""Brazilian Real"" ""British Pound"" ""Canadian Dollar"" ""Chines ...
%CURRENCY_LIST successfully computed
%currency_code = "USD EUR AUD BRL GBP CAD CNY DKK HKD INR JPY KRW MYR MXN NZD NOK SGD ZAR LKR SEK CHF"
%CURRENCY_CODE successfully computed
%end = @datestr(@now,"MM/DD/YY")
%END successfully computed
%start = @datestr(@dateadd(@dateval(%end),-499,"dd"),"MM/DD/YY")
%START successfully computed
%importops = """Create new workfile"""
%IMPORTOPS successfully computed
%wfname = @wfname
%WFNAME successfully computed
IF @LEN("") THEN
!series_1 = 1
!SERIES_1 successfully computed
!series_2 = 2
!SERIES_2 successfully computed
!create = 1
!CREATE successfully computed
%wfname = "EXCHANGE"
%WFNAME successfully computed
!result = @uidialog( "text","Choose which data to fetch:", "list",!series_1, "From this currency",%currency_list, "list",!series ...
!RESULT successfully computed
IF !RESULT=-1 THEN
%currency_1 = @word(%currency_code, !series_1)
%CURRENCY_1 successfully computed
%currency_2 = @word(%currency_code, !series_2)
%CURRENCY_2 successfully computed
%name = %currency_1 + "2" +%currency_2
%NAME successfully computed
!diff = @dateval(%end) - @dateval(%start) +1
!DIFF successfully computed
IF NA > 500 THEN
%url = "http://www.oanda.com/currency/historical-rates-classic?date_fmt=us&date=" + %end + "&date1=" + %start + "&exch=" + %curr ...
%URL successfully computed
IF !CREATE= 1 THEN
wfcreate(wf=EXCHANGE, page=USD2EUR) d7 01/01/10 08/26/13
Illegal date 08/26/13 in "WFCREATE(WF=EXCHANGE, PAGE=USD2EUR) D7 01/01/10 08/26/13".
import(type=html, page=USD2EUR) http://www.oanda.com/currency/historica ... =01/01/10& ...
16373 bytes read.
Analyzing dataset: obtaining table count
Opening table...
Analyzing table: obtaining row count
1 rows counted...
Setting up the series...
Created 3 series
1 row read, 1 row used
Setting series formats...
Alpha series truncated to maximum length.

Maximum length may be changed from the Options/Alpha Truncation menu in "IMPORT(TYPE= ...

ENDIF
d(noerr) series01

Do you have any suggestions on that? Thanks in advance.


Return to “Add-in Support”

Who is online

Users browsing this forum: No registered users and 12 guests