Rate Of Change Comparator
A single rate-of-change line answers one question - is price higher or lower than N bars ago - but says nothing about whether short-term momentum agrees with the longer-term trend behind it. Plotting a fast and a slow ROC on the same scale answers that directly: when the fast line is above the slow one, momentum is accelerating relative to the longer baseline; when it crosses below, short-term momentum is fading before the longer measure has turned. That crossover typically shows up before either line's own zero-line cross, which is the reason to look at two speeds together rather than one at a time. Each line is computed the standard way, RocN = (price - price N bars ago) / price N bars ago * 100, entirely independently of the other and of its own previous value, so neither line can repaint once its bar closes. Notes and limitations - Needs InpSlowPeriod bars of history before the first value appears; earlier bars are intentionally left empty rather than guessed. - Both lines are unbounded percentage measures, not oscillators fixed to a scale - compare their current swing to their own recent history rather than to a fixed range. - Recomputed independently at every bar from raw price only, so neither line depends on its own previous value and neither can repaint. - A crossover is a momentum signal, not a trade signal on its own; it says nothing about the underlying trend direction, which this indicator does not attempt to measure.
Indicator · MT5 · v1.0 · Free
About Rate Of Change Comparator
Rate Of Change Comparator is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Fast period, Slow period and Applied price. MQL source code included.
Files in the download: RocComparator.ex5, RocComparator.mq5, RocComparator.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Fast period | 9 | Fast ROC period, in bars |
| Slow period | 25 | Slow ROC period, in bars |
| Applied price | PRICE_CLOSE | Applied price |
| Alerts | true | Alert once per closed bar on fast/slow crossover |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Indicators.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 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: Momentum · Trend · Alerts · MT5 Indicator · MQL5 Source Code