prev_calculated - page 5

 
Karputov Vladimir:

Preliminary conclusions:

in indicators you cannot rely on the initialization of indicator arrays in OnInit():

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
...
   ArrayInitialize(balance, 0.0);    // принудительная
   ArrayInitialize(equityMax, 0.0);  // инициализация
   ArrayInitialize(equityMaxB, 0.0); // всех
   ArrayInitialize(equityMin, 0.0);  // буферов
   ArrayInitialize(equityMinB, 0.0); // индикатора

...
//---
   return(INIT_SUCCEEDED);
  }

In indicators, it is necessary to pass through the entire array or only changed elements in OnCalculate().

Vladimir, again you are composing on a free theme?

According to the documentation, the indicator buffers are initialized automatically. This initialization was used out of helplessness, because it does not work properly. Although it's written in mql4 documentation, I can't find it in mql5.

 
Alexey Viktorov:

According to the documentation the indicator buffers are initialised automatically.

Don't make it up, please, or provide a link to the documentation. MT5!

 
Alexey Viktorov:

Vladimir, more freestyle essays???

According to the documentation, indicator buffers are initialized automatically. And this initialization was done out of helplessness, because it doesn't work properly. Although it's written in mql4 documentation, I can't find it in mql5.

Where is it written?
 
Alexey Kozitsyn:

Don't make it up, please, or link to documentation. MT5!

Alexey, you didn't have enough energy to read it to the end? I read it a long time ago in mql4, even to 600 build, where to find it now... dunno (would like to know).
 
Alexey Viktorov:
Alexey, didn't you have enough strength to read to the end? I read it a long time ago in mql4, even to the 600 build, where to find it now... I don't know (I'd like to know).
What does "four" have to do with it? You should have stopped with these phantom pains already about five years ago :) . Only "five", only the best!
 
Alexey Viktorov:
Alexey, didn't you have enough strength to read to the end? I read it a long time ago in mql4, even to the 600 build, where to find it now... I don't know (I'd like to know).
I have enough power, but Aleksey, may be it is too loud statement? And in case you're not aware of it, mql4 and mql5 indicators are very different.
 
Karputov Vladimir:
What's the "four" got to do with it? These phantom pains should have been dealt with five years ago :) . Only five, only the best!
Vladimir, please be more democratic and leave me my right to choose what I use. Stop this advertising. Everybody knows how good MT5 is, but no one knows how to fight its problems.
 
Alexey Kozitsyn:
The force was enough, but, Alexey, isn't that too loud a statement then? And in case you're not aware of it, mql4 and mql5 are very different in terms of indicator construction.
So, it's a qualified statement, so it's not too loud, in my opinion...
 
Alexey Viktorov:
Vladimir, please be more democratic and leave me the right to choose what to use. Stop this advertising. Everyone knows how good MT5 is, but no one knows how to fight its problems.

So MQL5 has no problems, there are gaps in knowledge of some users, but that's what the forum is for, to fill these gaps. There are algorithms to follow when writing programs. In particular, for indicators, they are:

Forum on Trading, Automated Trading Systems and Testing of Trading Strategies

prev_calculated

Karputov Vladimir, 2016.10.18 18:18

Preliminary conclusions:

1. You cannot rely on the initialization of indicator arrays in OnInit():

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- indicator buffers mapping
...
   ArrayInitialize(balance, 0.0);    // принудительная
   ArrayInitialize(equityMax, 0.0);  // инициализация
   ArrayInitialize(equityMaxB, 0.0); // всех
   ArrayInitialize(equityMin, 0.0);  // буферов
   ArrayInitialize(equityMinB, 0.0); // индикатора

...
//---
   return(INIT_SUCCEEDED);
  }

2. In indicators it is obligatory to go through the whole array or only changed elements in OnCalculate().


 
Karputov Vladimir:

So MQL5 has no problems, there are gaps in knowledge of some users, but that's what the forum is for, to fill these gaps. There are algorithms to follow when writing programs. In particular, for indicators these are:


There is NO such thing in the documentation! Therefore it is an essay on a free theme. Just like my statement about automatic initialization, even cooler. At least mine had a disclaimer...
Reason: