HPotter

MASS Index

The Mass Index was designed to identify trend reversals by measuring
the narrowing and widening of the range between the high and low prices.
As this range widens, the Mass Index increases; as the range narrows
the Mass Index decreases.
The Mass Index was developed by Donald Dorsey.

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?
////////////////////////////////////////////////////////////
//  Copyright by HPotter v1.0 13/05/2014
// The Mass Index was designed to identify trend reversals by measuring 
// the narrowing and widening of the range between the high and low prices. 
// As this range widens, the Mass Index increases; as the range narrows 
// the Mass Index decreases.
// The Mass Index was developed by Donald Dorsey. 
////////////////////////////////////////////////////////////
study(title="MASS Index", shorttitle="MASS Index")
Length1 = input(9, minval=1)
Length2 = input(25, minval=1)
hline(27, color=blue, linestyle=line, title = "Setup")
hline(26.5, color=red, linestyle=line, title = "Trigger")
xPrice = high - low
xEMA = ema(xPrice, Length1)
xSmoothXAvg = ema(xEMA, Length1)
nRes = sum(iff(xSmoothXAvg != 0, xEMA / xSmoothXAvg, 0), Length2)
plot(nRes, color=red, title="MASS Index")