Have you checked the MqlRates?
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); } } //+------------------------------------------------------------------+
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)
like this:
Is that like multiplatform MT4 code? Gud, I write almost everything multiplatform now.
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?
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" (((.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use