MQL5 Wizard

 

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.

 
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 :

https://www.mql5.com/en/articles/488

Exploring Trading Strategy Classes of the Standard Library - Customizing Strategies
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