ZigZag Lines MTF
Multitimeframe ZigZag indicator. It displays the support/resistance lines and their breakouts, as well as draws the current targets of the market. It can also display lines of the Fractals indicator and candles from other periods (up to Quarterly).
The indicator redraws the last (current) point, and in some cases can change the last 2-3 points.
This version is for MT4 only.
All lines are drawn as objects (not indicator buffers).
When used in an Expert Advisor, you can read ZigZag points using iCustom. For this you need to specify the number of points in the very first parameter. The current (last) point will have an index of 0, the previous index of 1, etc.
//Calculate the last "10" points, and find out the current price-time. double price_0=iCustom(_Symbol,_Period,"ZigZagLines","10",0,Depth,Deviation,Backstep,0,0); datetime start_time_0=(datetime)iCustom(_Symbol,_Period,"ZigZagLines","10",0,Depth,Deviation,Backstep,1,0); datetime end_time_0=(datetime)iCustom(_Symbol,_Period,"ZigZagLines","10",0,Depth,Deviation,Backstep,2,0);
- Mode — draw support and resistance levels based on:
- Zig Zag — the ZigZag indicator;
- Fractals — the Fractals indicator;
- Candles only — draw only Candles;
- Depth — the minimum number of candlestick, for which Zigzag will not draw the second maximum (or minimum), if the last one is Deviation less (or greater) than the previous one;
- Deviation — the minimum number of points between the Highs/Lows of two adjacent candlesticks for the Zigzag to form a local top/bottom;
- Backstep — the minimum number of candlesticks between the local Highs/Lows;
- Period — period for calculation of ZigZag of Fractals;
- Max bars to calculate (bars) — the maximum number of bars for calculation. This limitation is introduced to speed up the calculations;
- Show Zigzag — show the ZigZag;
- Show current ZZ-point (redrawing point) — show current (last) point;
- Show Price — show the price of the levels;
- Show Targets — show the current targets (where the market is headed);
- Show broken lines) — show the broken levels;
- Extend broken lines (bars) — extend the broken lines to the right by the specified number of bars;
- Show Dot at the start of the line — display dots at the turning points of the indicator;
- Pop up alerts — pop-up alert when touching a level;
- Push notifications — Push-notification;
- E-mail notifications — notification by e-mail;
- Sound alert — sound alert when touching a level;
- Add an alert when changing the ZigZag direction — additional alert when changing direction of ZigZag;
- Upper line color — color of the upper lines;
- Lower line color — color of the lower lines;
- Main line width — width of the main line;
- Main line style — style of the main line;
- Used line width — width of the used line;
- Used line style — style of the used line;
- Font size price — font size for the Prices;
- Font size dot — font size for the Dots;
- ZigZag color — color of the ZigZagа;
- ZigZag width — width of the ZigZag lines;
- ZigZag style — style of the ZigZag lines;
- Display candles — enable the display of candles from other periods;
- Candles period — period for the candles, all standard ones plus Quarterly;
- Number of Candles in the past — the number of candles on the chart;
- Shadow color — candle of the candle wicks;
- Body color (bullish) — body candle of a bullish candle;
- Body color (bearish) — body color of a bearish candle;
- Save points to global variables — store points in the Global Variables of the terminal;
- Number of points to be stored — number of points to be stored (current point is zero);
- Prefix global variables — prefix for Global Variable names.
2) Added options for saving points in the Global Variables. Now you can read the coordinates of points using EA.
3) Code optimization.
4) Fixed bug of double fractal.
2) Added the option ti disable dots at the beginning of lines using "Dot at the start of line". Also, there is an option to set the size of these dots using "Font size dot".
3) Now you can run several instances of the indicator in one window.
4) Code optimization.
2) Fixed minor bugs.
2) Small fixes.