![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
I think your code might be simpler if you ditch the array.
This will make your code simpler and eliminate possible errors when working with a global array
If you try to implement this without breaking it into sub-functions, the code will be quite cumbersome.
It will be easy to make a mistake in such code and it will be difficult to debug such code. Including due to the fact that you need to break the loop when all 3 intersections are found.
Imagine that you still wrote this code in the form of a single loop. After which you want to change the number of intersections. It would be quite difficult to make such changes.
Personally, I'm too lazy to solve one complex problem. I would break it down into sub-problems and instead of solving one complex problem, I would solve several simple problems. It is easier to solve several simple problems than one complex one.
Here's a little hint.
This function will do the following:
What can be “taken out of brackets” here?😄
“taken out of brackets” is an analogy with mathematics. Not sure if I translated this into English correctly