Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 243
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
Thank you, it worked, only I normalised q and w separately!
If it's the tenth bar, how do I know the difference between the tenth and zero bar? 10-0=10
We can see on the paper that 10 - 0 = 10. But how do we write this condition into the program. I haven't found a function that would return the bar number. Or maybe I searched too hard?
We can see on the paper that 10 - 0 = 10. But how do we write this condition into the program. I haven't found a function that would return the bar number. Or was I looking too hard?
Well, you've ALREADY found that bar. In the function that looks for the intersection.
Normalise the difference between the two numbers. And compare it to zero.
And the way I did it, could there be mistakes?
Yes, I found it. I think I got your point while writing the answer - IntersectionXX() is exactly what gives me this number, let it be 10. Did I get it right?
Yes
Thank you very much. Yes, my logic, imagination and judgement are a bit lacking. Thank you again, and all the best.
Hello! I wanted to get the opening time of the current month's bar, but got an error 4074 (ERR_NO_MEMORY_FOR_HISTORY). It's also interesting that if I start testing from June 1, everything is correct, but from June 2 the error starts to appear. How to solve this month's problem?
Hello all, please help with changing the values of the variables. There are two variables with an initial value of zero. For example I always have two levels on the chart. How to make so that when one level is reached the first variable changes value to "1" and only when the other level is reached it changes value back to "0", while the second variable acts in the opposite way.
Hello all, please help with changing the values of the variables. There are two variables with an initial value of zero. For example I always have two levels on the chart. How to make, that at achievement of one level the first variable has changed value to "1" and only at achievement of other level has changed value back to "0", whereas the second variable has acted in an opposite way.
Everything seems to work. It didn't work at first though. Strange.