Hello,
I am new to the Eviews programming language and would like write a program which calculates foreign exchange cross rates.
wfcreate FX_D d(1,5) 01/01/1980 31/12/2018
dbopen(type=Macrobond)
fetch(mb) eur jpy chf gbp sek nok aud nzd cad ' these are the rates vs the US dollar
I now would like to calculate each rate versus each other. How would I do that please? I guess one needs to use a for loop but I don't know how to start.
Thanks a lot,
Günter
FX Cross Rates Program
Moderators: EViews Gareth, EViews Jason, EViews Moderator, EViews Matt
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13309
- Joined: Tue Sep 16, 2008 5:38 pm
Re: FX Cross Rates Program
What does "calculate each rate versus each other" mean?
Follow us on Twitter @IHSEViews
Re: FX Cross Rates Program
Hi Gareth,
Something like this:
frml EURJPY = {%JPY}/{%EUR}
frml EURCAD = {%CAD}/{%EUR}
frml EURNZD = {%NZD}/{%EUR}
....
and then
frml GBPJPY = {%JPY}/{%GBP}
frml GBPCAD = {%CAD}/{%GBP}
and so on
So each series divided individually by all the other series.
Thanks a lot,
Günter
Something like this:
frml EURJPY = {%JPY}/{%EUR}
frml EURCAD = {%CAD}/{%EUR}
frml EURNZD = {%NZD}/{%EUR}
....
and then
frml GBPJPY = {%JPY}/{%GBP}
frml GBPCAD = {%CAD}/{%GBP}
and so on
So each series divided individually by all the other series.
Thanks a lot,
Günter
-
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13309
- Joined: Tue Sep 16, 2008 5:38 pm
Re: FX Cross Rates Program
Something like:
That will give you the pairs in both directions.
Code: Select all
for %i eur jpy chf gbp sek nok aud nzd cad
for %j eur jpy chf gbp sek nok aud nzd cad
if %j<>%i then
frml {%i}{%j} = {%i}/{%j}
endif
next
next
That will give you the pairs in both directions.
Follow us on Twitter @IHSEViews
Re: FX Cross Rates Program
Fantastic. Thank you very much Gareth. Best, Günter
Who is online
Users browsing this forum: No registered users and 10 guests