Please tell me how to avoid the influence of weekends when there are no bars. Suppose the bar numbers are calculated using the formulas:
nti1=(Time[0]-t1)/60/Period();
inti2=(Time[0]-t2)/60/Period();
And the number of bars between i1 and i2 equals the difference between them. That is: Number of bars = i1-i2. But if i1 and i2 fall between weekends then the number of bars will be calculated taking into account the bars that do not exist on Saturday and Sunday. How do I get out of this situation?
This code is executed on every tick, i.e. at the arrival of every tick All elements of arrays Rel,. from Bars to zero are assigned some value. (By the way, there is no element with the number Bars, the last index in the array is Bars-1 - this should be remembered)
Now for the non-drawing.
We need to find out where the error is. First, I suggest that we look at what values the i index takes and what the rsi() function outputs. Since there is no debugger in ME, we have to use echo, i.e. Print().
..on each tick All elements of Rel,... from Bars to zero are assigned some value.
Now about the non-drawing.
We need to find out where the error is. First, I suggest that we look at what values the i index takes and what rsi() function outputs at that. Since there is no debugger in ME, we can use echo, i.e. Print().
"Bars to zero" I've already fixed) I'm always reading and fixing things.
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.
Please tell me how to avoid the influence of weekends when there are no bars. Suppose the bar numbers are calculated using the formulas:
nt i1=(Time[0]-t1)/60/Period();
int i2=(Time[0]-t2)/60/Period();
And the number of bars between i1 and i2 equals the difference between them. That is: Number of bars = i1-i2. But if i1 and i2 fall between weekends then the number of bars will be calculated taking into account the bars that do not exist on Saturday and Sunday. How do I get out of this situation?Regards, Dimitri.
Thank you all. I have worked it out myself.
People! How do you round 2.643789 to a whole number?
I can't find it in the textbook or documentation, I can't find anything in the search, or I'm looking in the wrong place.
alsu, fill in the whole how?:)
and why print i?) i equals Bars-counted+2. how can it be negative?
This code is executed on every tick, i.e. at the arrival of every tick All elements of arrays Rel,. from Bars to zero are assigned some value. (By the way, there is no element with the number Bars, the last index in the array is Bars-1 - this should be remembered)
Now for the non-drawing.
We need to find out where the error is. First, I suggest that we look at what values the i index takes and what the rsi() function outputs. Since there is no debugger in ME, we have to use echo, i.e. Print().
People! How do you round 2.643789 to a whole number?
I can't find it in the textbook or documentation, I can't find anything in the search, or I'm looking in the wrong place.
https://docs.mql4.com/ru/math/MathRound
double MathRound( double value)
The function returns the value rounded to the nearest whole number of the specified numeric value.
Example:
double y=MathRound(2.8);
Print("Rounding 2.8 to ",y);
y=MathRound(2.4);
Print("Rounding -2.4 to ",y);
//Output: Rounding 2.8 to 3
//rounding -2.4 to -2
..on each tick All elements of Rel,... from Bars to zero are assigned some value.
Now about the non-drawing.
We need to find out where the error is. First, I suggest that we look at what values the i index takes and what rsi() function outputs at that. Since there is no debugger in ME, we can use echo, i.e. Print().
"Bars to zero" I've already fixed) I'm always reading and fixing things.
now about the non-drawing)
Can Bars-counted+2 be negative?
How can I modify all open orders?
I only modify one order for some reason
Here is my code
I have 10-50 orders open without a magician but it only sets a stop loss on one order, tell me what's wrong?"Bars to zero" I've already corrected) I'm always reading and correcting things.
now about the non-drawing)
can Bars-counted+2 be negative?
How can I modify all open orders?
I only modify one order for some reason
here is my code
i have 10-50 open orders without magic open but i get stop loss only on one order, tell me what's wrong?1) variable k repeats variable tot
2) a<=k is wrong, correct a<k
3) What's in the log about modifying orders?
1) the variable k repeats the variable tot
2) a<=k is incorrect, correct a<k
3) What's in the log regarding order modification?
1) the variable k repeats the variable tot
2) a<=k is incorrect, correct a<k
3) What's in the log regarding order modification?