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, but there is a possibility to receive the data for the EA).
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;
- ZigZag Close — the ZigZag Close indicator;
- Fractals — the Fractals indicator;
- High-Low of the period — building an indicator by high-low levels. The timeframe is specified in the Period parameter;
- 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;
- Alert when "Line breakout" — alert when the ZigZag level is broken;
- Alert when "Changing the ZigZag direction" — alert when changing direction of ZigZag;
- Alert when "Price is near the line" — alert if the price is near the level (once a bar, the current point of the ZigZag is not checked);
- Distance to the line for alert (points) — distance for alert (in points);
- 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) Code optimization.
2) Added alert when the price is near the line.
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.