Skip to content
All library documents

A Pending-Order Breakout Around the Previous Bar’s Range

Article MQL5 code base

Summary

This expert adviser places a Buy Stop above the high of bar one and a Sell Stop below its low, with a configurable offset. The setup seeks to enter when price moves beyond that bar’s range. Its parameters include stop loss, take profit, trailing stop distance and step, offset from the high or low, and a maximum permitted spread. It also offers a money-management setting based on volume or percentage, plus logging and a magic number for order identification.

The description notes testing on EURUSD at the one-minute timeframe, but gives no performance figures, test period, execution assumptions, or comparison with alternatives. It does not specify how the opposite pending order is handled after an entry, or explain the precise money-management calculation. The listed controls allow a user to configure order placement and trade management, but the text does not establish that the approach is profitable or robust across markets and conditions. Spread filtering is particularly relevant to short-timeframe order placement, while stops and trailing rules determine how exits are managed.

Key ideas

  • A buy stop is placed above the prior bar’s high and a sell stop below its low.
  • An offset parameter sets the distance between the bar boundary and each pending order.
  • Stop loss, take profit, and trailing controls define configurable exit behavior.
  • The adviser includes a maximum spread filter and volume- or percentage-based money management.
  • The document mentions EURUSD one-minute testing without reporting test results.

Tags

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