Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1619

 
Hello, I am writing an EA for NzdUsd and using in its calculations the value of the moving average from another currency pair AudUsd.
When I'm testing the indicator on another symbol I get a null value.
Is it the inability of MQL4 itself to receive an indicator value on other pairs during testing?
double AudUsd = iMA("AUDUSD",0,Period,0,MODE_SMA,PRICE_CLOSE,i); //Выдаёт нулевой результат при тестировании на другой паре (NzdUsd) 
And please advise the actual forex broker that has an archive of quotes for testing.
 
EVGENII SHELIPOV #:

Can you be more specific?

 
giros #:
Hello, I am writing an EA for NzdUsd and using in its calculations the value of the moving average from another currency pair AudUsd.
When I'm testing the indicator on another symbol I get a null value.
Is it the inability of MQL4 itself to receive an indicator value on other pairs during testing?
Please advise the actual forex broker that has an archive of quotes for testing.
This is an inability of MT4
 
MakarFX #:

Then it's like this

The market is now open and the button is pushed back a bit, sometimes after more than a second.
 
MakarFX #:
This is an inability of MT4 itself

Makar, don't mislead people. I foolishly thought that some changes have been made that I don't know about... I even tested it on EURUSD

int sd;
/*******************Expert initialization function*******************/
int OnInit()
 {
  sd = (int)MarketInfo("EURJPY", MODE_DIGITS);
  return(INIT_SUCCEEDED);
 }/******************************************************************/

/************************Expert tick function************************/
void OnTick()
 {
  datetime lt = iTime(_Symbol, PERIOD_M15, 0);
  static datetime ct = 0;
  if(ct != lt)
  {
   ct = lt;
   Print(DoubleToString(iMA("EURJPY", PERIOD_M15, 21, 0, MODE_SMA, PRICE_CLOSE, 0), sd));
  }
 }/******************************************************************/

I'm not able to open orders on other pairs in the mt4 tester, everything else is available without any problems.

 
Alexey Viktorov #:

Makar, don't mislead people. I foolishly thought that some changes have been made that I don't know about... I even tested it on EURUSD

I'm not able to open orders on other pairs in the mt4 tester, everything else is available without any problems.

Sorry, wrong, didn't know it myself.
 
giros #:
Hello, I am writing an EA for NzdUsd and using in its calculations the value of sliding from another currency pair AudUsd.
When I'm testing the indicator on another currency pair, it shows zero values.
Is it the inability of MQL4 itself to receive an indicator value on other pairs during testing?
And please advise the actual forex broker that has an archive of quotes for testing.

Check the availability of AUDUSD quotes for the required timeframe

 
Alexey Viktorov #:

Makar, don't mislead people. I foolishly thought that some changes have been made that I don't know about... I even tested it on EURUSD

I don't know how to open orders on other pairs in the mt4 tester, everything else is available to me without any problems.

Maybe something is wrong? Also, it is not possible to obtain data of bars from other symbols according to tester time, it will be obtained by current time. That's why I can't test the multicurrency even just in the calculation part in 4ka.

I always thought that MT4 tester fully emulates the environment of a single instrument, and MT5 the entire environment that is available.

Or is it not?

 
How do I calculate the number of decimal places?
 
pribludilsa #:
How do I calculate the number of decimal places?
_Digits

https://www.mql5.com/ru/docs/predefined/_digits

Документация по MQL5: Предопределенные переменные / _Digits
Документация по MQL5: Предопределенные переменные / _Digits
  • www.mql5.com
_Digits - Предопределенные переменные - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
Reason: