It has been a long time since MetaTrader 5 was released, but MQL products for MetaTrader 4 do still prevail on mql5.com site (both in the codebase, and in the market), and in the Internet in general....
My execution - not quite sure, but it works correctly and seems to make sense
intiBarShift(string symbol,int tf,datetime time,bool exact=false)
{
if(time<0) return(-1);
ENUM_TIMEFRAMES timeframe=TFMigrate(tf);
datetime Arr[],time1;
CopyTime(symbol,timeframe,0,1,Arr);
time1=Arr[0];
if(time1<time){
return(0); /// If the given time is less than the bar opening time
}
if(CopyTime(symbol,timeframe,time,time1,Arr)>0)
{
return(ArraySize(Arr));
}
elsereturn(-1);
}
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
It was created at the same time as the article. But there is no sense in it without trading functions!
I made (posted in kodobase) MQL4 tradingfunctions that work simultaneously with MQL5 trading functions.
Therefore, the emulator may still make sense.
I have made (uploaded to kodobase) MQL4 tradingfunctions that work simultaneously with MQL5 trading functions.
Therefore, there may still be a sense in the emulator.
More on the topic.
I realised that this issue has already been brought up and I need to read another article:) My posts can be deleted
Please tell me what you have realised, what article to read and how to fix the above error?
Here I understand that it is for adding an indicator by the user - that's why I commented...https://www.mql5.com/en/code/16006
Examples
I'm assuming everything
should be changed to
please correct
bool IsTesting()Returns TRUE if an Expert Advisor is running in the testing mode, otherwise returns FALSE.
MQLInfoInteger
bool IsTesting()MQLInfoInteger(MQL_TESTER)Returns TRUE if an Expert Advisor is running in the testing mode, otherwise returns FALSE.
MQLInfoInteger
MQL5_TESTING dont work please change it to MQL_TESTER.iBarShift is not working.
My execution - not quite sure, but it works correctly and seems to make sense
I can't understand how to use the function
The compiler warns
'OBJPROP_TIME1' - undeclared identifier TZ_Sky_and_Ground_V_04.mq5 2891 12
'OBJPROP_TIME1' - constant expression required TZ_Sky_and_Ground_V_04.mq5 2891 12
'OBJPROP_PRICE1' - undeclared identifier TZ_Sky_and_Ground_V_04.mq5 2893 12
'OBJPROP_PRICE1' - constant expression required TZ_Sky_and_Ground_V_04.mq5 2893 12
'OBJPROP_TIME2' - undeclared identifier TZ_Sky_and_Ground_V_04.mq5 2895 12
'OBJPROP_TIME2' - constant expression required TZ_Sky_and_Ground_V_04.mq5 2895 12
'OBJPROP_PRICE2' - undeclared identifier TZ_Sky_and_Ground_V_04.mq5 2897 12
'OBJPROP_PRICE2' - constant expression required TZ_Sky_and_Ground_V_04.mq5 2897 12
'OBJPROP_TIME3' - undeclared identifier TZ_Sky_and_Ground_V_04.mq5 2899 12
'OBJPROP_TIME3' - constant expression required TZ_Sky_and_Ground_V_04.mq5 2899 12
'OBJPROP_PRICE3' - undeclared identifier TZ_Sky_and_Ground_V_04.mq5 2901 12
'OBJPROP_PRICE3' - constant expression required TZ_Sky_and_Ground_V_04.mq5 2901 12