TTM Squeeze is a proprietary code. below code is somewhat similar
Can someone modify it to be a sell conditional order when the histogram loses bull momentum
:
Can someone modify it to be a sell conditional order when the histogram loses bull momentum
Ruby:
# Momentum Squeeze
# Mobius
declare lower;
input length = 20; #hint length: Length for average calculation
input SDmult = 2.0;
input ATRmult = 1.5;
def c = close;
def h = high;
def l = low;
def K = (Highest(h, length) + Lowest(l, length)) /
2 + ExpAverage(c, length);
plot Momo = if isNaN(close)
then double.nan
else Inertia(c - K / 2, length);
Momo.setPaintingStrategy(PaintingStrategy.HISTOGRAM);
Momo.setLineWeight(3);
Momo.assignValueColor(if Momo > Momo[1] and Momo > 0
then Color.Cyan
else if Momo > 0 and Momo < Momo[1]
then Color.Blue
else if Momo < 0 and Momo < Momo[1]
then Color.Red
else Color.Yellow);
Last edited by a moderator: