how to get ask/bid of another pair in backtest

 

Hi all,

in my strategy, before openning a trade of a pair (say gbpjpy), I need to look up the price of eurjpy. Currently, I use marketinfo function but this function does not work under backtesting. Is there any other way to get price of a pair int the past in mt4?

Thanks in advance for your time

Peter

 
test12345:

Hi all,

in my strategy, before openning a trade of a pair (say gbpjpy), I need to look up the price of eurjpy. Currently, I use marketinfo function but this function does not work under backtesting. Is there any other way to get price of a pair int the past in mt4?

Thanks in advance for your time

Peter

Nope. It's one of the biggest limitations of MT4 Tester - can only test on one currency pair at a time. MT5 Tester is supposed to have multi-asset Tester, but it's not out yet.

 
test12345 wrote >>

Hi all,

in my strategy, before openning a trade of a pair (say gbpjpy), I need to look up the price of eurjpy. Currently, I use marketinfo function but this function does not work under backtesting. Is there any other way to get price of a pair int the past in mt4?

Thanks in advance for your time

Peter

May be with two MT4 ans two tester. One is writing eurjpy value in a file and the other read from it. Not very simple but would work.

 
Matutin wrote >>

May be with two MT4 ans two tester. One is writing eurjpy value in a file and the other read from it. Not very simple but would work.

Yes, I am thinking a similar line, dump data out to a file and do further test separately ;-)

Thanks

 
Matutin:

May be with two MT4 ans two tester. One is writing eurjpy value in a file and the other read from it. Not very simple but would work.

Yeah, but why do u need 2 Testers? If u want 'tick' data for EURJPY then all u need is the FXT file produced by the Tester for a EURJPY run of same dates. If open/close/high/low are enough, then all u need is EURJPY M1 HST file (or for whatever time-frame u want). Both FXT and HST files have documented formats and the data can be read directly from them.

Of course if u want to actually trade with the second currency then it becomes very complicated, but as long as all u want is to get the price then it's doable. This is quite a workaround though, hopefully in the near future the MT5 multi-asset Tester would be out.

Reason: