Trend Intensity Index
A moving-average crossover only reports which side of the average price is on right now, not how consistently it has stayed there. The Trend Intensity Index answers the consistency question directly: over the trailing half of the averaging window, it counts what share of the close-minus-average deviations landed above the average versus below it, and reports that share as an index from 0 to 100. A reading pinned near 100 (or near 0) means recent closes have consistently sat on one side of their own average - a genuine trend by this measure - while a reading drifting around 50 means price has been crossing back and forth across the average, the signature of a chop. Because it measures a SHARE of deviations rather than their SIZE, the index stays naturally bounded regardless of the instrument's volatility or the scale of its price - a highly volatile instrument chopping evenly across its average reads the same near-50 as a quiet one doing the same thing, which a raw deviation-distance measure would not achieve without separate normalisation. Notes and limitations - With no deviation on either side of the average within the scored window (a perfectly flat run of identical closes), the index reports a neutral 50 rather than dividing by zero. - The index reads consistency of position relative to the average, not the average's own slope - a market oscillating tightly but staying entirely on one side of a flat average can still read as a strong trend by this measure even without much net price movement. - Like any trend-strength gauge, it is descriptive of what already happened over the scored window, not predictive of what happens next.
Indicator · MT5 · v1.0 · Free
About Trend Intensity Index
Trend Intensity Index is an indicator for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Period and Alerts. MQL source code included.
Files in the download: TrendIntensityIndex.ex5, TrendIntensityIndex.mq5, TrendIntensityIndex.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Period | 30 | SMA period; the trailing half of this window is scored |
| Alerts | true | Alert once per closed bar on an 80/20 threshold cross |
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: Moving Average · Trend · Trailing Stop & Break-even · Alerts · MT5 Indicator · MQL5 Source Code