Académique Documents
Professionnel Documents
Culture Documents
When the BB is
inside the KC you get a green dot and you’re trading sideways. When the BB breaks out
of the KC you get a red dot and you trade in the direction of the squeeze histogram.
Possible exits: When the price goes inside the Keltner again, when the BB touches the
KC, or when the histogram peaks or goes to 0.
Code for Squeeze
Input Length = 20; # Length for Avg True Range & Std. Dev Calcs
Input SqueezeOnColor = 2;
Input SqueezeOffColor = 6;
# scaling factor :
# Standard Deviation
# for alert
plot BBS_Index = 0;
BBS_Index.SetStyle(4);
BBS_Index.SetLineWeight(2);
# --------------------------------------------------------
# Inertia = LinearRegValue
BBSqueeze_Pos.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BBSqueeze_Pos.SetLineWeight(2);
BBSqueeze_Neg.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
BBSqueeze_Neg.SetLineWeight(2);
def BBS_CrossOverAlert = if (BBS_Ind > BBS_Ind[1] and (BBS_Ind > AlertLine) and
(BBS_Ind[1] < AlertLine), (LRVGreens * LHMult + 150 * minPriceMove), 0);
CrossOverAlert.SetPaintingStrategy(PaintingStrategy.POINTS);
CrossOverAlert.SetLineWeight(4);
CrossOverAlert.assignValueColor(Color.Light_green);
CrossOverAlert.assignValueColor(GetColor(SqueezeOnColor));
# SQUEEZE OFF
def BBS_CrossUnderAlert = if (BBS_Ind < BBS_Ind[1] and (BBS_Ind < AlertLine) and
(BBS_Ind[1] > AlertLine), (LRVReds * LHMult - 150 * minPriceMove), 0);
CrossUnderAlert.SetPaintingStrategy(PaintingStrategy.POINTS);
CrossUnderAlert.SetLineWeight(4);
CrossUnderAlert.assignValueColor(GetColor(SqueezeOffColor)); # Color.Light_red);