a_Nina_v1





/*-----------------------------+
|			       |
| Shared by www.Aptrafx.com    |
|			       |
+------------------------------*/

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Blue
#property indicator_color2 Red

//---- input parameters
extern int PeriodWATR=10;
extern double Kwatr=1.0000;
extern int HighLow=0;
extern int cbars = 1000;
extern int from  = 0;
extern int period  = PERIOD_M30;


//---- indicator buffers
double LineBuyBuffer[];
double LineSellBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init(){
   string short_name;
//---- indicator line
   SetIndexStyle(0,DRAW_ARROW,STYLE_SOLID,2);
   SetIndexStyle(1,DRAW_ARROW,STYLE_SOLID,2);
   
   SetIndexEmptyValue(0,0);
   SetIndexArrow(0,233);
   
   SetIndexEmptyValue(1,0);
   SetIndexArrow(1,234);
   SetIndexBuffer(0,LineBuyBuffer);
   SetIndexBuffer(1,LineSellBuffer);
//---- name for DataWindow and indicator subwindow label
   short_name="NinaX";
   IndicatorShortName(short_name);

//----
   return(0);
  }

int start(){
   int i,b,f = iBarShift(NULL,period,Time[from]),l = 0;
   ArrayInitialize(LineBuyBuffer,0);
   ArrayInitialize(LineSellBuffer,0);
   
   for(i=cbars-1;i>=from;i--){	
      b = iBarShift(NULL,period,Time[i]);
      if(l==b){
         LineBuyBuffer[i]  = 0;
         LineSellBuffer[i] = 0;
         }
      else{
         l = b;
         LineBuyBuffer[i]  = iCustom(NULL,period,"aNina",PeriodWATR,Kwatr,HighLow,cbars,f,2,b);
         if(LineBuyBuffer[i]!=0) LineBuyBuffer[i] = Low[i]-10*Point;
         LineSellBuffer[i] = iCustom(NULL,period,"aNina",PeriodWATR,Kwatr,HighLow,cbars,f,3,b);
         if(LineSellBuffer[i]!=0) LineSellBuffer[i] = High[i]+10*Point;
         }
	   }
	return(0);	
 }





Sample





Analysis



Market Information Used:

Series array that contains open time of each bar
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:
aNina

Order Management characteristics:

Other Features: