Skip to content
All library documents

A Gap-Fading Expert Advisor with Configurable Position Controls

Article MQL5 code base

Summary

The described expert advisor checks for a gap between the prior bar’s close and the current bar’s open. When it detects a gap, it opens a position in the opposite direction, making the approach a simple gap-fading rule. The document identifies configurable controls for stop loss, take profit, position sizing, and the maximum number of open market positions. Position size can be constant or dynamically determined through money management.

This is a concise description of the entry logic and available settings, rather than a full account of the strategy. The supplied text gives no gap threshold, exit timing rule beyond the configurable profit and loss levels, market or timeframe specification, or backtest results. It therefore offers no evidence that gaps tend to reverse or that the configuration is profitable. The approach would need instrument-specific testing that accounts for spread, slippage, and the risks of holding positions through changing market conditions.

Key ideas

  • The advisor detects a gap by comparing the previous bar’s close with the current bar’s open.
  • It opens a position opposite to the detected gap.
  • Stop loss, take profit, position sizing, and the maximum number of open positions are configurable.
  • The document provides no performance evidence or detailed testing conditions.

Tags

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