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

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, that's what I mean. Okay, we missed it. The main thing is for him to understand what's what...
He who? That's where I started.
Forum on trading, automated trading systems and strategy testing
Any questions from beginners on MQL4 and MQL5, help and discussion on algorithms and codes
Alexey Viktorov, 2019.06.11 09:06
You can't use SymbolInfoInteger to get Point())).
And in general, it's necessary to remember that Point() or _Point only for current symbol. For symbols other than the one on which the EA works, you should use this function.
The SymbolInfoInteger function returns not only int values, but also long, bool and enumerations.
Может вам очень не повезло, но я не люблю колупаться в чужом коде. Тем более править его...
Alexey Viktorov:
Next question: How often do you think the value of indicator will be exactly 50?
As I understood the problem, it should be one colour >50 and another <=50, but ==50 I haven't seen anywhere. Of course, to avoid loosing in case ==50, we should add >=50 to one of them and <=50 to another. It may look better.
And the second question: how much of a necessity was it to change the entire buffer indexing? After reindexing, did you fix everything in your code? Maybe it would be easier to make colour buffer index 4, and auxiliary buffers 5 and 6 accordingly. You would have less to edit and less chances to make a few more errors.
You must have racked your brains when you were changing the buffer indexing.
Go back and take the old code from Message 8806 and change only the buffer sequence.
Then trace conditions when it is necessary to put 0 and when it is necessary to put 1You must not have been thinking too hard when you changed the buffer indexing.
Go back and take the old code from post 8806 and change just the buffer sequence there.
Then trace the conditions when to put 0 in the colour buffer and when to put 1I did that, didn't help, admitted I was making mistakes, after your post I did it again. Here are the code places I changed. The old one is uncommented.
This is how it was before I made the changes. The histogram is there, the right colour isn't.
This is how it is now. The histogram is gone, it is not displayed.
I guess I'm not thinking straight again.
I did so, it didn't help, I made mistakes, after your post I did it again. Here are the places in the code that I changed. The old one is uncommented.
This is how it was before I made the changes. The histogram is there, the right colour isn't.
This is how it is now. The histogram is gone, it is not displayed.
I must be racking my brains again.
There is no logic here at all. The sequence should be as follows: The histogram value is determined and the i-th index of the indicator buffer is filled in. Then a separate check, if this value >=50 the colour buffer is filled in with 0, otherwise 1. It is defined by colour sequence in the directive
If 0, the colour clrGreen is taken and if 1, clrRed
And this line is completely unnecessary, and the sequence is the opposite of the first.
And this
int cl;
added for what purpose? It's easier to fill directly.
To fill colour buffer, I would use this construct
The ?: operator is equivalent to if else but applied more easilyThe logic here is broken in general. The sequence should be as follows: Determine the histogram value, fill in the i-th index of the indicator buffer. Then a separate check, if this value >=50 the colour buffer is filled with 0, otherwise 1. This is determined by the colour sequence in the directive
If 0, the colour clrGreen is taken and if 1, clrRed
And this line is absolutely unnecessary, and the sequence is the opposite of the first.
And this
added for what purpose? It's easier to fill directly.
To fill the colour buffer, I would use this construct
The ?: operator is equivalent to if else but applied more easilyWURRAA, and my soul has sung. Alexey, thanks a lot !!!!!
It all worked, I don't quite understand how it's possible to do without array
because its description has been deleted. So you can do without extra array here?
My Squeaky is just a miracle, he takes it everywhere and everywhere.
p.s I still haven't learned how to properly attach an image, please excuse me, I'll post screenshots.
To fill the colour buffer I would use this construction
The ?: operator is equivalent to if else, but easier to useGreat advice and a great science for the future!!! Went even a little further. Below is the result.
So it was:
So it became, the effectiveness of the approach is obvious!!! Thank you.
Great advice and a great science for the future!!! Went even a little further than that. Below is the result.
So it was:
So it became, the effectiveness of the approach is obvious!!! Thank you.
No efficiency here - three if-else conditions instead of one. Here, it's worse just the way it is...
There is no efficiency here: there are three if-else conditions instead of one. It's worse here...
Yes, indeed. I hadn't noticed that. It looks better, there are fewer letters.
And there is no way to put three executions (I don't know how to say it correctly) under one operator?: at once?