ITrend and Trigger by Dr. Ehlers

  •  01-12-2006, 3:38

    ITrend and Trigger by Dr. Ehlers

    Here is the ITrend formula with an Initialization addition that
    reduces the long convergence time for very low values of Alpha.
    It presents also the addition of a trigger.
    Code:

    {=======================}
    {Need the ADSI's DLL from www.thedml.com}
    Pc:=
    Input("Price Code=C,Med,Typ,WMA4 [1-4]",1,4,3);
    Ap:=Input("Alpha Value",0.001,1,0.0198);
    ILen:=Input("Initialization Period",10,1000,60);

    WMA4:=Mov(Typ(),4,W);
    Dlt:=(0.33-Ap)/ILen;
    Apn:=If(Cum(1)<=ILen,0.33-(Cum(1)*Dlt),Ap);

    Pr:=
    If(Pc=1,C,
    If(Pc=2,MP(),
    If(Pc=3,Typ(),WMA4)));

    Ind:=
    ExtFml("ADSI.ITrend",Pr,Apn);
    Trig:=2*Ind-Ref(Ind,-2);

    Ind;
    Trig;
    {=================}
View Complete Thread