YungTraderFromMontana
Well-known member
While working on my other breakout indicator I ended up making this, as a trader look for a squeeze of the upper and lower ranges (range tighter then usual) with an accompanying move up or down of the true range.
Code:
input length1 = 8;
input length21 = 80;
input length31 = 4;
input price = close;
input BuyEntry3 = 10;
input SellEntry3 = 10;
assert(length1 > 0, "'length' must be positive: " + length1);
plot ROC = if price[length1] != 0 then (price / price[length1] - 1) * 100 else 0;
roc.SetDefaultColor(GetColor(9));
Assert(length21 > 0, "'length' must be positive: " + length21);
def QB3 = Highest(ROC, BuyEntry3);
def QS3 = Lowest(ROC, SellEntry3);
plot trueqb3 = QB3[1];
trueqb3.SetDefaultColor(GetColor(5));
plot trueqs3 = QS3[1];
trueqs3.SetDefaultColor(GetColor(5));
def squeeze = (trueqb3 - trueqs3) < 5;
plot bottom = 10;
bottom.SetDefaultColor(GetColor(14));
plot top = -10;
top.SetDefaultColor(GetColor(14));
Last edited by a moderator: