Ideal Zig Zag
This professional-grade solution for MetaTrader 5 helps traders achieve greater efficiency in their daily workflow. This technical indicator acts as a specialized analysis tool designed to visualize market data. It helps traders identify emerging trends, momentum shifts, and key support or resistance levels by plotting statistical calculations directly onto price charts.
How to Setup and Use Ideal Zig Zag
1. Installation: Place your file in the MQL/Indicators folder via "Open Data Folder" and restart your terminal.
2. Loading: Find the indicator in the Navigator, drag it onto your chart, and configure the input parameters in the popup window.
3. Customization: Press Ctrl+I to open the indicator list, select your tool, and click "Properties" to change colors, levels, or visual styles.
4. Updating: Replace the old file in the Indicators folder with the new version and restart the platform to apply changes.
Frequently Asked Questions
Q: Why is my indicator not showing? A: Verify the file is in the MQL/Indicators folder, or try right-clicking the "Indicators" tree in the Navigator and clicking "Refresh."
Q: Do custom indicators slow down the platform? A: Too many complex indicators can impact performance; remove unused ones via the "Indicator List" (Ctrl+I).
Q: Can I use MT4 indicators on MT5? A: No, MQL4 and MQL5 are distinct languages; ensure the indicator is compiled specifically for your platform version.
Description & Settings
This is a simple but very fast zigzag.
No suspended or wrong peaks. Peaks retrieval has been time-optimized.
Advantages:
The most expensive function in calculations is iBarShift. It totally replaces all cycles needed for peaks retrieval. Therefore, it has been replaced by ArrayBSearch. It means that the indicator will be more efficient than its MQL4 equivalent;
All necessary data for each bar is accessible not only in every moment but also available to EA for any moment in history;
No suspended picks;
Efficient method to find peaks without searching the indicator values;
Very fast;
Works correctly at history insertions and when switching timeframes;
Perfect for use in EAs.
Disadvantages
:
Memory requirements. ZigZag needs 2 buffers (one is not enough because of lags) for correct drawing, while 5 buffers are used here. In my opinion, this drawback is completely outshined by advantage #6. None of fast ZigZags can correctly process history insertions on two buffers.
Additional lines are available. This is required to make the data visible to an Expert Advisor. These lines should never be visible.
Principle:
ZigZag is drawn by the channeling principle. The channel width can be defined in points (IdealZZ) or in percentage terms (IdealZZP)
Peaks retrieval:
This example is an indicator that marks (one time per bar) first five peaks (including the current forming one).
Attention! The code may work incorrectly, if zero bar mode is enabled
Zero Bar Mode:
The mode can be enabled in DrawZeroBar variable code. It is disabled by default. It is not recommended to enable it, especially if the indicator is used in an Expert Advisor.
Enjoy using it. Please inform me of any revealed drawbacks.