NMAZZ
Download scriptThis technical indicator is designed to assist traders in identifying potential trend reversals by analyzing price action through three distinct layers of market data: momentum oscillations, relative strength, and structural price points.
Core Analytical Logic
The script functions by cross-referencing three primary technical components to filter out "noise" and pinpoint high-probability turning points:
1. Structural Price Mapping (ZigZag) At its foundation, the tool utilizes a modified ZigZag calculation. Unlike a standard ZigZag that simply tracks highs and lows, this script uses it as an anchor to identify significant structural peaks and valleys in the market. It focuses on where the price has fundamentally shifted rather than minor fluctuations.
2. Momentum & Strength Filtering (CCI & WPR) To ensure that a price peak or valley is actually a reversal and not just a pause in a strong trend, the script overlays two momentum oscillators:
- Commodity Channel Index (CCI): This measures the current price relative to its average price range. The script looks for extreme overbought or oversold conditions.
- Williams Percent Range (WPR): This measures how far the price is moving toward the extremes of its high-low range for a specific period.
3. The Confirmation Trigger The indicator identifies a "Signal" only when multiple conditions align simultaneously. Specifically, it looks for instances where:
- The price reaches a structural turning point (ZigZag).
- AND the momentum oscillators (CCI and WPR) confirm that the market is significantly overextended in either direction (hitting predefined "Upper" or "Lower" thresholds).
Visual Output and User Experience
- Dynamic Labeling: The script automatically generates a text label on the chart that displays the specific price level of the identified ZigZag point. It intelligently positions this text above or below the current candle to ensure clarity without cluttering the view.
- Visual Signaling: When the logic detects a confirmed reversal signal (where both momentum and structure align), the indicator places a visual marker (a gold dot) on the chart.
- Adaptive Scaling: The tool includes internal logic to detect different types of currency pairs or assets, automatically adjusting its precision settings to ensure that the labels and signals remain consistent regardless of the asset's price magnitude.
Summary for the Trader
In short, this tool is a trend reversal confirmation system. It ignores standard price movements and only alerts the user when the market reaches a structural peak/valley at the same time that momentum indicators suggest the move is exhausted. This helps in identifying potential "exhaustion points" where the price may be about to flip direction.
//+------------------------------------------------------------------+
//| NMAZZ.mq4 |
//+------------------------------------------------------------------+
#property indicator_chart_window
#property indicator_color1 Red
#property indicator_buffers 2
#property indicator_color2 Gold
#include <stdlib.mqh>
extern double depth = 20;
extern double deviation = 5;
extern double backstep = 3;
extern double nBars = 50;
extern double per = 21;
extern double ucci = 200;
extern double mwpr = -15;
extern double bwpr = -85;
int shift = 0;
double zzold = 0;
double fzz = 0;
double zz = 0;
double ccione = 0;
double ccinul = 0;
double sig = 0;
double wprone = 0;
double wprnul = 0;
bool ft = true;
double pr = 4;
double null = 0.0001;
double Buffer1[];
double Buffer2[];
int init()
{
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID);
SetIndexBuffer(0,Buffer1);
SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID);
SetIndexBuffer(1,Buffer2);
return(0);
}
int start()
{
/*Óñîâåðøåíñòââàë èíäèêàòîð ÌÀÇÇ - òåïåðü òàì ãäå ïî åãî è ìîåìó pàçóìåíèþ êîððåêöèè ÇÇ çàêàí÷èâàþòñÿ è íà÷èíàåòñÿ ðàçâîðîò ìåñòíîãî
òðåíäà ïî ÇÇ èíäèêàòîð â âåðøèíå ñòàâèò æ¸ëòóþ òî÷êó. Ìîæåò ðàáîòàòü íà âñåõ ÒÔ,íî óðîâíè óêàçàííûå â íàñòðîéêàõ íàäî ïîäáèðàòü
äëÿ ïàðû è ÒÔ èíäèâèäóàëüíî. Âûêëàäûâàåìûé èíäèêàòîð èìååò íàñòðîéêè äëÿ Ì15- ýòî ïîòîìó,÷òî äåëàë åãî ïîä ñâîþ ìåëêóþ
òîðãîâëþ âíóòðè äíÿ. */
if(ft)
{
if(Point>0.0002) {pr=2;null=0.01;}
ft=false;
}
for(shift=nBars;shift>=0;shift--)
{
if(zz!=0 && zz!=zzold) zzold=zz;
ccione=iCCI(NULL,0,per,PRICE_CLOSE,shift+2);ccinul=iCCI(NULL,0,per,PRICE_CLOSE,shift+1);
wprone=iWPR(NULL,0,per,shift+2);wprnul=iWPR(NULL,0,per,shift+1);
zz=iCustom(NULL,0,"ZigZagS",depth,deviation,backstep,nBars,0,shift);
if(zz!=0) fzz=zz;
if(zz!=0 && (((ccione<-ucci || ccinul<-ucci) && (wprone<bwpr || wprnul<bwpr)) || ((ccione>ucci || ccinul>ucci) &&
(wprone>mwpr || wprnul>mwpr)))) sig=1; else sig=null;
if(sig==1) Buffer2[shift]=zz; else Buffer2[shift]=sig;
if(zz==0) fzz=zzold;
if(zz!=0)
{
zz=NormalizeDouble(zz,pr);
ObjectSetText("ZZ_txt","ZZ="+zz,8,"Arial",White);
if(zz>Close[0])
{
if (ObjectFind("ZZ_txt")!=-1) ObjectMove("ZZ_txt",0,Time[0],zz+5*Point);
else
{
ObjectCreate("ZZ_txt",OBJ_TEXT,0,Time[0],zz+5*Point,0,0,0,0);
ObjectSet("ZZ_txt",OBJPROP_COLOR,White);
}
}
if(zz<Close[0])
{
if (ObjectFind("ZZ_txt")!=-1) ObjectMove("ZZ_txt",0,Time[0],zz-5*Point);
else
{
ObjectCreate("ZZ_txt",OBJ_TEXT,0,Time[0],zz-5*Point,0,0,0,0);
ObjectSet("ZZ_txt",OBJPROP_COLOR,White);
}
}
}
fzz=NormalizeDouble(fzz,pr);
Buffer1[shift]=fzz;
}
return(0);
}
Comments