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?
- Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes
- MQL4 Learning
- How to close the chart after the last trade closes?
pwakhungu:
I want it to not open any more trades until a the next reversal.
I want it to not open any more trades until a the next reversal.
wait for next reversal then..
pwakhungu:
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?
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.
Keith Watford:
Thanks @Keith Watford
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.
![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