вопрос

 
Добрый день Всем!
У меня такой вопрос:
есть переделанный индикатор из Day Open в Month Open, но он почему то не открывается в дневном, недельном, месячном графике. Что нужно исправить, чтобы устранить эту ошибку? Код ниже:

 //+------------------------------------------------------------------+
//|                                                        DayOpen.mq4 |
//|                               
//+------------------------------------------------------------------+
#property copyright "orBanAway"
#property link      ""

#property indicator_chart_window
//#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red

//---- input parameters

//---- buffers
double PBuffer[];
string Pivot="";
int fontsize=10;
double P;
double x;

//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here

   ObjectDelete("");

//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;


//---- indicator line
   SetIndexStyle(0,DRAW_LINE,0,2,Red);
   SetIndexBuffer(0,PBuffer);



//---- name for DataWindow and indicator subwindow label
   short_name="Daily Open";
   IndicatorShortName(short_name);
   SetIndexLabel(0,short_name);

//----
   SetIndexDrawBegin(0,1);
//----
 

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

//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()

  {
   int    counted_bars=IndicatorCounted();

   int limit, i;
//---- indicator calculation
if (counted_bars==0)
{
   x=Period();
   if (x>240) return(-1);
   ObjectCreate("", OBJ_TEXT, 0, 0,0);
   ObjectSetText("", "                 Daily Open",fontsize,"Arial",Red);
}
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
//   if(counted_bars>0) counted_bars--;
   limit=(Bars-counted_bars)-1;



for (i=limit; i>=0;i--)
{ 


if (TimeMonth(Time[i])!=TimeMonth(Time[i+1])) 
   { 
   P=(Open[i]);

   ObjectMove("Daily Open", 0, Time[i],P);
   }
   
    PBuffer[i]=P;

}

//----
   return(0);
  }
//+------------------------------------------------------------------+
 
bar:

   if (x>240) return(-1);
 

Добрый день Виктор!

Спасибо!

Причина обращения: