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

Sibbits Demand Index



PureBytes Links

Trading Reference Links

Did I post this twice? If so, sorry.

As promised, Sibbet's Demand Index. For some reason, you don't see
this around, but it is a really good indicator. I trade the peaks.
It uses volume, so its not as good if used on mutual funds or
indexes.

The ELA has both the indicator and the function.

The indicator:


{       James Sibbet's Demand Index Indicator   }
{       Programmed by David Fenstemaker         }
{       The Demand Index combines price and volume in   }
{       such a way that it is often a leading indicator of      }
{        price change.  }

Inputs: Length(5);

Vars: DMIndx(0);

DMIndx = DeMand.Index (Length) ;

Plot1(DMIndx, "DMI") ;
Plot2(0, "Zero") ;

{       James Sibbet's Demand Index Function     }
{       Programmed by David Fenstemaker }
{       The Demand Index combines price and volume in   }
{       such a way that it is often a leading indicator of      }
{       price change.   }


The function:

Inputs: Length (NumericSeries);

Vars :  WtCRatio(1), VolRatio(1), VolAvg(Volume), 
        BuyP(1), SellP(1), Sign(+1), Return(0),
        WghtClose(Close), AvgTR(High - Low),  
        Constant(1),  BuyPres(1),  SellPres(1),          
        TempDI(1),  DMI(1);

If CurrentBar = 1 then 
    Begin
        VolAvg = Average(Volume, Length);
    End;

Return = 0 ;

WghtClose = (High + Low + Close + Close) * 0.25;
AvgTR = Average (Highest (High, 2) -  Lowest ( Low, 2), Length);
VolAvg = ((VolAvg [1] * (Length - 1)) + Volume) / Length;

If WghtClose  <>  0 and WghtClose[1] <> 0 and
        AvgTR  <>  0 and VolAvg <> 0 then
Begin
        WtCRatio = (WghtClose - WghtClose[1]) / MinList(WghtClose,
WghtClose[1]) ;
        VolRatio = Volume / VolAvg;
        Constant   = ((WghtClose * 3) /AvgTR) * AbsValue (WtCRatio);
        If Constant > 88 then Constant = 88;
        Constant   = VolRatio / ExpValue (Constant);
        If WtCRatio > 0 then 
        Begin
            BuyP = VolRatio;
            SellP = Constant;
        End
        Else
        Begin
            BuyP = Constant;
            SellP = VolRatio;
        End;

        BuyPres = ((BuyPres [1] * (Length - 1)) + BuyP) / Length;
        SellPres = ((SellPres [1] * (Length - 1)) + SellP) / Length;

        TempDI   =  +1;

        If SellPres  > BuyPres then 
        Begin
            Sign  =  -1;
            If SellPres <> 0 then TempDI = BuyPres / SellPres;
        End
        Else 
        Begin
            Sign  =  +1;
            If BuyPres <> 0 then TempDI = SellPres / BuyPres;
        End;

        TempDI = TempDI * Sign;
        If TempDI < 0 
        then 
                DMI = -1 - TempDI
        else 
                DMI = +1 - TempDI ;

        Return = DMI {* 100.0} ;

End;

Demand.Index = Return ;
Attachment Converted: "c:\eudora\attach\Dmxind1.ela"