Optimizing Malaysian Engulfing Retest Ranges with Historical MFE and MAE
Summary
This article adds a historical optimization layer to an MQL5 indicator for Malaysian Engulfing patterns and retest confirmation. It records setup properties, identifies qualifying bullish and bearish retests using price interaction and a wick-ratio filter, and measures maximum favorable and adverse excursions over a fixed forward window from a defined entry point. Candidate retest distances are evaluated separately for bullish and bearish setups.
A constrained brute-force search selects the distance with the best average favorable excursion minus average adverse excursion within the tested candidates. The chosen ranges are calculated during initialization for a specified historical period, symbol, and timeframe, then used by the indicator at runtime. The method is transparent and limited to one parameter, but the excerpt provides no numerical results or out-of-sample validation. Its selected values depend on the sample window, entry and excursion definitions, and other configurable filters, so historical optimization alone does not establish future profitability.
Key ideas
- The indicator adapts bullish and bearish retest distances independently to historical data.
- Retest validation checks price interaction with the engulfing zone and applies a wick-ratio threshold.
- Each accepted setup is scored using maximum favorable and adverse excursions over a forward window.
- The search selects the candidate range with the highest average favorable excursion minus average adverse excursion.
- The result depends on chosen data windows and rules, and the excerpt does not establish out-of-sample performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.