USDJPY backtest result

I am using IQFeed for Fx data and backtesting a strategy on daily USDJPY FX. I have specified the following contract specification for USDJPY as described in the following amibroker for forex link
http://www.amibroker.com/kb/2006/08/09/amibroker-for-forex/

Round Lot size - 1
Margin Deposit - 2500
Tick Size - 0.01
Point Value - 100000

I've also updated the JPY Preferenes -> Currencies section to include the dynamic rate symbol with inverse multiplier and set my base currency as USD

However, the result I get for a backtest seems to have the profit in JPY rather than USD -
If the Entry price is 114.637 and Exit Price is 111.879, then pnl for 1 contract used would be
= -1100000(111.879-114.637)*(1/111.879) = 2465.16 USD. However, the result above shows profit in JPY and not USD. How can I get it to show profit in USD?

Thank you in advance for the help!

Set "Currency" field to "JPY" in "Information" window (Window -> Information).
To be save click "View - Refresh all" afterwards. Then re-do analysis.

3 Likes

Hi fxshrat, Thank you for the answer and the document. Its very helpful! I was wondering if there is a way to set the periodicity of the backtest in AFL script. The reason I ask is I am trying to run it on 4h bars and although I see a hourly option in backtester settings I cant find one for 4h.

In Tools-Preferences-Intraday you can set custom intervals.

http://www.amibroker.com/kb/2014/10/28/how-to-create-toolbar-button-for-custom-interval/

1 Like

Hi all,
I have almost the same problem as the first post by fxtr8er
Here are the settings:

Round Lot size: 1
Margin Deposit: 1000
Tick Size: 0.0001
Point Value: 100000

Base Currency: USD

Consider the below picture on USDCAD.
Entry: 1.2989
Exit: 1.2992

Profit= 100000 * (1.2992 - 1.2989) / 1.2992 = 23.09 USD

However, Amibroker calculate it to be 61.61 USD

I did all the settings based on documentation and set the "Currency" field to "CAD" in "Information" window.
The same error occurs for other no USD pairs such as EURCAD.
Note that if pairs that USD is the 2nd pair, the profit calculated correctly.
Does anyone know how to fix this error?!

2fc2d06f-a830-4f06-a479-70178297260c

It is user error on your end.

You have to check Tools - Preferences - Currencies having added dynamic rate symbol.

12

12

2 Likes