Skip to content
All library documents

Custom Indicator Expert Advisor with Indicator-Based Trailing

Article MQL5 code base

Summary

This document describes updates to an Expert Advisor that uses custom indicators to open and close trades. Version 5 changes several level inputs to decimal-capable values. Later additions allow closing rules to check minimum order profit and whether a stop loss already protects a specified profit. The EA can also trail stops using a custom indicator’s buy or sell buffer, with configurable indicator parameters, buffer indexes, bar shift, price offset, and minimum locked-in profit.

The document also explains support for two-color indicators and a MarketWatch mode that opens market orders before setting stop loss or take profit. It names example indicator types and warns that some colored indicators cannot be used reliably because they repaint prior bars or overlay color buffers. This is a feature description, not a trading-performance evaluation: it gives no backtest results or guidance for choosing indicators, thresholds, or markets. Indicator behavior, parameter compatibility, and the risks of delayed or changing signals remain important limitations.

Key ideas

  • The EA can use custom indicator buffers to guide entries, exits, and trailing stops.
  • Closing checks can require minimum profit or preserve a stop loss that already secures profit.
  • Indicator-based trailing uses configurable buffers, parameters, bar shifts, and price offsets.
  • Some two-color indicators are unsuitable because of repainting or overlapping buffers.
  • The document describes capabilities but provides no evidence of trading performance.

Tags

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