Cannot get a symbol information in the tester

 

Greetings everyone,


I try to get a specific symbol information (in my case it's GBPUSD) in a tester while testing another pair (EURUSD). When i try to get the information about how many symbol digits the GBPUSD pair has,  i get '0'. 

The used code:

SymbolInfoInteger(symbol,SYMBOL_DIGITS)

Is it possible to find a way to bypass restrictions of the tester and actually get information about a pair which is not tested directly?
 
  1. The symbol you passed is not in the Market Watch.
  2. You would know that if you had checked the error code.
 
William Roeder:
  1. The symbol you passed is not in the Market Watch.
  2. You would know that if you had checked the error code.

Really appreciate the advise. Yeah, i did the error check and it showed 4106. However the pair still appears in the marketwatch.

 
Tom Seljakin:

Really appreciate the advise. Yeah, i did the error check and it showed 4106. However the pair still appears in the marketwatch.

Where does symbol comes from?

 
amando:

Where does symbol comes from?

Not sure, if i understood the question correctly. When i test the EURUSD pair, i try to get the number of digits of the GBPUSD pair (because i use it's data from csv files), which is showed in the warketwatch window. It doesn't have any suffixes or prefixes, it just is "GBPUSD". In terms of the name of the pair, everything is correct.

 
Tom Seljakin:

Not sure, if i understood the question correctly. When i test the EURUSD pair, i try to get the number of digits of the GBPUSD pair (because i use it's data from csv files), which is showed in the warketwatch window. It doesn't have any suffixes or prefixes, it just is "GBPUSD". In terms of the name of the pair, everything is correct.

SymbolInfoInteger(symbol,SYMBOL_DIGITS)

That i mean, where comes symbol from?

 
amando:

That i mean, where comes symbol from?

From the settings which you put in an input parameter. However, i checked the issue is not there.

 

I checked the other 'SymbolInfo' functions, it's the same issue. Prior to calling the function, i try select a symbol in the marketwatch, but receive 'false'. In the real mode everything works correctly. In the tester, I cannot get information of any pair, except for the one I am testing.

The code is very simple:

input string Pair = "GBPUSD";

//+------------------------------------------------------------------+

//| Expert initialization function                                   |

//+------------------------------------------------------------------+

int OnInit()

  {

//--

ResetLastError();

long digits = SymbolInfoInteger(Pair,SYMBOL_DIGITS);


if(digits <= 0) Print("ERROR! ",__FUNCTION__,": Issue with getting the number of digits of the symbol "+Pair+". The error code: "+(string)GetLastError());



//---

   return(INIT_SUCCEEDED);

  }

I receive the error 4106, and not sure how to solve it.
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
Documentation on MQL5: Constants, Enumerations and Structures / Named Constants / Predefined Macro Substitutions
  • www.mql5.com
Predefined Macro Substitutions - Named Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
Files:
test1.png  22 kb
 
Not sure about it but I think MT4 doesn't support multi-symbol tests. MT5 does, though.
 
lippmaje:
Not sure about it but I think MT4 doesn't support multi-symbol tests. MT5 does, though.

Probably it's the answer to the issue. 

Reason: