CopyBuffer return Correct Array size but all 0.0

 

Hello to everyone, 

I'm new with MQL5 and I'd like to develope an EX with an Indicator similar to Zig Zag.

But unfortunatly I do not understand why all data received ar filled to 0.

If I try to change buffer all data are Ok but with buffer "buffer_1" no.

I've tried  "PeakBuffer" and everithink works fine.

***

In this moment If I try ArraySize( buffer ) is 2 but all data are 0.0, and i'm sure that  buffer_1 has value different from 0.0.

If I try to change   buffer_1 with PeakBuffer eveythinks is working.

Please anyone could help me?

Thanks in advance

Gianluc


Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
  • www.mql5.com
Program Properties (#property) - Preprocessor - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
You have to check the value returned in the "copy" variable here:

int copy=CopyBuffer(indicator_handle,0,0,2, buffer );

if (copy < 0) {
  Print("Still hasn't copied the data");
  return;
}
 
AlternativeCodeFX:

Please insert the code correctly: when editing a message, press the button    Codeand paste your code into the pop-up window.