Discussing the article: "Implementation of a Breakeven Mechanism in MQL5 (Part 1): Base Class and Fixed-Points Breakeven Mode"

 

Check out the new article: Implementation of a Breakeven Mechanism in MQL5 (Part 1): Base Class and Fixed-Points Breakeven Mode.

This article discusses the application of a breakeven mechanism in automated strategies using the MQL5 language. We will start with a simple explanation of what the breakeven mode is, how it is implemented, and its possible variations. Next, this functionality will be integrated into the Order Blocks expert advisor, which we created in our last article on risk management. To evaluate its effectiveness, we will run two backtests under specific conditions: one using the breakeven mechanism and the other without it.

Moving a Stop Loss to breakeven(breakeven is a technique used in trading to manage open positions more safely. It involves moving the Stop Loss level to the trade's opening price after the price has moved a certain number of points in profit. This helps protect the position and reduce the loss in case of an unexpected retracement.

The application of a breakeven mechanism involves two main possibilities:

  • it allows you to ensure that if the price does not reach the target Take Profit level, the trade will not close at a loss;
  • it is used to lock in profits by setting the Stop Loss a few points above the entry price.

In this series of articles, we will develop three variations of the breakeven mechanism. Now, in the first part, we will create the base class of the system and program the first simple type of breakeven, which will serve as a template for future extensions.


Author: Niquel Mendoza