How do I get Open,Low,High,Close parameters in MQL5?

 
I can't figure out how to do this. Where do I look for the answer? Who knows, please explain.
 
I looked in SymbolInfoDouble, but there are no such properties there. In MqlTick structure there are only tick parameters. I didn't find any bar structure.
 
Reference:CopyRates
 
<br / translate="no">

Have you checked the MqlRates?

 
Vladimir Karputov:
Reference:CopyRates
Thank you.
 
jaffer wilson:

Have you checked the MqlRates?

Thank you, I'll look into it now.
 
And iClose, iOpen, iHigh - don't they work?
 
Реter Konow:
how to do it

like this:

#property strict

#define  Time(n)   iTime(NULL,0,n)
#define  Open(n)   iOpen(NULL,0,n)
#define  High(n)   iHigh(NULL,0,n)
#define  Low(n)    iLow(NULL,0,n)
#define  Close(n)  iClose(NULL,0,n)

//+------------------------------------------------------------------+
void OnStart()
  {
   for(int i=0;i<10;i++)
     {
      ResetLastError();
      Print("Bar№ ",i," : ",Time(i)," , O = ",Open(i)," , H = ",High(i)," , L = ",Low(i)," , C = ",Close(i));
      int err=GetLastError();
      if(err>0) Print("Error № ",err);
     }
  }
//+------------------------------------------------------------------+
 
Igor Makanu:

like this:


#property strict


This is unnecessary in MQL5.


And this is how those who

#define  Time(n)   iTime(NULL,0,n)
#define  Open(n)   iOpen(NULL,0,n)
#define  High(n)   iHigh(NULL,0,n)
#define  Low(n)    iLow(NULL,0,n)
#define  Close(n)  iClose(NULL,0,n)

love to run into hidden errors (in general, all those who are too lazy to do basic checks)

 
Igor Makanu:

like this:

Is that like multiplatform MT4 code? Gud, I write almost everything multiplatform now.

 
Vladimir Karputov:

likes to get caught up in hidden mistakes (in general, all those who are too lazy to do basic checks)

What are we talking about?


Alexey Volchanskiy:

Is it like a multiplatform MT4 code? Good, I write almost everything multiplatform now.

unfortunately this is a forced measure... i can't afford to write kilometres of code )))) - seriously, i like my code to be readable (self-documented)

SZZY: The moderator here teaches wisdom. Again I am forced to write the code with post-checks - I asked last year to Abort() or Halt() - to exit the MQL-program, for there is no point in doing something in the code on the incoming tick if the historical data, terminal environment variables, etc., are not available. But the specialists who arrived shouted "no need - because there's no need" (((.