Look for 00GMT

 

Hallo Everybody,

I've problem with my Meta4 programming. I need to get price at 00GMT for today and last day ( Open, High, Low, Close ).

Here's the program, it's draw vertikal line at 00 GMT.

extern int GMT=00;

#property indicator_chart_window

int objCount;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

//---- indicators

objCount=0;

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator deinitialization function |

//+------------------------------------------------------------------+

int deinit()

{

//----

for (int i=0; i<objCount;i++){

ObjectDelete("hor"+i);

}

//----

return(0);

}

//+------------------------------------------------------------------+

//| Custom indicator iteration function |

//+------------------------------------------------------------------+

int start()

{

//----

int counted_bars=IndicatorCounted();

int limit, i;

int x;

//---- indicator calculation

if (counted_bars==0)

{

x=Period();

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

}

if(counted_bars<0) return(-1);

limit=(Bars-counted_bars)-1;

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

{

if (TimeHour(Time)==GMT && TimeMinute(Time)==0)

{

ObjectCreate("hor"+objCount,OBJ_VLINE,0,Time,0);

ObjectSet("hor"+objCount,OBJPROP_BACK,true);

ObjectSet("hor"+objCount,OBJPROP_STYLE,STYLE_DOT);

ObjectSet("hor"+objCount,OBJPROP_COLOR,LightGreen);

objCount++;

}

}

//----

return(0);

}

//+------------------------------------------------------------------+

 

Try to use iOpen iClose iHigh iLow functions. U can specify to take it daily price like that:

iOpen (NULL,60,iBarShift(NULL,60,StrToTime(Year(),".",Month(),".",Day()," 00:00"))) //open from current day

Reason: