I have a few related questions:
1) I'm not sure if a tick contains the information for only one currency pair (i.e. the one in current chart) or all the pairs available from the dealers?
2) If the former is true, what if the EA is designed to process new ticks from multiple currency pairs and requires OnTick function to be called when a tick for any pair of interest arrives?
3) In the MT4 backtest centre, in the drop down list for "Symbol", some entries have the same pair, others have different ones. What does that mean?
Thank you in advance!
What do you mean ? All entries are different, one for each symbol (selected in the Market Watch).
Regarding your answer to Q2, a further question is: when a new tick (say XAUUSD is the current chart symbol) arrives, if I call iOpen("GBPUSD"), I can have access to an array of prices for GBPUSD yes? or can I? If I can have access to GBPUSD, when does it get updated?
Regarding Q3, if you look at the attached figure, each entry in the drop down list contains two pairs, something like "XAUUSD, Gold" or "BCOUSD, Brent Crude Oil". I am not sure what this combination means.
Thanks a lot!
It's not 2 pairs, it's the "short" name and full name.
Regarding your answer #1, if the EA only gets ticks for the current chart symbol, say XAUUSD (as said by Alain), does that mean calling iOpen("GBPUSD",shift=0) will only return the latest price (not necessarily up to date) available in the historical data centre if any?
If that is correct, can I do the following:
In a backtest-only scenario, assuming that historical data of both XAUUSD and GBPUSD are available for the backtest time span, the EA is tested on XAUUSD. When OnTick is called, if it is the first tick of a new bar, I can then check close price of the previous bar for GBPUSD by using iClose("GBPUSD")
You can't backtest multiple instruments at the same time from one EA in MT4 but you can in MT5. (don't expect meaningful results if you're testing an arb strat)
When I trade multiple pairs on MT4 I use OnTimer() with a ~10-100ms refresh. I also don't use the iTimeSeries functions, but rather the newer CopyRates() with rate structs as they (my understanding) update live rates info from the platform when called.
You can access all history data available for all symbols available. On the strategy tester you need to get needed data BEFORE running your tests.
However as said by @nicholishen you can trade only 1 symbol with MT4 Strategy tester.