Navigation´╝ÜHome > Content >

DayOpenFib.mq4

Time: 2017-01-28 | Download file:DayOpenFib.mq4

//+------------------------------------------------------------------+
//|                                                  DayOpenFib.mq4 |
//|                                                                  |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright ""
#property link      ""

#property indicator_chart_window
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
#property indicator_buffers 6
#property indicator_color1 Red
#property indicator_color2 Green
#property indicator_color3 Green
#property indicator_color4 Green
#property indicator_color5 Green
#property indicator_color6 Green


double yc[];
double l1[]; //38
double l2[]; //89
double l3[]; //144
double l4[]; //233
//double l5[]; //233

extern int  HowManyDays = 100;
extern bool up=true;

int init()
  {
//---- indicators
//----
   SetIndexBuffer(0, yc); 
   SetIndexStyle(0, DRAW_LINE, STYLE_SOLID);
   SetIndexLabel(0, "Yesterday Close");
   SetIndexBuffer(1, l1);
   SetIndexStyle(1, DRAW_LINE);
   SetIndexLabel(1, "Line 1");
   SetIndexBuffer(2, l2); 
   SetIndexStyle(2, DRAW_LINE);
   SetIndexLabel(2, "Line 2");
   SetIndexBuffer(3, l3); 
   SetIndexStyle(3, DRAW_LINE);
   SetIndexLabel(3, "Line 3");
   SetIndexBuffer(4, l4); 
   SetIndexStyle(4, DRAW_LINE);
   SetIndexLabel(4, "Line 4");
   //SetIndexBuffer(5, l5); 
   //SetIndexStyle(5, DRAW_LINE);
   //SetIndexLabel(5, "Line 5");
       
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int i=0,j=0;
   int counted_bars=IndicatorCounted();
//---- check for possible errors
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//----
   datetime dailyTime[];
   double dailyClose[],dailyOpen[];
   bool newEndDay=false;
   
   ArrayCopySeries(dailyTime,MODE_TIME,Symbol(),PERIOD_D1);  
   ArrayCopySeries(dailyOpen,MODE_OPEN,Symbol(),PERIOD_D1);
   
  
   
   for (i=0;i        

Recommend