ahmadasadi1342103:
Hi
In MQL5 wizard there is longCondition() and shortCondition() methods for entering a trade
and closing trades are by stoploss and takeprofit.
Is there any way to close a trade by checking some condition?
how can i define a method for closing trades?
if there is ant article or example please tell me.
thanks a lot.
I found the answer here :

Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies
- www.mql5.com
In this article we are going to show how to explore the Standard Library of Trading Strategy Classes and how to add Custom Strategies and Filters/Signals using the Patterns-and-Models logic of the MQL5 Wizard. In the end you will be able easily add your own strategies using MetaTrader 5 standard indicators, and MQL5 Wizard will create a clean and powerful code and fully functional Expert Advisor.
There is a whole series of articles: MQL5 Wizard Module

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
Hi
In MQL5 wizard there is longCondition() and shortCondition() methods for entering a trade
and closing trades are by stoploss and takeprofit.
Is there any way to close a trade by checking some condition?
how can i define a method for closing trades?
if there is ant article or example please tell me.
thanks a lot.