//+------------------------------------------------------------------+ //| Wilder ADX Cross.mq4 | //| Amir code baded | //+------------------------------------------------------------------+ #property copyright "" #property indicator_chart_window #property indicator_buffers 2 #property indicator_color1 Blue #property indicator_width1 2 #property indicator_color2 Tomato #property indicator_width2 2 //---- input parameters extern int MA_Length = 1; // Period of additional smoothing extern int DMI_Length = 14; // Period of DMI extern int ADX_Length = 14; // Period of ADX extern int ADXR_Length = 14; // Period of ADXR extern int CountBars=2600; //---- buffers double val1[]; double val2[]; double b4plusdi,nowplusdi,b4minusdi,nowminusdi; //+------------------------------------------------------------------+ //| Custom indicator initialization function | //+------------------------------------------------------------------+ int init() { string short_name; //---- indicator line IndicatorBuffers(2); SetIndexStyle(0,DRAW_ARROW); SetIndexArrow(0,108); SetIndexStyle(1,DRAW_ARROW); SetIndexArrow(1,108); SetIndexBuffer(0,val1); SetIndexBuffer(1,val2); //---- return(0); } //+------------------------------------------------------------------+ //| | //+------------------------------------------------------------------+ int start() { if (CountBars>=Bars) CountBars=Bars; SetIndexDrawBegin(0,Bars-CountBars); SetIndexDrawBegin(1,Bars-CountBars); int i,shift,counted_bars=IndicatorCounted(); //---- check for possible errors if(counted_bars<0) return(-1); //---- initial zero if(counted_bars<1) { for(i=1;i<=CountBars;i++) val1[CountBars-i]=0.0; for(i=1;i<=CountBars;i++) val2[CountBars-i]=0.0; } for (shift = CountBars; shift>=0; shift--) { b4plusdi=iCustom(NULL,0,"WildersDMI_v1.1",MA_Length,DMI_Length,ADX_Length,ADXR_Length,1,shift+1); nowplusdi=iCustom(NULL,0,"WildersDMI_v1.1",MA_Length,DMI_Length,ADX_Length,ADXR_Length,1,shift); b4minusdi=iCustom(NULL,0,"WildersDMI_v1.1",MA_Length,DMI_Length,ADX_Length,ADXR_Length,2,shift+1); nowminusdi=iCustom(NULL,0,"WildersDMI_v1.1",MA_Length,DMI_Length,ADX_Length,ADXR_Length,2,shift); if (b4plusdi<b4minusdi && nowplusdi>nowminusdi) { val1[shift]=Low[shift]-5*Point; } if (b4plusdi>b4minusdi && nowplusdi<nowminusdi) { val2[shift]=High[shift]+5*Point; } } return(0); } //+-------------------------------------------------------------------------------------+
Sample
Analysis
Market Information Used:
Series array that contains the lowest prices of each bar
Series array that contains the highest prices of each bar
Indicator Curves created:
Implements a curve of type DRAW_ARROW
Indicators Used:
Custom Indicators Used:
WildersDMI_v1.1
Order Management characteristics:
Other Features: