Backtesting USD/JPY - strategy results show in JPY (I think)

Questions about MultiCharts and user contributed studies.
moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Backtesting USD/JPY - strategy results show in JPY (I think)

Postby moses » 30 Jun 2013

Hi,

could anyone please enlighten me on what I am doing wrong?

I am backtesting the USD-JPY pair, and I have two problems, that I guess are related:

1. my easy language code doesn't give me the correct position size (in contrast to the same code used for an EUR/USD strategy).

2. the strategy results are shown in JPY, I think.

Any ideas on how I can fix these things?

Thanks a lot
moses

User avatar
TJ
Posts: 7739
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1032 times
Been thanked: 2221 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby TJ » 30 Jun 2013

Hi,

could anyone please enlighten me on what I am doing wrong?

I am backtesting the USD-JPY pair, and I have two problems, that I guess are related:

::

2. the strategy results are shown in JPY, I think.

Any ideas on how I can fix these things?

Thanks a lot
moses
give this a try:

MultiCharts > File > Preferences > Trading >

Select USD in Preferred currency dropdown menu.

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby moses » 30 Jun 2013

Thanks! That was much easier than expected!

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby moses » 08 Jul 2013

Hi again,

I feel stupid, but the solution proposed by TJ doesn't work now!
When I tried it the first time, it seemed to work, but not any more!

So allow me to ask again: I am backtesting the USD/JPY, and the strategy results seem to be in JPY. I changed my preferences currency to USD, as suggested by TJ, but no luck.

Any other ideas please?

Thanks
moses

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby moses » 09 Jul 2013

Just got the answer from live chat, if someone is interested.

Forex pairs show their results in the secondary currency always.
So my USD/JPY strategy will show the P&L results in JPY!

An extremely crude way to 'fix' this is to go the Settings button on the actual strategy report, Display, and change the Regional Currency settings.

I am personally testing 6 years worth of data, in which period the rate fluctuated from 80 to 130, so I don't see any way this solution can be accepted.

The only explanation I can see for this unbelievable state, is that not many MC users are testing forex?
I am off to the project management page .. where I see there are already some complaints about this issue..

https://www.multicharts.com/pm/viewissu ... _no=MC-614

https://www.multicharts.com/pm/viewissu ... _no=MC-318

Please vote if you'd like this to be fixed!

User avatar
swz168
Posts: 120
Joined: 30 Sep 2010
Location: Germany
Has thanked: 47 times
Been thanked: 32 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby swz168 » 10 Jul 2013

Moses, have a look at this feature request:
https://www.multicharts.com/pm/viewissu ... _no=MC-349

It is targeted for MC9.0

I really hope Multicharts will not postpone the implementation, because it is a really important and essential feature. Even better, they implement it in MC 8.8 :)

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby Henry MultiСharts » 19 Jul 2013

You also can express the values using the first currency from a currency pair (GBPJPY for ex.) by changing the big point value in the QuoteManager.
For example the exchange rate for 1.0 JPY is 0.0065 GBP.
To express the values in GB Pounds you need to go to the QuoteManager->
make a right click on GBPJPY ->Edit symbol->settings tab and set the big point value to 0.0065.

AlphaCat
Posts: 69
Joined: 09 Jul 2013
Been thanked: 9 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby AlphaCat » 19 Jul 2013

Henry: a static big-point value won't cut it, since during a backtest this value would fluctuate in reality. Depending on the currency pair up to +-50% for the last 5 years.

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby moses » 20 Jul 2013

I found a solution.. I am now using a different trading platform to test my FX pairs that don't have USD as the quote currency. It understands the currencies used automatically, and even gives you the option to choose the display currency for your results.

MC, please take note and improve this for us!

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby moses » 20 Jul 2013

In case some other beginner soul is tortured to understand how things work, here's some discoveries I am making as I test one thing at a time...
I am also hoping to make things clear in my mind, as I write them down..

Please, anyone who knows the answers (someone from MC maybe?), do confirm or kindly explain!


Testing EUR/USD now, and I note:
1. the position size given by the strategy (any strategy on the EUR/USD) will be in euros. So, as a general rule, I would say that the position size in an FX pair, will be on the base currency (i.e. the first quoted currency of the pair).
The currency selection in File / Preferences / Trading / Currency Options / Preferred Currency, doesn't make any difference to the results.

2. The strategy performance report will show the profit results in the quote currency. In my test case (of EUR/USD), in USD.

3. The P&L results are correct, but it's certainly strange to have the position size in one currency and the P&L numbers in another.

4. The commission calculations (in my case, I use the Interactive Brokers' rate, which is 0.2 pips on the trade value) are correct, i.e. they are calculated on the base currency position size, and then translated to the quote currency given the trade's current rate, and deducted from the P&L properly.
So, for example for one trade (say, going long), a position size of 100 Euros, and a commission rate of 1%, would deduct 1.3 USD from the profits, if the rate is 1.3.

5. Slippage (I use 2 pips, i.e. 0.0002) is also calculated correctly..phew, that's a relief.. I was worried that I would have to throw away my million-dollar (or is it euros?..) making strategies.


I will proceed with tests on the USD/JPY..
Last edited by moses on 21 Jul 2013, edited 1 time in total.

moses
Posts: 54
Joined: 16 Nov 2012
Has thanked: 34 times
Been thanked: 7 times

Re: Backtesting USD/JPY - strategy results show in JPY (I th

Postby moses » 21 Jul 2013

Some notes on testing the USD/JPY pair..

The same observations apply, as with the EUR/USD above.
Commissions and slippage are correct.

A practical issue would be how to make your strategy calculate the correct position sizing in USD.
In my case, my strategy risks, say 1% of my equity. This is coded in the strategy.
My equity is calculated by adding the original equity assumed plus the strategy's profit till that time.
The problem is that the reserved words "netprofit" and "portfolio_netprofit" keep the profit values in JPY.
My simplistic (and not accurate) solution is to find my total equity by assuming:
total equity = initial equity + netprofit/close

I accept that solution, so I don't waste more time. I am sure a smarter programmer could find a better solution.

Having tested all the above, it now seems to me that I can work with MC's tester on these pairs, by accepting some compromises and by being careful with each step..


Return to “MultiCharts”