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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
// parameters : // length = 20 // mult = 2 // lengthKC = 20 // multKC = 1.5 //BB basis = average[length](close) dev = mult * Std[length](close) upperBB = basis + dev lowerBB = basis - dev //KC 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) if(sqzOn) THEN squeeze = undefined ENDIF if(sqzOff) THEN squeeze = val ENDIF RETURN val AS "momentum", squeeze AS "momentum squeeze" |
Share this
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 :PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials