Sharpen Your Moving Averages

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

  1. panzerman

    panzerman

    In this bit of code:

    IIRMA = Fraction * ( 2 * Series - Series[Lag] ) + ( 1 - Fraction ) * IIRMA[1];

    The (2 * Series - Series[Lag]) adds a momentum component to the output, which reduces lag, but also increases noise too. Try using this bit of code:

    IIRMA = Fraction * ( 0.5 * (Series+Series[1] )) + ( 1 - Fraction ) * IIRMA[1];

    This puts a zero in the transfer response at the Nyquist frequency, thus improving attenuation ability of the filter at the expense of an increase in lag. To get less lag, use a shorter length. It's all a matter of trade-offs in what a filter will provide for you.
     
    #21     Nov 28, 2023
    MarkBrown likes this.
  2. schizo

    schizo

    Do you really need those rainbows (price bands)? What purpose do they serve? Also what's up with "initiate" and "review"? What are those all about?
     
    #22     Nov 28, 2023
    murray t turtle likes this.
  3. schizo

    schizo

    For some reason, mine doesn't line up with yours. For example, you can see in the charts below where yours come in below the price and mine clearly above.


    upload_2023-11-28_17-33-25.png

    upload_2023-11-28_17-32-17.png

    Also you need to modify the code a bit, otherwise it comes up all garbled.

    PHP:
    def Xn close;
    def EMA ExpAverage(Xn20);
    def Wn =  EMA;
    def Un Xn Wn;
    plot EMA1 ExpAverage(Un20);
    plot EMA2 ExpAverage(EMA120);
     
    #23     Nov 28, 2023
  4. Real Money

    Real Money

    You're charting the wrong series. My chart has 'EMA' and 'EMA2' on it (EMA2 is the panzerman filter). You charted 'EMA1' and 'EMA2' instead. You just disable the plot on everything else, otherwise you will get too many series.

    It's actually kind of an interesting technique. Basically, it's very difficult for the price to "game" the average, since it can't affect the filter easily. He's transforming the price/indicator differential with a sort of noise amplification technique, then heavily filtering the resulting series.
     
    Last edited: Nov 28, 2023
    #24     Nov 28, 2023
    schizo likes this.
  5. schizo

    schizo

    Ahh, my bad. Thanks for the pointer. While I don't fully understand the nuance, it sure is interesting.
     
    #25     Nov 28, 2023
  6. %%
    SEEMS common + logical, for ma , even if they do lagg .NOT sure many would want to admit it.
    I don't know if Bill or Melinda Gates uses them ;
    but i found out Bill Gates measures a lot more than I thought he did.
     
    #26     Dec 4, 2023
    Zwaen likes this.
  7. Zwaen

    Zwaen

    I could not find another great use of them. Can be a lack of imagination on my part :D They can be a starting point of a move, but so a certain percentage or any line can be it.
     
    #27     Dec 4, 2023
    murray t turtle likes this.
  8. Zwaen

    Zwaen

    Curious, how do you determine this? Or put otherwise, how can you detect this to some degree in a time series of closes? It is a quadrazillion dollar question, how can this positively add to your directional bias?
     
    #28     Dec 4, 2023

  9. Intra-day trading is fractal and current momentum certainly plays a role in future momentum. I don't trade the markets just from as one dimensional. I view them as more of a cylinder. Maybe another way to say it would be say we have 0-100, going above 100 can actually put you back at 0, instead of "oh we're above 100, now we're even more extended!". Which is how it seems a lot of other people use and view oversold and overbought indicators.

    It all goes back to context. Yes, overbought or oversold is just a math equation. But I've noticed under certain circumstances you actually want to hold long into overbought (or potentially even initiate a brand new entry). Where as in other context situations, overbought expectation is it will get retraced and filled back in very quickly.

    Not sure if this makes any sense or answers your question? Don't know how else to answer it besides giving you exactly what I use.
     
    #29     Dec 4, 2023
    Zwaen likes this.
  10. Zwaen

    Zwaen

    Thanks for your thorough explanation, you are being crystal clear. Have never looked at it this way, using both a lower and upper limit for momentum. Do not trade intraday, but thanks for the little light switch
     
    #30     Dec 4, 2023