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
| Setting | Default | What it does |
|---|---|---|
| Indicator a name | Indicator A, name relative to Indicators\ | |
| Indicator a buffer | 0 | Indicator A, buffer index to read |
| Indicator b name | Indicator B, name relative to Indicators\ | |
| Indicator b buffer | 0 | Indicator B, buffer index to read |
| Operator | COMPOSITE_SUBTRACT | Operator applied as A <op> B |
| Scale factor | 1.0 | Result multiplied by this after the operator is applied |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the indicator from the Navigator onto a chart and adjust the settings.
Tags: Moving Average · Oscillator · MT4 Indicator · MQL4 Source Code