Skip to content
All library documents

A Two-Sided Stop-Order Expert Advisor with Bracket Exits

Article MQL5 code base

Summary

This document describes an Expert Advisor that places Buy Stop and Sell Stop orders at user-defined distances from the current price, with stop-loss and take-profit levels. When one side triggers, the other pending order is removed; after the resulting position closes, both orders are placed again. The settings include fixed or equity-based position sizing, risk percentage, entry distance, stop loss, take profit, trailing stop, slippage, and a magic number. The stated use case includes brokers that restrict pending orders close to market price.

The approach is a two-sided breakout entry mechanism, but the document gives no backtest or evidence of profitability. It does not specify market selection, order expiration, simultaneous-trigger handling, or how stop levels interact with gaps and execution costs. Its claim about avoiding unwanted stop-loss triggers is not fully explained, and the listed parameter defaults should be treated as configuration examples rather than validated risk settings.

Key ideas

  • The Expert Advisor places Buy Stop and Sell Stop orders simultaneously at configurable distances from market price.
  • When one order triggers, the opposite pending order is canceled.
  • Both pending orders are placed again after the open position closes.
  • The settings include equity-based or fixed sizing, stop loss, take profit, and trailing stop.
  • The document describes functionality but provides no performance testing or detailed execution safeguards.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.