I started to doubt a lot about the functionality of this design. No matter how hard I tried to understand the logic of the block, I couldn't (and I tried hard)....
What is the doubt? It counts correctly.
//+------------------------------------------------------------------+//|test.mq5 |//+------------------------------------------------------------------+#include <InitMQL4.mqh>double close[];
int total,count;
datetime time[];
//+------------------------------------------------------------------+//||//+------------------------------------------------------------------+voidOnStart()
{
count=Bars(_Symbol,_Period);
total=CopyClose(_Symbol,_Period,0,count,close);
total=CopyTime(_Symbol,_Period,0,count,time);
ArraySetAsSeries(time,true);
ArraySetAsSeries(close,true);
int N=7;
int shift=iBarShiftMQL4(_Symbol,_Period,time[N]);
Print("TIME",time[N],"BAR=",shift," CLOSE=",close[shift]);
}
//+------------------------------------------------------------------+int iBarShiftMQL4(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(CopyTime(symbol,timeframe,time,time1,Arr)>0)
return(ArraySize(Arr)-1);
elsereturn(-1);
}
//+------------------------------------------------------------------+
Again, have you read about the function you're writing about???
on mcl4 it is written exactly
double iClose(
string symbol, int timeframe, int shift)
Returns the value of the closing price of the bar from the corresponding chart(symbol, timeframe) specified by the shift parameter. In case of an error, the function returns 0. To get more information about the error, call the GetLastError() function. For the current chart, the information about closing prices is in the predefined Close[] array.
Because if you open it, the question arises, and the meaning of the above written????.
and also at least collect the functions for which all questions are solved and proceed to study errors in the rest.
There are a lot of solutions on this topic in private libraries for a long time.
I, for example, have been using IsTesting() and similar things from the very beginning, also everything has been solved with date and time for a long time (of course, there are other solutions)....
Another thing is the presence of such "Outdated solutions" in MT5 itself...
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.
I started to doubt a lot about the functionality of this design. No matter how hard I tried to understand the logic of the block, I couldn't (and I tried hard)....
What is the doubt? It counts correctly.
What's the problem? He's counting correctly.
And now for the hocus-pocus
1. In MT4 we write this line and execute the code on H4
Then we do the same with MT5 and the string.
as a result we get 8.
2. After that we do exactly the same operation, but with D1.
As a result MT4 returns - 1 and MT5 returns 0.
Now who can tell me how much this implementation of iBarShiftMQL4 corresponds to the necessary...
Try this one:
Again, have you read about the function you're writing about???
on mcl4 it is written exactly
For the current chart, the information about closing prices is in the predefined Close[] array.
and you have....
what are the moderators looking at...
Thanks, CoreWinTT.
Fixed functions: iClose, iLow, iHigh, iOpen, iTime, iVolume. They return 0 instead of -1 in case of error.
and when will they be in the library???
so that they were at least
Because if you open it, the question arises, and the meaning of the above written????.
and also at least collect the functions for which all questions are solved and proceed to study errors in the rest.
the other day, someone suggested a clever means of creating an μl4 environment
by using arrays of
but it will be difficult to use them because they have const state.
You can't create global buffers
because they must be declared with the help of
SetIndexBuffer
Associates the specified indicator buffer with a one-dimensional dynamic array of type double declared globally.
but only double type, and volumes and arrays of date-time type will not pass.
The only thing left is to initiate these arrays inside the mql4 module.
which is practically equal to rewriting the indicator....
and when will they be in the library???
and when will they be in the library???
so that they were at least
Because if you open it, the question arises, and the meaning of the above written????.
and also at least collect the functions for which all questions are solved and proceed to study errors in the rest.
There are a lot of solutions on this topic in private libraries for a long time.
I, for example, have been using IsTesting() and similar things from the very beginning, also everything has been solved with date and time for a long time (of course, there are other solutions)....
Another thing is the presence of such "Outdated solutions" in MT5 itself...