kdjalert





#property indicator_separate_window
#property indicator_minimum 0
#property indicator_maximum 100
#property indicator_buffers 8

#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Blue
#property indicator_color4 Salmon
//#property indicator_color5 Yellow
//#property indicator_color6 White

#property indicator_width1 1
#property indicator_width2 1
#property indicator_width3 1
#property indicator_width4 1
//#property indicator_width5 1
//#property indicator_width6 1


extern int TimeFrame=0;

//---- buffers
double k1[];
double k5[];
double k15[];
double d1[];
double d5[];
double d15[];
double jc[];
int xx[];


int init()
  {
   
   IndicatorBuffers(8);
   
   SetIndexBuffer(0, jc);
   SetIndexStyle (0,DRAW_LINE,STYLE_SOLID, indicator_width1, indicator_color1);
   SetIndexDrawBegin(0,100);
   SetIndexBuffer(1, k1);
   SetIndexStyle (1,DRAW_NONE,DRAW_NONE);
   SetIndexBuffer(2, d1);
   SetIndexStyle (2,DRAW_NONE,DRAW_NONE);
   SetIndexBuffer(3, k5);
   SetIndexStyle (3,DRAW_NONE,DRAW_NONE);
   SetIndexBuffer(4, d5);
   SetIndexStyle (4,DRAW_NONE,DRAW_NONE);   
   SetIndexBuffer(5, k15);
   SetIndexStyle (5,DRAW_NONE,DRAW_NONE);
   SetIndexBuffer(6, d15);
   SetIndexStyle (6,DRAW_NONE,DRAW_NONE);   
   SetIndexBuffer(7, xx);
   SetIndexStyle (7,DRAW_NONE,DRAW_NONE); 
   
   
//---- name for DataWindow and indicator subwindow label   
   switch(TimeFrame)
      {
         case 1 : string TimeFrameStr="Period_M1"; break;
         case 5 : TimeFrameStr="Period_M5"; break;
         case 15 : TimeFrameStr="Period_M15"; break;
         case 30 : TimeFrameStr="Period_M30"; break;
         case 60 : TimeFrameStr="Period_H1"; break;
         case 240 : TimeFrameStr="Period_H4"; break;
         case 1440 : TimeFrameStr="Period_D1"; break;
         case 10080 : TimeFrameStr="Period_W1"; break;
         case 43200 : TimeFrameStr="Period_MN1"; break;
         default : TimeFrameStr="Current Timeframe";
      } 
   IndicatorShortName("multi-bd "+TimeFrameStr);  
   return(0);
  }

int start()
  {
   datetime TimeArray[];
   int    w,jc,i,shift,limit,y=0,counted_bars=IndicatorCounted();
     
	 TimeFrame=15; 
   ArrayCopySeries(TimeArray,MODE_TIME,Symbol(),TimeFrame); 
   
   limit=Bars-counted_bars;
   for(i=0,y=0;i<limit;i++)
	   {
	  	 if (Time[i]<TimeArray[y]) y++; 
	
		   k15[i]=iCustom(NULL,PERIOD_M15,"kdj",0,y);
		   d15[i]=iCustom(NULL,PERIOD_M15,"kdj",1,y);	 	   
	   }  
     
	 for(i=0; i<limit-100; i++)
		 {
			 	w=i+1;
			 	while(k15[w]==k15[i]) w++;
			 	
			 	if(k15[i]>=d15[i] && k15[w]<d15[w] ) jc[i]=1;
			 		else if(k15[i]<=d15[i] && k15[w]>d15[w] ) jc[i]=-1;
			 			else jc[i]=0;
		 }
	  

   return(0);
  }



Sample





Analysis



Market Information Used:

Series array that contains open time of each bar


Indicator Curves created:



Indicators Used:




Custom Indicators Used:
kdj

Order Management characteristics:

Other Features: