Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

MetaTrader 4 Expert Advisor | Simple check open orders filter boolean function for Expert Advisors

MetaTrader Experts, Indicators, Scripts and Libraries

It is common for novice developers to face the challenge of making the Expert Advisor able to detect if there are open orders independently, without using the OrdersTotal() function, as this does not recognize if an order was opened by an EA or if it was opened manually, since it returns the total amount of open orders.

With that in mind, I decided to share this very simple code. In it, I use the Comment() function as a way to demonstrate the Check_Open_Orders function in real time.

The code is extensively explanatory with descriptive notes. I hope it is useful.

44892