Prevent EA from ppening another trade once it closes
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- MQL4 Learning
- How to prevent from opening new order in same candle
I want it to not open any more trades until a the next reversal.
wait for next reversal then..
I have an EA which I have developed to trade on reversal using EMAs and other indicators. The EA works fine, but on a M15 chart, it opens a trade after it closes one because the trade on that candle is still valid. I want it to not open any more trades until a the next reversal. How can I implement that?
Use a Global scope variable. When you open a trade set the variable so that you know if it is a buy signal or a sell signal. Don't open another trade unless it is an opposite signal.
Use a Global scope variable. When you open a trade set the variable so that you know if it is a buy signal or a sell signal. Don't open another trade unless it is an opposite signal.