
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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);
}
//+------------------------------------------------------------------+