## Backtesting a forex portfolio

TK
Roundtable Knight
Posts: 167
Joined: Tue Apr 15, 2003 5:45 pm

### Backtesting a forex portfolio

Hi,

Suppose, we would like to test a system on a portfolio consisting of two forex markets: EUR/USD and USD/JPY. The problem is that the two markets are denominated in two different currencies. I wonder if you could convert USD/JPY into JPY/USD so that all the statistics were calculated and expressed in dollars? I wonder if it is a valid method to use and what the proper conversion should look like. Or maybe there is some other solution?

Any ideas will be appreciated. Thanks.
Last edited by TK on Thu Apr 08, 2010 10:45 am, edited 1 time in total.

damian
Roundtable Knight
Posts: 815
Joined: Tue Apr 15, 2003 8:43 pm
Location: dusseldorf
that is what I would do... just invert the quote to get both pairs in dollar terms. Obviously you will get annoyingly small numbers when you invert the USDJPY price, but youi can multiply the result by 100 to get a nicer decimal.

Jim Wells
Contributor
Posts: 3
Joined: Sat May 17, 2003 5:20 pm

### Money management with different currencies

I'm working my way through a similar problem here. I had written some software a good while back to trade stocks and the money management worked like so (example is for long trades only):

Code: Select all

``````\$max_risk_per_trade = .025; #never lose more than 2.5% per trade
\$risk_in_trade = \$entry_price - \$sell_stop; #percent decline to hit stop
\$shares_to_buy = (\$coefficient * \$equity) / \$entry_price;
``````
So for example, if I were to enter at \$100 and the system says place the initial stop at \$95, \$max_risk_per_trade / \$risk_in_trade whould be .025 / .05, so \$coefficient would be 0.5. If the value of my account were 1000, then \$shares_to_buy would be (0.5 * 1000) / 100, or 5 shares.

Now I'm trying to get the same software to track forex, trading crossrates through oanda. In the case of pairs like EUR/USD, the system above works fine. However, I'm somewhat stuck on what to do with signals to buy other types of pairs, such as AUD/JPY where the price of the instrument is not denominated in dollars. Can any forex experts help me out here?

Jim

damian
Roundtable Knight
Posts: 815
Joined: Tue Apr 15, 2003 8:43 pm
Location: dusseldorf
Hi Jim,

(I am not an FX expert)

You can just use \$equity converted (not literally, just on paper) to the terms currency of the currency pair that you are trading. In this case you take your USD \$equity and find the JPY equivalent then use that in your position sizing formula. You would then have your equity expressed in the same base currency in which the commodity (AUD) is quoted, that being JPY.

Problem with this is that all other things being equal, except the exchange rate, you will never be able to have equal (volatility) risk on each AUDJPY trade as if USDJPY changes you will find yourself with perhaps heaps more JPY equivalent \$equity than you had available for the last trade. You will risk 2.5% of this amount and the dollar amount at stake will be greater.... even though your actual USD equity base has not changed.

Jim Wells
Contributor
Posts: 3
Joined: Sat May 17, 2003 5:20 pm
Damian,

Thanks. The approach you describe is what I've elected to use, despite the problem you mention. It turned out that the routine in my software to determine my equity in the other currency was a mess and I was stumped on the math, which I was pretty sure was correct, when my coding was the problem. Again, thanks. It's always rewarding to learn from the posts in these forums.

Jim

Vince
Roundtable Fellow
Posts: 61
Joined: Wed Jun 11, 2003 12:40 pm

### Conversion

If you have an FXCM.com account, then all currency pairs are in dollars. They have a spreadsheet for calculating pip prices. Email caitlin@fxcm.com for the spreadsheet.

andysg
Contributor
Posts: 1
Joined: Wed Aug 18, 2004 1:18 am

### backtesting forex portfolio

It claims to calculate trading results in % term.
If so, it could perhaps assist in analysing forex portfolios, as results in % terms can be translated back to US\$.

Has anybody tried this software, or could give an opinion on this?

Regrds

Forum Mgmnt
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:
The latest VeriTrader 1.6 which has been released for about a month is shipping with forex trading specific features, it hasn't been announced on our main page yet, but has been announced here in the forums. It supports forex currency conversions to dollars on trade entry, for intra-trade position equity calculations, and on trade exit..

It also can account for the interet rate differential between the currency pairs.

- Forum Mgmnt

Moodaeng
Senior Member
Posts: 34
Joined: Thu Apr 17, 2003 4:23 am
Forum Mgmnt,
Will veritrader 2.0 allow you to test the following system :

Consider a basket of, say, three currencies :
EUR, USD, JPY

Each month, go long the currency that has the highest interest rate and short the currency that has the lowest interest rate.

Thanks.

Forum Mgmnt
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:
Yes, you will be able to do that in 2.0.

You'll have to write the code for this in our trading system development language but it would be quite easy to do this for the system you outline.

- Forum Mgmnt

FrankWala
Full Member
Posts: 22
Joined: Sun Apr 11, 2004 12:32 pm
Location: San Diego, CA
Can you expand on your quote below. I did not follow.

Are you referring to the interest rates in the base currency ;

Interest rates are (% yield)
Aud Germ Japan UK USA (from Bloomberg 1 year note)
5.22 2.25 0.03 4.75 2.48

Go long AUD, Short Japan (Will that be AudJpy in Tradestation/FXCM)

Frank
San Diego
****************************************************
Moodaeng wrote:Forum Mgmnt, Will veritrader 2.0 allow you to test the following system :
Consider a basket of, say, three currencies :
EUR, USD, JPY
Each month, go long the currency that has the highest interest rate and short the currency that has the lowest interest rate. Thanks.

Moodaeng
Senior Member
Posts: 34
Joined: Thu Apr 17, 2003 4:23 am
Frank,

Yes, that's the idea. Except that I would consider 1 month libor rates (in Bloomberg, us0001m index, bp0001m index....) and would test the system with a monthly rebalancing of the portfolio. I have my own backtester in Vba that works well for testing futures; but it gets more complicated when I want to test what I call "basket rules" or "allocation rules".
Example : among 10 currencies, go long the 2 highest carry currencies, go short the 10 lowest. Among 500 stocks, go long the 10 lowest P/E, go short the 10 highest P/E. Rebalance monthly.

The logic is completely different from "classical" systems where you trade just one time series. That's why I was asking c.f..

So I have a choice to make now : either expand my backtester or just purchase Veritrader 2.0....by the way any idea when it will come out?

Thx...Moodaeng.

Forum Mgmnt
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:
So I have a choice to make now : either expand my backtester or just purchase Veritrader 2.0....by the way any idea when it will come out?
Version 2.0 has been released to the Beta testing group for a couple of weeks now. It is not yet feature complete, and I expect it to be about a month before it will be.

I'm gearing up the marketing for a launch coincident with the Las Vegas Trader's Expo in late November. It seems very likely that we'll be able to get things wrapped up by then but not much before. As we get further into the Beta testing process, we will know more.

- Forum Mgmnt

FrankWala
Full Member
Posts: 22
Joined: Sun Apr 11, 2004 12:32 pm
Location: San Diego, CA
Moodaeng
I checked around, TC2000, TradeStation, CSI, Fred St. Louis and did a search in google. Could NOT find 1 month libor. Other than Bloomberg (pricey for an individual) where can I find historical (5 years) for this data series. AND is Libor rates different for different countries (Aud, GB, Germany etc)
Thanks
Frank, San Diego
**********************************************************
Moodaeng wrote:Frank,
Yes, that's the idea. Except that I would consider 1 month libor rates (in Bloomberg, us0001m index, bp0001m index....) and would test the Example : among 10 currencies, go long the 2 highest carry currencies, go short the 10 lowest. Among 500 stocks, go long the 10 lowest P/E, go short the 10 highest P/E. Rebalance monthly. Thx...Moodaeng.

Nic Garvey
Contributing Member
Posts: 9
Joined: Thu Apr 01, 2004 9:45 am
Location: London, UK
FrankWala wrote:where can I find historical (5 years) for this data series. AND is Libor rates different for different countries (Aud, GB, Germany etc)
Try the source of the rates, the BBA:

http://www.bba.org.uk/bba/jsp/polopoly.jsp?d=141&a=627

FrankWala wrote:AND is Libor rates different for different countries (Aud, GB, Germany etc)
I donâ€™t understand this, but you might find the answer at the BBA site as well.

Moodaeng
Senior Member
Posts: 34
Joined: Thu Apr 17, 2003 4:23 am
Hi Frank,
Each major currency has its own Libor rate.

Forum Mgmnt
Roundtable Knight
Posts: 1842
Joined: Tue Apr 15, 2003 11:02 am
Contact:
Libor stands for London Interbank Offering Rate, and the aforementioned BBA is the British Bankers Association which sets/records the official Libor rates for each currency.

Libor is nothing more than the rates that the London banks agree to charge for lending money to each other in each of the major currencies. So if you represent a bank that needs some Euros, and I represent another bank in London, this is the rate I'll charge you.

- Forum Mgmnt

Ghostrider
Roundtable Fellow
Posts: 83
Joined: Thu Jul 31, 2003 11:46 am
Location: USA

### carry

Backtesting long dated currency rolls is easy. The issue is finding the right short-term plug.