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 attached AutoScaleZZ2_fixed.mq5
Apparently, in AutoScaleZZ2_fixed.mq5 in MT5 the highlighted line does not work correctly. Because when moving a high point, the previous value of the point remains in the buffer (but must be cleared).
I don't know why this is happening. I couldn't figure out the reason quickly, I don't have enough free time to figure out the reason, sorry.
Apparently, in AutoScaleZZ2_fixed.mq5 in MT5 the highlighted line does not work correctly. Because when moving a high point, the previous value of the point remains in the buffer (but must be cleared).
Here's a visual demonstration. See the data window - multiple values in a row in the "High Point ZZ" buffer. That's why it's not displaying correctly.
that line you highlighted is indeed not working as it should, it caused an exception every time for me. You can force it to work by insuring the previous bar index is always a positive number (and then clear the value of the buffer with that index), but even though this would work, it will cause the zigzag to look odd
Using 0.0 as an empty value of an indicator buffer is a bad idea if the indicator stores bar indexes in buffers. And storing bar indexes in buffers is also a bad idea. I would rather write from scratch instead of converting this (but I don't have time for that). Because it's someone else's complex code. Your own complex code will always be clearer and more debuggable than someone else's complex code.
Your own complex code will always be clearer and more debuggable than someone else's complex code.
Wise words. I removed the logic of 0.0 (which also means NULL in this framework), and went back to EMPTY_VALUE. I have things working correctly for MT5 now, I may not have it built in cross-platform, but I'm happy enough as long as there is both a working MT4 and MT5 implementation.
I have a correctly working series version now if you're interested. Indexing is more delicate, and a decremental loop is needed in the main calculation loop.
(btw this zigzag is only built to work on currency pairs)
(btw this zigzag is only built to work on currency pairs)
Why? It's just a derivative of the price. You can build it even on a cardiogram
Why? It's just a derivative of the price. You can build it even on a cardiogram