Discussing the article: "Backtesting Indicator Signals in MQL5 Using Buffers and Chart Objects"

Check out the new article: Backtesting Indicator Signals in MQL5 Using Buffers and Chart Objects.

The EA evaluates indicator signals from buffers or dated chart objects on historical closed bars, keeping execution separate from account reports. It models virtual positions with user-defined entry timing, stop loss, staged targets, partial exits, break-even, and optional reversal on opposite signals, and renders exit paths and statistics on the chart. EURUSD examples compare SMA buffer/object sources and test confirmed RSI divergence, illustrating a practical way to judge signals before building a dedicated EA.

An indicator can display buy and sell signals without showing how they would have performed on historical data. Assessing those signals should not require writing a separate Expert Advisor (EA) for each indicator. ExternalIndicatorBacktest.mq5 backtests signals from an attached indicator via readable buffers or time-anchored chart objects. The indicator source is not modified.

The download includes the EA and three demonstration indicators: DemoSignals for buffer signals, and ObjectSignals and RSIDivergenceObjects for chart objects. The EA reconstructs virtual positions from closed bars' open, high, low, and close (OHLC) prices on a chart or in the visual Strategy Tester. It sends no orders and displays exit segments and statistics on the chart.

Author: Roberto Danilo Riccio