Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
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);
}
//+------------------------------------------------------------------+