Low Pass vs SMA

Discussion in 'Strategy Building' started by luckyputanski, Sep 16, 2012.

  1. Now, this is probably the most interesting post in this thread.
     
    #11     Sep 16, 2012
  2. Ok, let's forget excel for now. Below is code in Java (for some reason I can't post code on this forum).

    Length is 1000, Index is an iterator set to last bar. LowPass 0 and LowPass 1 are filled with price, rest is calculated. Last item in LP array is returned as LowPass value for last bar.
    Am I doing everything right?
     
    • code.png
      File size:
      15.8 KB
      Views:
      190
    #12     Sep 16, 2012
  3. panzerman

    panzerman

    Getting a zero lag moving average is easy:

    Step 1: Calculate a MA (any MA) of price
    Step 2: Calculate a second MA of the first MA using the same parameters.
    Step 3: 2*MA1-MA2 = zero lag MA

    However, having a zero lag MA doesn't give you any better performance as an indicator than any other MA. Again, do some proper back testing and prove it for yourself.
     
    #13     Sep 16, 2012
  4. Let's keep this thread on track - I'm trying hard to see advantage of JCL's low pass filter over SMA, first.
     
    #14     Sep 16, 2012
  5. panzerman

    panzerman

    And I'm trying to tell you that there really isn't any advantage. You can make any MA zero lag if you wish by using the above technique, but one zero lag MA is probably not better than any other zero lag MA.
     
    #15     Sep 16, 2012
  6. That's the experience I have so far. But JCL swears by his low pass filter, so I'm trying to see if it's me doing something wrong, or is it... well, not sure what. I'm just keeping open mind, letting others to prove me wrong.
     
    #16     Sep 16, 2012
  7. jcl

    jcl

    Luckyputanski: I do not necessarily swear by the Lowpass filter, which is by the way not my idea, but goes back to Ehlers. I'm saying that due to its low lag it's a tool that is useful for almost all systems.

    panzerman: I believe you that you see no improvement with your zero lag MA - I don't know where you got that recipe from, but it has obviously exactly the same lag as a normal SMA.

    [​IMG]
     
    #17     Sep 16, 2012
  8. JCL, you stated many times in other threads that this low pass filter is better than SMA. I'm using SMA at the moment, but I would love to see something better. So far, low pass filter is not any better than SMA, so I'm asking you to prove me wrong.
    Is my java code correct?
     
    #18     Sep 16, 2012
  9. panzerman

    panzerman

    You are somehow not doing the math right. Search for Rocket Science for Traders by Ehlers. He will break it down in detail for you.
     
    #19     Sep 16, 2012
  10. jcl

    jcl

    I'm not sure that the Java code is correct, at least it calculates the function in a different way with a loop. The correct way would be to shift the series arrays first by 1, then calculate only the [0] term. Can't you just download Zorro or any other platform such as Ninja Trader that directly supports series? This would spare a long discussion or long workarounds in code - you can then just directly enter the code and test Lowpass vs. SMA in one minute.
     
    #20     Sep 16, 2012