How to implement recursive code?

  •  01-11-2006, 1:06

    How to implement recursive code?

    Many of MS users bent their head against the wall trying to code some recursive filters that are so abundant in the trading literature.
    I will split this post in 2 subjects:

    1) The "+PREV-PREV" construct explanation
    If one of the MSFL experts can provide some details about how this construct works and few examples about what can be achieved with it.
    (one example is from the Equis Customer Zone web site "Tips from TASC Magazine" = Ehlers filters)

    2) Recursive Equations
    An example about the CORRECT way to implement this type of recursive code:
    f:=a*Typ()+b*f[1]+c*f[2]+d*f[3]+e*f[4]; where f[1],f[2],f[3],f[4] are the referenced function values 1,2,3 and 4 bars ago.

    (It's clear that PREV=f[1] but I believe the Ref(PREV,-1) is not equivalent to f[2]).

    I am sure this post will provide an extremely valuable answer for the MS community, so the experts of MSFL that can find a solution for it will be highly praised.

    Guara
View Complete Thread