Skip to content
All library documents

Swing-Based Volatility Breakouts in an MQL5 Expert Advisor

Article MQL5 articles

Summary

The article describes a breakout method that estimates short-term volatility from two price swings across recently completed bars. At each new bar, it takes the larger absolute swing distance, then projects buy and sell trigger levels as configurable fractions of that range from the bar’s open. It presents this as an alternative to basing volatility on a single bar’s range or on indicators such as ATR and standard deviation.

The Expert Advisor monitors prices during the bar and enters at market when a threshold is crossed. Stop distance also uses the measured swing range, while a configurable reward factor sets the target. The design allows one open trade, selectable long or short direction, and either fixed-lot or balance-based sizing. The article discusses implementation and backtesting, but the supplied text gives no detailed performance figures or evidence of a durable trading edge. It frames the system as a reproducible implementation of an idea rather than an optimized strategy; results would need independent testing across instruments and conditions.

Key ideas

  • The volatility estimate is the larger absolute value of two specified recent swing distances.
  • Breakout thresholds are set as configurable fractions of the measured range from the new bar’s open.
  • Entries are market orders triggered when price crosses a threshold during the bar.
  • Stops and reward-based targets are derived from the same swing range.
  • The Expert Advisor supports direction filters and fixed or balance-based position sizing.

Tags

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