Errors, bugs, questions - page 607

 
papaklass:
I thought that ArrayInitialize() was enough.
You must have confused dynamic arrays with indicator buffers. ArrayInitialize() does not change the array size, it only initializes it.
Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
Усреднение ценовых рядов без дополнительных буферов для промежуточных расчетов
  • 2010.10.25
  • Nikolay Kositsin
  • www.mql5.com
Статья о традиционных и не совсем традиционных алгоритмах усреднения, упакованных в максимально простые и достаточно однотипные классы. Они задумывались для универсального использования в практических разработках индикаторов. Надеюсь, что предложенные классы в определенных ситуациях могут оказаться достаточно актуальной альтернативой громоздким, в некотором смысле, вызовам пользовательских и технических индикаторов.
 
Sorry to be intrusive - but someone reply to my post:)
 
MigVRN:
Sorry to be intrusive - but someone answer my post:)
Well how can you summarise 100 values if there are only 99 ?
 
The size of the array is one more than the index of its last element - something like this
 
period and position are compared.
 

There is an array price[] with 100 elements. The number of the last position is 99 (0,1,2...99). I need to get its average.

I pass to function: SimpleMA(99, 100, price); since 99<100 I get 0.

 
do you want to get a value of 100 period MA based on 99 elements?
 
Write an example of how you can use the SimpleMA function to smooth an array of 100 elements... Please...
 
what is the MA period ?
 
100