Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1172

 
Evgeny Dyuka:

The forum is huge and there is no topic on the use of neural networks in trading. That's odd. Or is there somewhere?

Or is there just no one dealing with it?

https://www.mql5.com/ru/search#!keyword=%D0%BD%D0%B5%D0%B9%D1%80%D0%BE%D1%81%D0%B5%D1%82%D0%B8&module=mql5_module_articles

Поиск - MQL5.community
Поиск - MQL5.community
  • www.mql5.com
Поиск выполняется с учетом морфологии и без учета регистра. Все буквы, независимо от того, как они введены, будут рассматриваться как строчные. По умолчанию наш поиск показывает страницы...
 
 
Hello Dear Experts. Do such functions as SymbolInfoDouble(symb,SYMBOL_BID) or PositionsTotal() have any effect on the delay (ping to the server), or these data are taken from the terminal? And what is betterto use PositionGetDouble(POSITION_PRICE_OPEN) or data from MqlTradeResult structure?
 
How to pass parameters from OnCalculate(const datetime &time[]) function to another function by reference, they write that a constant variable cannot be passed as reference?
 

What's the problem with the two-dimensional array?

Simple test script code:

double ARtst[5][6];
double sss=0.0;

void OnStart()
{
   for(int nn=0; nn<5; nn++) {
      for(int mm=0; mm<6; mm++) {
         ARtst[nn][mm] = 1.0 + 1.0*nn*mm;
      }
   }

   for(int nn=0; nn<5; nn++) {
      testproc(nn,sss,ARtst);
   }
}

void testproc(int ii, double& sum, double& ARR[][])
{  int kk;

   kk = ArrayRange(ARR,1);
   sum = 0.0;
   for(int nn=0; nn<kk; nn++) sum = sum + ARR[ii][nn];

   return;
}

Gives out two errors at once:

1. "[" - invalid index value, pointing to two-dimensional array ARR in testproc procedure definition.

2. "ARtst" - parameter conversion not allowed, pointing to array ARtst in definition of procedure testproc.

No problem with one-dimensional array.

 
VANDER:
How to pass parameters from OnCalculate(const datetime &time[]) to another function by reference, they say that a constant variable cannot be passed as reference
void другая_функция(const datetime &time[], const int rates_total) 
{
 Print(time[rates_total-1]);
}
// Вызов функции из OnCalculate

другая_функция(time, rates_total);
 
Yurixx:

What's the problem with the two-dimensional array?

Simple test script code:

Gives out two errors at once:

1. "[" - invalid index value, pointing to two-dimensional array ARR in testproc procedure definition.

2. "ARtst" - parameter conversion not allowed, pointing to array ARtst in definition of procedure testproc.

There are no problems with one-dimensional array.

I did not understand the code completely, but it should be like this:

void testproc(int ii, double& sum, double& ARR[][6])
 
Alexey Viktorov:

I didn't fully understand the code, but it should be like this:

Exactly! Thank you very much.

Still getting to grips with the differences between MT5 and MT4 before the end. )))

 
Yurixx:

Exactly! Thank you very much.

Still getting to grips with the differences between MT5 and MT4 before the end. )))

In mql5, working with arrays is not at all different from mql4.

 
Alexey Viktorov:

In mql5 working with arrays is not at all different from mql4.

As I see it is different.

In MT4 the declaration of multidimensional arrays in procedures did not require to specify the dimensionality explicitly in any of the dimensions.

Reason: