Translated from PinScript language, here is the squeeze momentum indicator. This one is the representation of the market squeezing by comparing 2 sets of “bands” indicators : bollinger one and a ranging one that can be assimilated to enveloppe.
The squeezing value of market take an undefined value when it is squeezing, so signals are generated when the white line is suited to the histogram (the linear regression line oscillating below and underneath 0).
Works well on forex market pairs.
// parameters :
// length = 20
// mult = 2
// lengthKC = 20
// multKC = 1.5
basis = average[length](close)
dev = mult * Std[length](close)
upperBB = basis + dev
lowerBB = basis - dev
ma = average[lengthKC](close)
myrange = range[lengthKC]
rangema = average[lengthKC](myrange)
upperKC = ma+rangema * multKC
lowerKC = ma-rangema * multKC
value = (Highest[lengthKC](high)+Lowest[lengthKC](low)+average[lengthKC](close))/3
val = linearregression[lengthKC](close-value)
sqzOn = (lowerBB>lowerKC) AND (upperBB<upperKC)
sqzOff = (lowerBB<lowerKC) and (upperBB>upperKC)
squeeze = undefined
squeeze = val
RETURN val AS "momentum", squeeze AS "momentum squeeze"
No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.ProRealTime ITF files and other attachments :