Squeeze Momentum Indicator

Category: Indicators By: Nicolas Created: October 11, 2015, 1:55 PM
October 11, 2015, 1:55 PM
Indicators
0 Comments

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

//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"

Download
Filename: Squeeze-momentum-indicator.itf
Downloads: 375
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...