Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 573

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hello!
Yes. There's no reason to translate time into string, since time is a number of seconds. This number is much easier and faster to work with than strings.
You've corrected one thing and ruined another.)
In the second part instead of:
return:
You had that line correct in your previous attempt.
Thanks for the replies! I've tried both options.
I don't see what the catch is - it still goes right in when closing on a stop:
Say your condition out loud and you'll see what's going on)
In fact, there != condition everywhere, i.e. opposite > should be there, if I understood correctly what you mean. But all variants ran - still works.
Help to understand the logic, find the error
Commented out the code in detail.
I need it to draw fractals with a period, with a "zigzag" type, so that the lower upper upper lower fractals go in sequence and so on.
But as a result, the repeated fractals appear on the chart anyway
The basis is taken from the standard fractal indicator. Screenshot below with repeated fractal on period 5
Can you please advise how to get the volume of open positions in MQL4, if SYMBOL_SESSION_INTEREST is not supported? Thank you!
Cycle through all positions and calculate their total volume:OrderLots()
I can't understand why a certain value of prev_calculated is returned?
How is it calculated in the first place?
I can't understand why a certain value of prev_calculated is returned?
How is it calculated in the first place?
I can't understand why a certain value of prev_calculated is returned?
How is it even calculated?
This is the value returned by OnCalculate() at the last iteration. This is explicitly stated in the documentation:
The relationship between the value returned by OnCalculate() and the second input parameter prev_calculated should be noted. The parameter prev_calculated, when the function is called, contains the valuereturned by OnCalculate() on the previous call. This allows for economical algorithms for calculation of the custom indicator in order to avoid repeated calculations for those bars that haven't changed since the previous call of this function.
The task is to find the bar with the minimum closure
for(int x=0; x<=xBars -1; x++)
{
counter++;
// Print(Close[x],",",counter);
int h = ArrayMinimum(Close[x]);
if(counter > 20) break;
}
Compiler swears at Close