Asking for Zigzag indicators values return weird results

 

I am trying to use Zigzag indicator values in numerous applications, say for example support and resistance determination.

This code, which I believe worked in the past for me, is showing now weird results:


int n = 200; //how many candles to check back
int Handle=iCustom(_Symbol,_Period,"Examples\\ZigZag",Depth,Deviation,Backstep);
double z[]; 
ArraySetAsSeries(z,true);
int bf=CopyBuffer(Handle,0,0,n,z);


And after execution I got the non zero Z values in wrong places, at the wrong values as in the picture below:


Could you help, please?

 

What do these signs mean?

int Handle=iCustom(Ξ,Ͳ,"Examples\\ZigZag",Depth,Deviation,Backstep);

read about iCustom 
https://www.mql5.com/en/docs/indicators/icustom

Documentation on MQL5: Technical Indicators / iCustom
Documentation on MQL5: Technical Indicators / iCustom
  • www.mql5.com
[in]  The name of the custom indicator, with path relative to the root directory of indicators (MQL5/Indicators/). If an indicator is located in a subdirectory, for example, in MQL5/Indicators/ [in] input-parameters of a custom indicator, separated by commas. Type and order of parameters must match. If there is no parameters specified, then...
 

Sorry my parameters for Currency and timeframe

in my example i passed the parameter as _Symbol,_Period

I updated the code accordingly
 

An example of working with the ZigZag indicator: 

An example of working with the ZigZag indicator

How to start with MQL5
How to start with MQL5
  • 2018.12.24
  • www.mql5.com
This thread discusses MQL5 code examples. There will be examples of how to get data from indicators, how to program advisors...
 

Vladimir Karputov:

I run through your code, and it seemed to me that the only real difference I make is calling the same functions from Include and EA, not from indicator...

Could it be the problem? Is is better to call an indicator from an indicator?

 
Ziad El:

I am trying to use Zigzag indicator values in numerous applications, say for example support and resistance determination.

This code, which I believe worked in the past for me, is showing now weird results:



And after execution I got the non zero Z values in wrong places, at the wrong values as in the picture below:


Could you help, please?

Did you find answer? 

this is my problem too.

Reason: