when I print the last error after iCustom Loop i have error :4002 Attempt to access an array item number of which is out of the array range
Why don't you use this it might make the errors easier to understand. It sound like an index is not being set correctly.
|
I haven't tested your code but the variable counted bars might be the cause your array error. try limit=Bars;
you right "circlesquares" I have tested you suggestion and I have no problem for built ZigZag[i] Array now ; but the indicator still return extrem values !! I'll place error test every where ; i'll give you news
i found a method more elegant to solve this problem by using ZigZagPoints from https://www.mql5.com/zh/code/7705 we dodge the problems of dynamic arrays and nested loops
Files:
zigsig.mq4
4 kb
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 try to Save the ZigZag indicator in a table, then creates a new array with non-zero points. It is very simple but I don 't do. I am a beginner in programming.
Here is the code that I wrote to accomplish this task:
If you have any suggestions, advice or links about similar problems ... thank you in advance, wishing you success in trading