//+------------------------------------------------------------------+
//| ADX Crossing.mq4
//| Amir
//+------------------------------------------------------------------+
#property copyright "Author - Perky"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red
//---- input parameters
extern int CountBars=5350;
extern double Threshold=0.0005;
//---- buffers
double val1[];
double val2[];
double wae1,wae2,wae3,waeup,waedn;
//+------------------------------------------------------------------+
//| 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);
}
//+------------------------------------------------------------------+
//| AltrTrend_Signal_v2_2 |
//+------------------------------------------------------------------+
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--)
{
val1[shift]=EMPTY_VALUE;
val2[shift]=EMPTY_VALUE;
wae1=iCustom(Symbol(),Period(),"waddah_attar_explosion",2,shift+0);
wae2=iCustom(Symbol(),Period(),"waddah_attar_explosion",2,shift+1);
wae3=iCustom(Symbol(),Period(),"waddah_attar_explosion",2,shift+2);
waeup=iCustom(Symbol(),Period(),"waddah_attar_explosion",0,shift);
waedn=iCustom(Symbol(),Period(),"waddah_attar_explosion",1,shift);
Comment (wae1-wae2);
if (wae1-wae2 >=Threshold)
{
if (waeup !=0.00) val1[shift]=Low[shift];
if (waedn !=0.00) val2[shift]=High[shift];
}
}
return(0);
}
//+------------------------------------------------------------------+
Comments