Loading…

Composite Indicator Builder

"What if I plotted the difference between these two oscillators" or "what does the ratio of these two moving averages look like" usually means writing, compiling and maintaining a brand new bespoke indicator file for each idea. This tool turns that into filling in two names, a buffer index each, and picking an operator. Both source indicators are read through iCustom at the requested buffer index, on every bar in the recalculation range, and combined with the chosen arithmetic (A+B, A-B, A*B, A/B), then optionally scaled. Division by a near-zero denominator produces a gap in the plot (EMPTY_VALUE) rather than a runaway spike - a spike at every zero-crossing of the divisor would make the composite line unreadable and could be mistaken for a real signal at exactly the moments it is least meaningful. The one honest limitation: iCustom() in MQL4 takes only a buffer-index and a shift, so both source indicators run on their OWN default input settings - the same limitation documented on the catalogue's Universal Divergence Engine and Indicator Health Watchdog. If a specific parameter set matters for either source, attach it to the chart first with those settings so its defaults already match what this builder reads. Notes and limitations - Both source indicators run on their own default inputs; there is no way to forward custom parameters through iCustom's fixed argument list. See the full description above. - If either source returns EMPTY_VALUE for a bar, the composite is also EMPTY_VALUE for that bar rather than silently treating the missing value as zero, which would distort every subsequent operator's result. - Division uses a small epsilon (1e-7) rather than an exact zero check, to avoid a spurious huge spike from a denominator that is merely very close to zero rather than exactly zero. - This indicator has no opinion on whether the resulting composite is a meaningful trading signal - it is a generic arithmetic tool, not a strategy.

Indicator · MT4 · v1.0 · Free

About Composite Indicator Builder

Composite Indicator Builder is an indicator for MetaTrader 4. It has 6 settings, such as Indicator a name, Indicator a buffer and Indicator b name. MQL source code included.

Files in the download: CompositeIndicatorBuilder.ex4, CompositeIndicatorBuilder.mq4, CompositeIndicatorBuilder.txt.

Settings

SettingDefaultWhat it does
Indicator a nameIndicator A, name relative to Indicators\
Indicator a buffer0Indicator A, buffer index to read
Indicator b nameIndicator B, name relative to Indicators\
Indicator b buffer0Indicator B, buffer index to read
OperatorCOMPOSITE_SUBTRACTOperator applied as A <op> B
Scale factor1.0Result multiplied by this after the operator is applied

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Moving Average · Oscillator · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria