Rate Of Change Spectrum
- Indicateurs
- Version: 1.0
- Activations: 5
# Rate Of Change Spectrum - Which horizon is driving
*Category: Momentum | Difficulty: advanced | Window: separate window below the chart | Markets: Universal (Forex, indices, commodities, crypto, stocks) | Suggested timeframes: M30, H1, H4, D1*
## Short description
> Standardises the rate of change over six horizons and identifies which one is driving the move. It shows the dominant scale score and its rank.
### Overview
Knowing the market is rising tells you little. Knowing whether it rises because a five bar thrust just tore it up, or because an eighty bar tendency is carrying it along, radically changes management: the first exhausts within hours, the second can last weeks. Rate Of Change Spectrum computes the rate of change over six geometrically spaced horizons, standardises each one against its own historical distribution so they become comparable, and then identifies the one with the most extreme score in absolute value. The histogram reports that score, while the step line indicates the rank of the winning scale, from one for the shortest to six for the longest.
### How the calculation works
1. The six horizons start from InpBasePeriod and grow by multiplying by InpGrowth, with a guard preventing duplicate periods.
2. For each horizon the current rate of change is computed, along with its mean and variance over the last InpStatPeriod bars.
3. Standardisation is indispensable: without it the long horizons would always win, having larger amplitudes by construction.
4. The dominant scale is the one with the most extreme standardised score in absolute value, regardless of sign.
5. Horizons for which the available history is insufficient are skipped, avoiding out of range access on the first bars.
6. The histogram is coloured only if the dominant score exceeds InpMinZ, otherwise no scale genuinely stands out.
### How to use it
- Read the step line first: it tells which horizon the game is being played on, hence how long the move will plausibly last.
- Dominance on scales one and two means a very short thrust: suited to scalping and near targets, not to positions to be held.
- Dominance on scales five and six means the underlying tendency is speaking: positions can be held longer.
- A shift of dominance from short to long scales signals that a local thrust is turning into a tendency.
- A grey histogram indicates no horizon stands out: the market has no reference scale and waiting is advisable.
### Who it is for and on which timeframes
This is a tool for experienced traders who adapt their operating horizon to conditions instead of always applying a single one. It requires deep history, because standardising the longest horizon consumes many bars. It works from M30 to D1. It is also the most computationally demanding of the whole category, estimating six distributions per bar: on charts with tens of thousands of bars the first pass takes a few seconds.
### Practical example of reading a signal
On GBPJPY H4 the step line sits steadily on scale one, with scores around +1.4: every advance comes from the shortest horizon and indeed price moves in bursts that fade at once. Anyone trying to hold positions saw the gain evaporate every time. Then the line rises to four and stays there for two weeks, with scores above +2: the thrust now originates from a horizon of about forty bars. From that point the same positions, held with the same stop, reach their targets. The market direction did not change, the scale it moves on did.
## Input parameters
| Parameter | Default | Description |
|---|---|---|
| `InpBasePeriod` | 5 | Horizon of scale number one. It defines the lower bound of the observed spectrum. |
| `InpGrowth` | 1.80 | Growth factor between one scale and the next. With 1.80 starting from 5 the sixth scale reaches about 95 bars. |
| `InpStatPeriod` | 150 | Standardisation window applied to each horizon. It is the parameter weighing most on computation time. |
| `InpMinZ` | 1.00 | Minimum score for the dominant scale to be deemed significant and the histogram coloured. |
| `InpAppliedPrice` | PRICE_CLOSE | Price all rates of change are computed on. |
## Advantages / strengths
- It answers a question no commercial indicator addresses: which time scale the market is moving on right now.
- Standardisation makes horizons comparable that otherwise could not be compared at all.
- It has a direct bearing on target selection and on the expected holding time of positions.
- No repaint, despite the complexity of the computation.
## Limitations and warnings
- It is the heaviest in the pack computationally: six distributions per bar make the first pass slow on very long histories.
- The step line can jump between adjacent scales when two scores are nearly identical, giving an impression of instability.
- It needs many bars of history before producing the first valid value: roughly InpStatPeriod plus the longest horizon.
- Interpretation is not immediate and without reading the documentation the step line risks being ignored, losing half the indicator.
**No repaint:** values printed on a closed bar are never modified afterwards.
**Disclaimer.** This product is a technical analysis tool, not an automated trading system, and it offers no profit guarantee whatsoever. Financial markets carry the risk of total loss of the invested capital. Past performance is not indicative of future results. Every signal must be confirmed with your own analysis, a money management plan and prior testing on a demo account. The author is not responsible for trading decisions taken on the basis of this indicator.
## Suggested tags / keywords for MQL5
`momentum`, `rate of change`, `multi timeframe`, `spectrum`, `z score`, `dominant cycle`, `no repaint`, `statistics`
