[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GEN: Keltner Bands



PureBytes Links

Trading Reference Links

Enid Ginn wrote:

> I am interested in learning about Keltner price channels.  Does anyone know
> of a good text that addresses these (construction, application etc)

My EL code for the Keltner Channel follows.  There are 2 inputs - 'width' is the 
multiple applied to the computed avergae daily range, and 'length' is the equivalent 
moving average length used to compute the smoothing factor.

I modified the original simple code to handle the problem of zero range bars 
distorting the channel width.  In this version, any zero range bar is ignored in the 
exponential smoothing.

Application is similar to that of Bolinger Bands, as described in most introductory 
texts, but the volatility measurement used to determine the width is based on daily 
range (high - low) rather than net change (close to close).  This makes more sense 
to me, as it is entirely possible to have a very volatile market with wide-ranging 
bars, and yet have successive closes at almost the same price.  In this case, the 
Keltner channel gets wider, but the Bollingers will narrow, despite the high volatility.

The 21-bar smoothing is about as good a number as any, but the width needs to be 
adjusted empirically.  Apply the indicator to your chart and observe where short-
term price reversals have taken place in the recent past.  If the majority of them are 
just outside the bands, then that's fine;  otherwise, adjust the 'width' input as 
required.  The market should trade within the channels about 90% of the time.

Bob Young


--------INDICATOR - Keltner Channel------------------------

input: width(2.5);
input: length(21);

var: k1(0);
var: k2(0);
var: ma(0);
var: ar(0);
var: factor(0);

ma = XAverage(close,length);

If Length + 1 <> 0 then Begin
  If CurrentBar <= 1 then begin
    Factor = 2 / (Length + 1);
    ar = range;
  End
  Else  
  if range <> 0 then ar = Factor*range + (1-Factor)*ar[1]
	else ar=ar[1];
End;

k1 = ma + width*ar;
k2 = ma - width*ar;
plot1(k1,"k1");
plot2(k2,"k2");

if CheckAlert then begin
	if low crosses below k2 then Alert=TRUE;
	if high crosses above k1 then Alert=TRUE;
end;