tinivini :
Hello . I calculate ZigZag indicator value with this method , but it's very slow in Backtest . How can I optimize this code? Or if you know a better way, please help.
I wrote the code based on my knowledge .
this code work fine but it's very slow , i need only 5 pivot data , for this after find 5 value use "break" and I get out of the loop .
A very gross mistake: the MQL5 style implies that the handle (in this example 'ZZ_handle') should be created ONLY ONCE and should be done in OnInit. Please fix your 'read_ZigZag' function.

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
Hello . I calculate ZigZag indicator value with this method , but it's very slow in Backtest . How can I optimize this code? Or if you know a better way, please help.
I wrote the code based on my knowledge .
this code work fine but it's very slow , i need only 5 pivot data , for this after find 5 value use "break" and I get out of the loop .