Mass Index
The Mass Index, created by Donald Dorsey, compares the trading range (High - Low) for each point in the period to try and identify trend reversals. The greater the difference between the High and the Low, the greater the Mass Index; Conversely the smaller the difference between the High and the Low, the smaller the Mass Index is.
Dorsey hypothesized that, when the figure jumps above 27 – creating a “bulge” – and then drops below 26.5, the stock is ready to change course. An index of 27 represents a rather volatile stock, so some traders set a lower baseline when determining the presence of a price bulge.
SUM(XAVG(Hz - Lz, 9) / XAVG(XAVG(Hz - Lz, 9), 9), x) |
x =Period, z =Offset |
Where x is the period which must be an integer.
Where z is the offset. An offset of 1 returns the value from 1 bar ago instead of the current value.
Examples
A 25 period mass index for the current bar can be written as follows.
SUM(XAVG(H0 - L0, 9) / XAVG(XAVG(H0 - L0, 9), 9), 25)
But you can leave off the offset parameters because it is for the current bar instead of for a previous bar.
SUM(XAVG(H - L, 9) / XAVG(XAVG(H - L, 9), 9), 25)
If you wanted the value for the previous bar instead of the current bar, you would need to use the offset parameters.
SUM(XAVG(H1 - L1, 9) / XAVG(XAVG(H1 - L1, 9), 9), 25)


Read more about Mass Index on Investopedia