Hi,
DOC,
Thanks for your afl on BB(9,2) and CROSSOVER(5,6). I want to know was it developed for Interaday trading or for Positional trading ? I want to file it accordingly in my records, hence the question.
Hi, Anant,
Savant sir always mentions to keep a close eye on contracting Bolinger band.
I found an afl (perhaps you might have come accros with it !) which I feel may be useful to sort out / FILTER the contracting BB equities in advance and help out to mark scripts, in DOC's afl for BB (9,2 ) and CROSSOVER (5,6 ), though it will require some correction as per the writer of the afl itself. It plots a nice graph but needs corrections for scan/filter. Need your help for required correction in the afl.
May I request you, Doc and others to check the usefulness of the afl and then release it for all if think so by you seniors. I am not competent to write an afl neither so far reached to a level to juge the system, but feel some-where the need of some supportive add on in the afl developed by DOC (under able guidence of Respected Savant Sir)for SORTING/FILTERING ONLY ( LET ME BE VERY CLEAR NOT FOR PLOTTING) a large number of equities giving buy/sell signals after scan/explore at EOD study. This may give an additional signal! Not any change in the DOC'S original SGS.afl please!
AFL GOES LIKE THIS COPY AND PASTE IT IN THE FORMULA EDITOR
/*
Bollinger bands squeeze.
By Vladimir Gaitanoff, 2005. support<at>vglib<dot>com
This is a volatility indicator.
It can be used to determine the periods of extremes of low volatility which usually followed by big moves.
Indicator does not show direction of the trade, only timing. Some other aspects of technical/fundamental analysis should be employed for direction.
There is a signal line with colored dots. Red dots indicate periods of low volatility (sqeeze).
Green dots indicate periods of high volatility.
Indicator line crosses above and below signal line. Time trades at historical extremes of low volatility.
It can be used for scans, for instance, to find stepper stocks before big moves.
The original author of the idea uses it for intraday trading.
For confirmation look for sqeezes in two different time frames.
*/
Length = 8;
Price = EMA(Close, Length);
// Keltner
kLength = Length;
kN = 1.5;
kATR = ATR(kLength);
kUpper = Price + kN * kATR;
kLower = Price - kN * kATR;
// Bollinger
bbLength = Length;
bbN = 2;
bbStDevValues = StDev(Close, bbLength);
bbUpper = Price + bbN * bbStDevValues;
bbLower = Price - bbN * bbStDevValues;
IsSignal =
bbUpper <= kUpper AND
bbLower >= kLower;
Graph0 = 1;
Graph0Style = styleDots;
Graph0BarColor = IIf(IsSignal, colorRed, colorGreen);
Proportion = (kUpper - kLower) / (bbUpper - bbLower);
Graph1 = Proportion;
Title = "Next Move Signal.BB SQUEEZE. In squeeze: " + WriteVal(IsSignal, 1) + " Keltner/Bollinger: " + WriteVal(Proportion);
-SECTION END();
--------------------------------------------------------------------------
Please give attention to the thoughts of the afl writer,
Indicator does not show direction of the trade, only timing.
It can be used for scans, for instance, to find stepper stocks before big moves.
Will somebody explain the meaning of
For confirmation look for sqeezes in two different time frames.
and the,
Some other aspects of technical/fundamental analysis should be employed for direction.
Regards.
CNB
Hi,
All ,
I noticed one more afl and thought might be useful for this BB and Crossover strategy. The afl is written by somebody else. It plots a graph and I didnot understand much from it, need help from the seniors to guide to understand it.
Also I here by request seniors to help to write an afl on the logic of above or afl given bellow to write a code/ afl that will help to
EXPLORE CONTRACTING BOLLINGER BAND
I TRIED MY LEVEL BEST TO WRITE AN EXPLORATION AFL FOR BB SQUEEZE BUT STILL COULD NOT DO IT. A FAILURE AT MY SIDE !
Regards and thanks in advance,
CNB
OTHER AFL GOES LIKE THIS....
==========================================================
//~~~~~~~~~~~~~~~~~~~~~ John Carter's TTM Squeeze Indicator~~~~~~~~~~~~~~~~~~~~~
// Description: Bollinger Bands AND Keltner Channel define the market
// conditions, i.e. when BB is narrower than KC then we have
// a market squeeze. When BB break Outside the KC then trade
// in the direction of the smoothed Momentum(12).
// Parameters:
// * chanPeriod - Bollinger Bands AND Keltner Channel length
// * bolBandStdDev - width of the Bollinger Bands
// * keltStdDev - width of the Keltner Bands
// * momPeriod - # of bars for Momentum indicator
// * momEMA - EMA of the Momentum indicator
//
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// Source : John Carter,
www.TradeTheMarkets.com
// Interpretation : Kris Tokarzewski, Johannesburg, 15-Dec-2006
// AmiBroker Conversion: Levent Pancuk, 22 Feb-2008
//
[email protected]
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_SECTION_BEGIN("TTM Squeeze");
function Momentum( array, period )
{
return array - Ref( array, -period );
}
chanPeriod = Param("Channel Period", 20);
bolBandStdDev = Param("Bollinger Band StdDev",2);
keltStdDev = Param("Keltner Band StdDev",1.5);
momPeriod = Param("Momemtum Period", 12 );
momEMA = Param("Momentum EMA Period", 5);
highBBChl = BBandTop( C, chanPeriod, bolBandStdDev);
lowBBChl = BBandBot( C, chanPeriod, bolBandStdDev);
centerLine = MA( C, chanPeriod );
highKeltn = centerLine + keltStdDev * ATR(chanPeriod);
lowKeltn = centerLine - keltStdDev * ATR(chanPeriod);
momHist = EMA(Momentum(C, momPeriod),momEMA);
BBUp = IIf(highBBChl > highKeltn AND momHist > 0, momHist, 0);
BBDo = IIf(lowBBChl < lowKeltn AND momHist < 0, momHist, 0);
BBMid = IIf(BBUp == 0 AND BBDo == 0, momHist, 0);
Buy = BBUp;
Sell = BBDo;
Buy = ExRem(Buy,Sell);
Sell = ExRem(Sell,Buy);
Plot(BBUp, "TTM Squeeze - Momentum Up", colorBlue,styleHistogram | styleThick);
Plot(BBDo, "Momentum Down", colorOrange, styleHistogram | styleThick);
Plot(BBMid, "Momentum Mid", IIf(BBMid > 0, colorLightBlue, colorBrown), styleHistogram | styleThick);
PlotShapes( shapeSmallCircle*Buy, colorGreen,0, 0, 0);
PlotShapes( shapeSmallCircle*Sell, colorRed,0, 0, 0);
_SECTION_END();
==========================================================