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

Re: Keltner bands code



PureBytes Links

Trading Reference Links

here you go...

function: KeltnerChannel

{*******************************************************************
Description: Keltner Channel
Provided By: Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Price(NumericSeries), Length(NumericSimple),
Factor(NumericSimple);

KeltnerChannel = Average(Price, Length) + AvgTrueRange(Length) * Factor;

{*******************************************************************}

Inicator: KeltnerChannel

{*******************************************************************
Description : This Indicator plots Keltner Channel
Provided By : Omega Research, Inc. (c) Copyright 1999
********************************************************************}

Inputs: Price(Close), Length(10), Const(1.5), Displace(0);
Variables: Avg(0), UpperK(0), LowerK(0), AbsDisp(0);

Avg = Average(Price, Length);
UpperK = KeltnerChannel(Price, Length, Const);
LowerK = KeltnerChannel(Price, Length, -Const);

If Displace >= 0 OR CurrentBar > AbsValue(Displace) Then Begin
 Plot1[Displace](Avg, "CentLine");
 Plot2[Displace](UpperK, "K_Upper");
 Plot3[Displace](LowerK, "K_Lower");

 {Alert Criteria}
 Condition1 = Plot2 <> Plot3;
 If Price > Plot2 AND Condition1 Then
  Alert("Price is above the upper band")
 Else
  If Price < Plot3 AND Condition1 Then
   Alert("Price is below the lower band");

 {Keltner Channel Expert Commentary}
 #BeginCmtry
  Commentary(ExpertKeltnerChannel(Plot2, Plot3));
 #End;
End;

{*****************************************************************}

regards

michael

> Thinking the Keltner bands code would be pretty common
> among this group.   Can anyone put out the code, or an ela?
>
> thanks in advance...
>
> MScheier
>