Skip to content
All library documents

Range Breakout Entries with Martingale Loss Recovery

Article MQL5 code base

Summary

This Expert Advisor trades breaks of the high or low formed during a selected time interval. A move above the range triggers a buy, while a move below triggers a sell. The initial stop is placed at the opposite range boundary, and the take-profit distance is based on the range height. Optional time-based closure can exit all positions at a specified time.

After a stop-loss, the EA opens a position in the opposite direction and increases the lot size by a configurable multiplier, continuing its “Nevalyashka” recovery approach. A profitable close ends that recovery sequence until the next period. A breakeven feature moves the stop to entry after half the position’s profit target is reached. The document explains the rules and some trade-event handling, but supplies no performance results. Martingale sizing can increase exposure after losses, and the described logic does not establish that a recovery sequence will succeed.

Key ideas

  • The EA enters when price breaks the high or low of a configured time range.
  • Initial stop-loss levels sit at the opposite boundary, with take-profit based on the range height.
  • After a stop-loss, it reverses direction and multiplies the position size.
  • A profitable close pauses trading until the next range period.
  • An optional breakeven rule moves the stop to entry after half the profit distance is reached.

Tags

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