Download MetaTrader 5

What is mrate[0].close value a the very begining of the current bar ?

To add comments, please log in or register
sprat
411
sprat  

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
12580
Biantoro Kunarto  

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