Sharpen Your Moving Averages

Discussion in 'Technical Analysis' started by panzerman, Nov 27, 2023.

  1. panzerman

    panzerman

    Here is a simple trick from the world of digital signals processing to improve the filtering performance of your MAs.

    1. Filter the input signal, x(n) i.e. price, once with your moving average
    2. Double the moving average value to obtain w(n)
    3. Subtract w(n) from 3*x(n) to obtain u(n)
    4. Filter u(n) twice with your moving average to obtain your output y(n)

    You are welcome.
     
    murray t turtle likes this.
  2. tony.m

    tony.m

    Sounds like you’re ready to start selling courses and indicators.
     
    murray t turtle and Craig66 like this.
  3. panzerman

    panzerman

    No, I just want to help folks.

    For my next tip, to get zero lag or even negative lag, research forward-backward filtering using emas (ie one-pole infinite impulse response filters.) You will get outstanding filtering performance, which can be improved even further by sharpening your reverse ema.
     
    destriero and Real Money like this.
  4. MarkBrown

    MarkBrown

    first order filter ?
     
    murray t turtle likes this.
  5. panzerman

    panzerman

    Yes. You can certainly use more poles in your filter design, but in reverse filtering situations, you will need to estimate more days into the future with higher order IIRs, which introduces more chances for errors in the output.
     
  6. schizo

    schizo

    Only way to tell is to actually see a chart with your ema next to the regular ema. Can you whip up a chart with those indicators and post it so we can see the comparison?
     
  7. themickey

    themickey

    If you have a pile of dogshit and mix in with it more and different dogshit, with that you can't bake a cake, doesn't matter what sort of dogshit recipe formula you use.
     
    Scataphagos and tony.m like this.
  8. Zwaen

    Zwaen

    The goal of using a ma is often to see a trend, or let's call it dominant movement of a time series. Perhaps also eyeballing momentum.

    How does this add value to this goal?
     
    murray t turtle likes this.
  9. tony.m

    tony.m

    It would have been different if it was cow shit.
    [​IMG]
     
    themickey likes this.
  10. Real Money

    Real Money

    ET - panzerman.png

    thinkScript code implementation
    Code:
    plot Xn = close;
    plot EMA = ExpAverage(Xn,20);
    plot Wn =  2 * EMA;
    plot Un = 3 * Xn - Wn;
    plot EMA1 = ExpAverage(Un,20);
    plot EMA2 = ExpAverage(EMA1,20);
     
    #10     Nov 28, 2023