Embedding Indicator Subwindows in an MQL5 Expert Advisor
Summary
This article explains how to show a multi-indicator custom display in a chart subwindow when it is launched by an Expert Advisor. Directly attaching the existing custom indicator from an EA places it in the main chart, so the author proposes bundling a minimal support indicator as an EA resource and using it to create a subwindow. The EA can then add the existing indicator to that window.
The design extends an existing chart template class through public inheritance, adding subwindow management while keeping the original class intact. The article outlines initialization and closing methods, resource compilation behavior, and the use of relative include paths. It also presents a direct alternative that adds the indicator to the next available chart window. The material is an implementation walkthrough, not a trading strategy or performance study; it provides no evidence about signal quality, execution, or trading returns, and its MQL5 details may require adaptation to a specific project.
Key ideas
- An indicator added directly from an Expert Advisor can cover the main chart if no subwindow is created first.
- A minimal custom indicator can be bundled as an Expert Advisor resource to support creation of a subwindow.
- The EA can add an existing custom indicator to the new window instead of rewriting its functionality.
- Public inheritance can extend a working chart class with subwindow controls while retaining its existing behavior.
- The article describes MQL5 implementation mechanics and does not evaluate trading performance.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.