Download MetaTrader 5
To add comments, please log in or register
Let your idle PCs do something useful. Join MQL5 Cloud Network!
sprat
411
sprat 2012.04.20 08:03 

Hi there,

Can someone give me a clear view on the folllowing ?.

 MqlRates mrate[];

///--- copying data of the last 3 bars
  if(CopyRates(_Symbol,_Period,0,3,mrate)<0)
{
Alert("Historical quote copy error - error: ",GetLastError(),"!!");
return;

Bar_time[0]=mrate[0].time;
//--- if both time values are equal, there is no new bar
if(Prev_time==Bar_time[0]) return;

 //--- new bar

Prev_time=Bar_time[0]; 

 

//--- do something here then with mrate[0].close 

 

At this stage of the code execution what is in mrate[0].close ? (I mean the current bar is never closed, no ?)

Thank you for your comments ! 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Data Structures / History Data Structure
  • www.mql5.com
Standard Constants, Enumerations and Structures / Data Structures / History Data Structure - Documentation on MQL5
Biantoro Kunarto
14806
Biantoro Kunarto 2012.04.21 02:19  

mrate[0].close show the last price in the chart even the current bar isn't closed yet..
sprat
411
sprat 2012.04.30 15:29  
Ok, thanks for your comment.
/
To add comments, please log in or register