Page 1 of 1

Backtesting a forex portfolio

Posted: Fri Apr 18, 2003 1:08 am
by TK
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.

Posted: Fri Apr 18, 2003 1:48 am
by damian
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.

Money management with different currencies

Posted: Wed Jun 25, 2003 2:29 am
by Jim Wells
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
$coefficient = $max_risk_per_trade / $risk_in_trade; 
$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

Posted: Wed Jun 25, 2003 3:10 am
by damian
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.

Posted: Wed Jun 25, 2003 3:54 am
by Jim Wells
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

Conversion

Posted: Wed Jun 25, 2003 10:51 am
by Vince
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.

backtesting forex portfolio

Posted: Wed Aug 18, 2004 1:25 am
by andysg
I can across this software, "real-time portfolio analzer" (http://www.traderssoft.com/sys/rtpa/)
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

Posted: Wed Aug 18, 2004 6:07 am
by Forum Mgmnt
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

Posted: Sat Aug 28, 2004 10:20 am
by Moodaeng
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.

Posted: Sat Aug 28, 2004 1:28 pm
by Forum Mgmnt
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

Posted: Sat Aug 28, 2004 8:11 pm
by FrankWala
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.

Posted: Mon Aug 30, 2004 3:48 am
by Moodaeng
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.

Posted: Mon Aug 30, 2004 8:11 am
by Forum Mgmnt
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

Posted: Wed Sep 01, 2004 1:28 pm
by FrankWala
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.

Posted: Wed Sep 01, 2004 2:46 pm
by Nic Garvey
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.

Posted: Thu Sep 02, 2004 2:53 am
by Moodaeng
Hi Frank,
Each major currency has its own Libor rate.

Posted: Thu Sep 02, 2004 7:13 am
by Forum Mgmnt
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

carry

Posted: Wed Sep 08, 2004 6:32 pm
by Ghostrider
Backtesting long dated currency rolls is easy. The issue is finding the right short-term plug.
:P