Skip to content
All library documents

Inside-Bar Expert Advisor with Signal Modes and Stop/Target Optimization

Article MQL5 code base

Summary

This MetaTrader expert advisor detects bullish and bearish inside-bar patterns and opens corresponding long or short positions. It offers three position-handling modes: open a position at every signal with stop-loss or take-profit exits; reopen positions in the signal direction while closing opposing positions; or maintain at most one position while closing the opposite side. Users can disable either direction or reverse the signals. Inputs also cover trade size, slippage, stop and target distances, spread-based stop adjustment, and environment-update retries.

The source reports a test on EURUSD hourly bars using one-minute OHLC modeling from January 2016 to March 2018. It says stop-loss and take-profit settings were optimized over that same interval, giving 800 and 900 points as the respective optima. No return, drawdown, robustness, or out-of-sample results are provided, so these settings are specific to the stated test and do not establish general performance.

Key ideas

  • The EA opens long or short positions based on detected bullish or bearish inside-bar patterns.
  • Three modes control whether signals add positions, replace opposing positions, or maintain one position.
  • Users can disable directions, reverse signals, and configure position size, stops, targets, and execution-related settings.
  • The stated EURUSD test used hourly bars with one-minute OHLC modeling from January 2016 to March 2018.
  • Stop-loss and take-profit values were optimized on that same interval, with no out-of-sample evidence reported.

Tags

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