Skip to content
All library documents

Adaptive RSI or MFI Threshold Trading with Rolling Optimization

Article MQL5 code base

Summary

This expert-advisor design periodically searches recent price history for RSI or MFI thresholds that produced the greatest simulated monetary profit. It tests buy and sell signals separately across candidate indicator levels, using crossings of oversold and overbought thresholds, then favors the direction and level with the strongest recent result. The lookback length, indicator, timeframe, and threshold range are configurable. The document also describes optional aggressive behavior, trade reversal, single-order limits, dynamic position sizing, ATR-based stop-loss and take-profit distances, and break-even adjustments.

The optimization is based on a rolling sample of past bars, so its selected thresholds depend on recent conditions and simulated trade outcomes. The author offers no performance results, benchmark, or out-of-sample validation, and explicitly characterizes aggressive mode as risky. Selecting levels by the best monetary result over the same recent window may fit noise, while the listed controls do not by themselves establish robust risk management. The method is a configurable EA concept rather than evidence of a profitable strategy.

Key ideas

  • The advisor searches recent bars for RSI or MFI thresholds with the best simulated buy and sell profits.
  • Signals are based on crossings of selected overbought and oversold levels.
  • The design includes configurable order limits, risk-based or fixed sizing, ATR-based exits, and break-even rules.
  • Its rolling optimization may select thresholds that fit recent noise.
  • The document provides no out-of-sample results or evidence that the approach is profitable.

Tags

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