Adaptive Slope Ribbon
- Indicators
- Version: 1.0
- Activations: 5
# Adaptive Slope Ribbon - ATR-normalised regression slope ribbon
*Category: Trend | Difficulty: intermediate | Window: separate window below the chart | Markets: Universal (Forex, indices, commodities, crypto, stocks) | Suggested timeframes: M15, M30, H1, H4, D1*
## Short description
> Five linear regression slopes over growing horizons, normalised in ATR units and comparable across instruments. The histogram shows the mean slope coloured by the level of agreement between time scales.
## Full description
### Overview
Adaptive Slope Ribbon answers a simple question that almost no trend indicator addresses directly: is the current move recognised by every time horizon, or only by one? The indicator computes the slope of the linear regression line of price over five growing windows, for example 10, 20, 30, 40 and 50 bars, and divides each slope by the current ATR. The result is no longer expressed in points or pips but in volatility units: a slope of 1.5 means that within the window price travelled one and a half times the average bar range. This makes values directly comparable across EURUSD, gold, indices and crypto, and across M15 and D1, with no re-tuning required.
### How the calculation works
1. For every bar the ATR is computed as a simple average of the True Range over the InpAtrPeriod window. This is the measurement unit of the whole indicator.
2. On each of the five horizons the slope of the least squares regression line that best fits the applied price is estimated.
3. Each slope is multiplied by the length of its own window, giving the total move explained by the trend, and then divided by the ATR.
4. The five normalised lines form the ribbon. When they are ordered and spread apart the trend is strong; when they interlace around zero the market is in balance.
5. The histogram plots the mean of the five slopes and is coloured green when at least the InpAgreeLevel share of the scales is positive, red in the opposite case, grey when the scales disagree.
### How to use it
- Use the histogram colour as a directional filter: go long only while it is green, short only while it is red, and stand aside on grey.
- Read the ribbon width as a measure of conviction: widely separated lines signal a move accepted by every scale.
- The fastest line alone crossing above zero, while the others are still negative, is an early warning of a possible reversal, not an entry.
- Absolute histogram values above 2.0 indicate a move already very extended in volatility terms: prefer entries on pullbacks.
- Combine it with a levels indicator to place the stop: the ribbon gives direction, not where to put the risk.
### Who it is for and on which timeframes
It is designed for the discretionary trend following trader who works on several instruments and wants one common yardstick. On timeframes from M15 to H4 it works as a session filter, on H4 and D1 as a map of the underlying market state. It is not suited to those looking for precise entry signals on M1 and M5, where the slope to noise ratio becomes too low for the five scales to agree in a stable way.
### Practical example of reading a signal
On EURUSD H1 the market has been falling for three days: all five lines are below zero and the histogram is red around -1.8. Price bounces. The fastest line climbs above zero while the other four stay negative: the histogram turns from red to grey and hovers near -0.9. The message is not that the trend is over, but that the bounce is visible only on the very short horizon. A short position is kept with the stop above the bounce high; a trader looking for a long entry waits until at least four lines out of five move above zero and the histogram turns green.
## Input parameters
| Parameter | Default | Description |
|---|---|---|
| `InpBasePeriod` | 10 | Number of bars of the fastest slope. Low values make the ribbon nervous, high values flatten it. |
| `InpStep` | 10 | Bar increment between one scale and the next. With 10 you get horizons 10-20-30-40-50; with 20 you cover a much wider range. |
| `InpAtrPeriod` | 50 | Period of the ATR used for normalisation. Keep it at least as long as the longest horizon to obtain a stable volatility reference. |
| `InpAgreeLevel` | 0.80 | Minimum share of agreeing scales required to colour the histogram. 0.80 asks for four lines out of five, 1.00 asks for all of them. |
| `InpAppliedPrice` | PRICE_CLOSE | Price the regressions work on. PRICE_TYPICAL makes the ribbon slightly more stable on instruments with long wicks. |
## Advantages / strengths
- One comparable scale across any symbol and timeframe thanks to ATR normalisation: a value of 1.5 means the same thing on gold and on EURUSD.
- No repaint: the value printed on a closed bar is never rewritten.
- Separating direction from agreement makes transition phases recognisable, exactly where most trend filters give contradictory signals.
- Only five parameters, all with immediate meaning, and no dependency on external indicators or libraries.
## Limitations and warnings
- Linear regression lags by construction: on sharp reversals the long scales stay oriented the wrong way for several bars.
- On M1 and M5 the five scales rarely agree and the histogram stays grey most of the time.
- Computing regressions over five windows is heavier than a moving average: on very long histories the first pass takes a few seconds.
- It produces no entry signals and no operational levels: it is a context filter and must be paired with a trigger logic and risk management.
**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
`trend`, `regression`, `slope`, `atr`, `multi timeframe`, `trend filter`, `no repaint`, `ribbon`
