in the above portion of code the algorithm seemed to work well and I was having valid peaks being stored in the array
However in the above code when i tried to access the arrays to draw small lines that identified peaks in the market I noticed two things:
1. Some of the peaks being drawn on the screen where not stored in some of the iterations where the array was printed this lead me to conclude that for some odd reason some iterations of the code failed to identify and store some valid peaks and because of this,
2. When the algorithm attempts to draw trendlines, sometimes it draws accurate lines while sometimes it fails to do so but draws invalid trendlines using a pare of peak points that do not match.
Iv'e been trying to find the cause of this problem for months now but I don't seem to see any problem in the logic or syntax of my code. Please I could use some help in solving this problem and if there is some other way to write this code i'll be happy to hear it.
Please consider which section is most appropriate — https://www.mql5.com/en/forum/172166/page6#comment_49114893
Sorry for the late response
In that image the last high trendline(the one marked blue) my EA drew wasn't supposed to be that way it was supposed to span between the peaks I marked as blue but instead it started at a point far away from it. The same happens at the trendline I marked as red.
Forum on trading, automated trading systems and testing trading strategies
How to make an mql5 code that identifies peaks and draws accurate trendlines
amrali, 2024.02.03 09:37
The ZigZag indicator is the best option to identify trends.in the above portion of code the algorithm seemed to work well and I was having valid peaks being stored in the array
However in the above code when i tried to access the arrays to draw small lines that identified peaks in the market I noticed two things:
1. Some of the peaks being drawn on the screen where not stored in some of the iterations where the array was printed this lead me to conclude that for some odd reason some iterations of the code failed to identify and store some valid peaks and because of this,
2. When the algorithm attempts to draw trendlines, sometimes it draws accurate lines while sometimes it fails to do so but draws invalid trendlines using a pare of peak points that do not match.
Iv'e been trying to find the cause of this problem for months now but I don't seem to see any problem in the logic or syntax of my code. Please I could use some help in solving this problem and if there is some other way to write this code i'll be happy to hear it.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
in the above portion of code the algorithm seemed to work well and I was having valid peaks being stored in the array
However in the above code when i tried to access the arrays to draw small lines that identified peaks in the market I noticed two things:
1. Some of the peaks being drawn on the screen where not stored in some of the iterations where the array was printed this lead me to conclude that for some odd reason some iterations of the code failed to identify and store some valid peaks and because of this,
2. When the algorithm attempts to draw trendlines, sometimes it draws accurate lines while sometimes it fails to do so but draws invalid trendlines using a pare of peak points that do not match.
Iv'e been trying to find the cause of this problem for months now but I don't seem to see any problem in the logic or syntax of my code. Please I could use some help in solving this problem and if there is some other way to write this code i'll be happy to hear it.