I have to check some simple conditions before I can enter the trade (in a moment A I get a pivot, in a moment B the current value of the symbol exceeds the value of my pivot by X pips, in a moment C the current value of the symbol drops by Y pip the value of my pivot, so that A comes before B that comes before C).
I tried to do it with a while (true) and iteratively check the conditions, but when the while kicks in the test freezes (the while keeps running, but the current value does not update and always stops at the same instant).
What are my alternatives? Are there any built-in functions already? Do I have to do it myself? In case, do you have any suggestions for making it work?
In case I had to create one myself, I thought that a possible solution was to insert everything in the OnTick function but since I would not want to lose the pivot information I would need a two-dimensional array, is it possible to create one in MQL5? The array should not contain a fixed number of pivots, but these can vary.
- What happens with the data on arrays when the MT4 is reseted.
- Pending orders alternative with array (?)
- Best way to share data between indicators (.csv vs. array)
![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