Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 886
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
Yes, indeed. I hadn't noticed that. It looks better, there are fewer letters.
Is there no way to put three versions (I don't know how to say it correctly) under one operator?
Only curly braces - they limit the condition.
I tried to draw a construction like this, and the compiler spat something bad smelling at me. Where's the mistake?
UURRAA, and the soul has sung. Alexey, thank you so much !!!!!
It all worked, I don't quite understand how it's possible to do without the array
because its description has been deleted. So you can do without the extra array here at all?
This is the array.
Yes, indeed. I hadn't noticed that. It looks better, there are fewer letters.
Is there no way to put three versions (I don't know how to say it right) under one operator?
Yes, we can. Create two user-defined functions and call them.
That's what I'm saying. All right, we're through. As long as he knows what's going on...
I got it, thanks.
I'm just confused. This is all new to me.
You can. Create two custom functions and call them.
Did I understand you correctly?
I did so in the indicator - it works.
Did I understand you correctly?
I prescribed it so in the indicator - it works.
If it works, it's right. But I would not do it that way.
First of all, I wouldn't make changes of buffers. It is enough to always write 50 in one of them without any conditions.
And in the second buffer to put the value greater or less than 50. Then at condition <=> only colour should be appointed. And no separate functions.
If it works, it's right. But this is not how I would do it.
First of all, I would not make a fancy change of buffers in which =50. It is enough to always write 50 in one of them without any conditions.
And in the second buffer to set the value greater or less than 50. Then at condition <=> you will have only to assign colour. And no separate functions.
I would agree with you if the condition <>50 defines only colour, but it is the beginning/end of histogram candle as well. Therefore I won't argue, I will try to check, though probably you are right.
If it works, it's right. But that's not how I would do it.
Yes, indeed, either of the two DRAW_COLOR_HISTOGRAM2 buffers defining the start/end of the candle can be either the start or the end. Everything is much simpler now:
Thanks for the science.
How to reset INDICATOR_MAXIMUM and INDICATOR_MINIMUM values when switching modes?
The point is that these values are used in one mode and not in the other. When switching the mode to the one where these maxima and minima are not needed, they are saved for some reason. This problem exists both in MQL4 and MQL5.
For instance, when running the indicator in the first mode the boundaries are not necessary and everything works correctly
The second mode sets the boundaries of maximum and minimum of the indicator window. Everything works correctly when switching from the first to the second mode
But when switching from the second mode to the first (the boundaries are not used in the first mode) these maxima and minima are saved and the user cannot see the real indicator values
The code in MQL4 is in the attached files
Has anyone encountered this problem? Does anyone have any idea how to solve it?