your buffer index correspond to Bar index.
in the indicator zigzag, not all index have valid value.most of the buffer index are EMPTY_VALUE.
you have to check it with a for circle. pick out the first 3 non-empty-values' index in sequence.
in the indicator zigzag, not all index have valid value.most of the buffer index are EMPTY_VALUE.
you have to check it with a for circle. pick out the first 3 non-empty-values' index in sequence.
Perhaps you should read the manual, especially the examples. They all (including iCustom) return a handle (an int.) You get that in OnInit. In OnTick (after the indicator has updated its buffers,) you use the handle, shift and count to get the data.
Technical Indicators - Reference on algorithmic/automated trading language for MetaTrader 5
Timeseries and Indicators Access / CopyBuffer - Reference on algorithmic/automated trading language for MetaTrader 5
How to start with MQL5 - General - MQL5 programming forum - Page 3 #22 2020.03.08
How to call indicators in MQL5 - MQL5 Articles 12 March 2010
//Before the main function double ZigZagArray[],zigzag[100]; int ZigZagHandle; void onTick(){ //Calling the function CheckForZigZag(); //Print as many as you want. for example 2 value here Print(zigzag[0],zigzag[1]); } void CheckForZigZag() { ZigZagHandle=iCustom(_Symbol,PERIOD_M15,"Examples\\ZigZag",12,5,3); ArraySetAsSeries(ZigZagArray,true); CopyBuffer(ZigZagHandle,0,0,100,ZigZagArray); int zigzag_counter=0; for(int i=0; i<100; i++) { if(ZigZagArray[i]!=0.0) { zigzag[zigzag_counter]=ZigZagArray[i]; zigzag_counter++; } } }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
i'd like to access the last three fixed values of ZigZag Highs indicator (standard one)
i have seen other threads discussing the same problem but they are all in mql4 and i use mql5
Here's my code ,but no matter i change the indices , it only produces the last non fixed value of the High !