Here is Nicks Next Big Move, from TS:
[LegacyColorValue = true];
{ NickMNxtMove, "NickM Next Move" }
{ Bolinger Band Squeeze (BBS) Indicator }
{ A variation of an idea by nickm001 (Originally coded by eKam) that when Bollinger Bands (BB) fit inside
the Keltner Channel (KC), a breakout is about to occur. It works on longer term charts, such as
15 minute to daily charts.
This code creates an indicator that plots the ratio of BB width to KC width. When BB and KC widths are
the same, the ratio (BBS_Ind)is equal to one (1). When the BB width is less than the KC Width (i.e. BB
fit inside KC), the BBS_Ind is less than one and a breakout is indicated.
An Alert Line is provided to indicate the level at which the trader considers that the "sqeeze is on" and
a breakout is eminant.
Coded by Kahuna 9/10/2003
Added by eKam: 9/10/2003
The average of where price has been relative to the Donchian mid line and Exponential average of the
same length is also plotted as an attempt to predict the direction of the breakout.
}
Inputs: {------------------------------------------------}
Price(Close),
Length(20), { Length for Average True Range (ATR) & Std. Deviation (SD) Calcs }
nK(1.5), { Keltner Channel ATRs from Average }
nBB(2), { Bollinger Band Std. Devs. from Average }
AlertLine( 1), { BBS_Index level at which to issue alerts }
NormalColor( blue), { Normal color for BBS_Ind }
AlertlColor( darkred) { Color for BBS_Ind below alert line }
;
Variables: {---------------------------------------------}
ATR(0), { Average True Range }
SDev(0), { Standard Deviation }
BBS_Ind(0), { Bollinger Band Squeeze Indicator }
alertTextID(-1)
;
if barnumber = 1 and alertTextID = -1 then
alertTextID = Text_New(date,time,0,"dummy");
{-- Calculate BB Squeeze Indicator ----------------------}
ATR = AvgTrueRange(Length);
SDev = StandardDev(Price, Length, 1);
BBS_Ind = (nBB * SDev) / (nK * ATR);
{-- Plot the Index & Alert Line -------------------------}
Plot1(BBS_Ind, "BBS_Ind");
Plot2(AlertLine, "AlertLine");
If Plot1 < Plot2 then
SetPlotColor(1, NormalColor)
else
SetPlotColor(1, AlertlColor);
{-- Plot delta of price from Donchina mid line ----------}
value2 = LinearRegValue(Price-((Highest(H,Length)+Lowest(L,Length))/2
+
xAverage(Price,Length))/2,
Length,0);
var:color(0); color = yellow;
if value2>0 then color = green;
if value2<0 then color = red;
{plot3(value2,"nickmNxtMove",color);}
{-- Issue Alert when the Squeeze is On ------------------}
if BBS_Ind crosses below AlertLine
and Text_GetTime(alertTextID) <> time then begin
text_setLocation(alertTextID, date, time, 0);
Alert("BB Squeeze Alert");
end;