Errors, bugs, questions - page 1088

 
MoneyJinn:

After recompiling the indicator, the "array out of range" error started to occur when working with dynamic arrays.

It didn't occur before. What to do?

If you have similar lines in the beginning of the file

#include <File.mqh> , these include files have most likely been changed since your previous compilation, by you or by someone else

 
Olegts:

If you have similar lines at the beginning of your file

#include <File.mqh>, it is likely that these include files were changed since your last compilation, by you or by someone else.

There are no include files.

 
MoneyJinn:

There are no plug-in files.

then you should post the indicator, maybe someone will take a look at it at their leisure)
 

Why would an"array out of range" error even occur when trying to put something into a dynamic array? It is a dynamic array.

Array B1[] Set as the corresponding indicator buffer

SetIndexBuffer(0,B1,INDICATOR_DATA); ArraySetAsSeries(B1,true);

The size of the array is clearly not user-controlled here.

 
MoneyJinn:
Why would an"array out of range" error even occur when trying to put something into a dynamic array? It's a dynamic array.
This does not mean that it increases its size by itself, the ArrayResize function does this and then you can add data, but not more than the new array size
 
MoneyJinn:
Why would an"array out of range" error even occur when trying to put something into a dynamic array? It's dynamic.
(fcplm)
 
TheXpert:
(fcplm)

Who's going to put him away?! He's a monument!

 

Platform error.

If when filling the B1 array of the indicator buffer the procedure SetIndexBuffer(0,B1,INDICATOR_DATA) is called repeatedly,

e.g., when initializing the indicator, the next attempt to write something in the B1 array causes the"array out of range" error.

When calling the SetIndexBuffer(0,B1,INDICATOR_DATA) procedure once, everything works fine.

There was no such thing before.

Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
  • 2010.10.25
  • Nikolay Kositsin
  • www.mql5.com
Статья о традиционных и не совсем традиционных алгоритмах усреднения, упакованных в максимально простые и достаточно однотипные классы. Они задумывались для универсального использования в практических разработках индикаторов. Надеюсь, что предложенные классы в определенных ситуациях могут оказаться достаточно актуальной альтернативой громоздким, в некотором смысле, вызовам пользовательских и технических индикаторов.
 
MoneyJinn:

Platform error.

If when filling the B1 array of the indicator buffer the procedure SetIndexBuffer(0,B1,INDICATOR_DATA) is called repeatedly,

e.g., when initializing the indicator, the next attempt to write something in the B1 array causes the"array out of range" error.

When a single call of the procedure SetIndexBuffer(0,B1,INDICATOR_DATA) occurs, everything works fine.

It didn't happen before.

Why are you doing this repeatedly?

Binding a buffer means clearing it and preparing it for dynamic binding for subsequent calculations. If you call it a second time, the previous buffer will be cleared and will be filled only at the next call of the indicator recalculation.

 
Renat:

Why are you doing this repeatedly?

Binding of the buffer means its clearing and preparation for dynamic binding for the next calculations. If you call it a second time, the previous buffer will be cleared and will be filled only at the next call of the indicator recalculation.

This was the standard full initialization of the indicator, which takes place when the indicator is first started and is done via Oninit().

Sometimes, when you update the history, etc., it also needs to be done.

No one ever thought that the repeated initialization of the indicator via Oninit() would cause the arrays to stop responding.

Reason: