MarketInfo for many pairs not working with Strategy Tester

 

Hello,

I'm a newbie. I've written my first EA. It compiles and runs well, and it's actually making some money. However, I cannot make it work with the strategy tester.

My EA works with several pairs simultaneously. Therefore I need to access info from those pairs, from the same EA script.

When I am running this in the "real world", that's no problem. Even if my script is attached, say, to the GBPUSD cart, I can retrieve info from other pairs by doing for example:

double cotiz=MarketInfo("NZDUSD",MODE_BID); 

But I cannot do this when I'm running the strategy tester. For example if I chose GBPUSD as "symbol" in the strategy tester, then calls to MarketInfo for  other pairs return 0.

For example MarketInfo("NZDUSD",MODE_BID) returns 0 (zero).

Please help!!!

Other info:

 - My MT4 account is with FXCM.

- All the historical data is ok... I can see it both in the charts and in the history center. Yet the strategy tester seems to ignore this.

- I tried using differeent options for the strategy tester such as: different models (everytick, opening prices only, different time periods...) This didn't help. Currently I'm running with M15 and "open prices" only.

 Please help!!!! Thanks,

Gus

 Code sample:

         double currentPrice; 

         currentPrice=MarketInfo("GBPUSD",MODE_BID);

         Alert(currentPrice); // returns value when running for real, but returns 0 when executed from the EA with another symbol

 
gusfai: But I cannot do this when I'm running the strategy tester.
That's right, you CAN NOT. You can get OHLC by using
double GetHigh(string pair, datetime when){
  int per   = Period(),
      iPair = iBarShift(pair, per, when);
  return( iHigh(pair, per, iPair) );
}
Reason: