- Questions from Beginners MQL4 MT4 MetaTrader 4
- MQL4 Learning
- Libraries: MultiTester
IT Opens alot of trades, i just need one reversal, only one
i recommend that you look in codebase for eas. There is many eas in there with examples of how to limit opening of trades to 1 and different ways that may be more suited to your liking. Otherwise, you will only get responses if someone finds your request challenging. Not many questions get answered unless the op has shown initiative, which you haven not. The code you have above has bits missing. Even if it was limited to a single trade, i doubt that the code would do what you want for at least 3 reasons that I can see. 2 of them may work, despite giving errors.
IT Opens alot of trades, i just need one reversal, only one
the reason for that is because when it opens a trade, it then opens the opposite trade, and then a trad in the opposite direction of the new trade, and another and another. what do you mean by limiting to 1 trade? if 1 trade is already open, then, the code above would never open a 2nd.
IT Opens alot of trades, i just need one reversal, only one
look in codebase for scripts. There is several that do exactly what you have done above. You attached the script to chart, then, it waits until it is XX distance from the open price of a trade, and then opens a trade in reverse, and then the script detaches itself from the chart, normally, but you could modify it as an EA or keep it as script and not detach itself.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use