Hi everybody,
I am developing my first EA and maybe some of you could help me.
What I want to do is quite simple but I dont know how to write itin mql5.
I just want to get the latest price as quickly as possible (here every 16ms for example). This my current code
input int shift=0;
void OnInit () {EventSetMillisecondTimer (16);}
void OnTimer ()
{
datetime time = iTime(Symbol(),PERIOD_M1,shift);
double open = iOpen(Symbol(),PERIOD_M1,shift);
double high = iHigh(Symbol(),PERIOD_M1,shift);
double low = iLow(Symbol(),PERIOD_M1,shift);
double close = iClose(Symbol(),PERIOD_M1,shift);
Print( //"Time: " ,TimeToString(time,TIME_DATE|TIME_SECONDS),"\n",
"Heure bougie : " ,time,"\n",
"Open: " ,open,"\n",
"High: " ,high,"\n",
"Close: " ,close,"\n",
"Low: " ,low);
}
But this code is always collecting data from EURUSD with H1 period, even if this chart is not displayed before running the code.
So how to change it to get data from Google (#GOOG) for example or another share on a minute basis (M1).
Thank you very much for your help !