//------------------------------------------------------------------
#property copyright "www.forex-station.com"
#property link      "www.forex-station.com"
//------------------------------------------------------------------
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 clrDeepSkyBlue
#property indicator_style1 STYLE_DOT

extern int TimeZoneOfData =0;
extern int BarsToCalculate=0;
double TodayOpenBuffer[];
//------------------------------------------------------------------
//
//------------------------------------------------------------------
int init()
{
	SetIndexBuffer(0,TodayOpenBuffer);return(0);
}
int deinit() {	return(0);}
int start()
{
   int counted_bars=IndicatorCounted();
      if(counted_bars<0) return(-1);
      if(counted_bars>0) counted_bars--;
         int limit = (BarsToCalculate>0) ? MathMin(Bars-counted_bars,MathMin(Bars-1,BarsToCalculate)) : MathMin(Bars-counted_bars,Bars-1);

   for(int i=limit; i>=0; i--) TodayOpenBuffer[i] = iOpen(NULL,PERIOD_D1,iBarShift(NULL,PERIOD_D1,Time[i]+TimeZoneOfData*3600));
   if (BarsToCalculate>0) SetIndexDrawBegin(0,Bars-BarsToCalculate-1);
   return (0);
}