The perfect moving average

Discussion in 'Technical Analysis' started by aphexcoil, Sep 6, 2002.

  1. dottom

    dottom

    #11     Sep 6, 2002
  2. dottom,

    That was an excellent site! Thank you for that information. I'm going to do more research on the JMA and wavelets, but my mathematics level only got up to Differential Equations -- I never got into number theory.

    aphie
     
    #12     Sep 6, 2002
  3. Aphie,

    Whether you're on to something or not, that kind of creativity will find it's reward.
     
    #13     Sep 6, 2002
  4. egotraitor,

    Thanks for the kind words. At the very least, I'll become an expert of moving averages. :D

    aphie
     
    #14     Sep 6, 2002
  5. The following illustration is an example of what is commonly wrong with standard MA's (non-adaptive MA's). There was a large gap up from the previous trading session, and the 20 MA took approximately half the day to finally get back in sync with the data.

    Jurik (who I have yet to hear from) has created what he apparently claims is a solution to this problem, but I am still waiting to test his MA compared to other's.

    In the meantime, I'm reviewing Wavelet analysis to divide a signal into various time-frequencies and seeing how it can help filter the noise out of "noisey data."

    I will keep you informed with what I come up with, but the math involved in this is troublesome to understand without getting all "hot and heavy" in it.

    aphie
     
    #15     Sep 8, 2002
  6. dottom

    dottom

    Remember in dealing with wavelets, you get maximum distortion at the edges, and the hard right edge is where we need the most accurate information. There are various tradeoffs you can make to increase accuracy at the edges but make sacrifices in any other areas (such as lag, smoothness, over/under shoot properties).

    I have not had much success with wavelets, but I think that is mostly because the underlying nature of markets is that the frequency domain is constantly shifting.

    In my experience, if a trading method works well with an adaptive MA, results are very similar using any other MA. (e.g. substituting MAMA for JMA or AMA or T3 or VIDYA yields similar results). And in many cases just substituting an SMA, EMA, or WMA also yields similar results, but this depends on the lag and smoothness characteristics required for the trading system.

    Your mileage may vary.
     
    #16     Sep 8, 2002
  7. Ditch

    Ditch

    Alphie,

    In case of the NQ and ES the lag problem can be solved quite easily by using 24h tick-charts, not to mention the other advantages they offer.
     
    #17     Sep 8, 2002
  8. #18     Sep 8, 2002
  9. I am now 26, and so far your theory seems to be holding up quite well in my case. Realism is slowly starting to creep in.
     
    #19     Sep 8, 2002
  10. aphie,

    Thanx for starting this interesting discussion of MA. You got me thinking about MA's so I thought I'd write up my observations and post them here.

    <b>Averaging assumes that data = "The true value" + "random noise"</b> That example of how slowly a nonadaptive MA closes a major gap illustrates the crucial flaw in most MA formulations. As an attempt to smooth the data, the entire concept of taking an average assumes that all of the data has the same "true" value with some independently distributed random noise added in. So, the basic concept of averaging assumes that differences from the average are just noise. In reality, the prices of a tradable change systematically, rather than randomly. Averaging out the systematic change in prices losses information and creates a meaningless "average" value.

    <b>Moving Averages don't handle motion well</b> This treatment of price discrepancy = noise is the cause of lag when applying a MA to trending data. The discrepancy between the new price (moved systematically due to the trend) and the old prices is assumed to just be noise in nonadaptive averaging process. The result is lag with the MA value consistently trailing the most recent value. (funny how with trending data, the so-called moving averages don't properly compensate for motion).

    <b>Replacing lag with overshoot</b> Some people have turned to time-series techniques to remove this lag -- but the result often drags in new, unwarranted assumptions. Many of the lag-reducing time-series methods try to add the price velocity (first derivative of price with respect to time) to the moving average to remove this lag. (BTW, don't get me started on TA's egregious abuse of terms from physics like using the term "momentum" when they really mean "velocity"). But these methods assume that the price series has some constant price-velocity over the window of the moving average.

    When faced with a price gap, this assumption of constant velocity leads to overshoot. During a true price gap, the "velocity" of the price series is effectively infinite or undefined. At best the velocity is extremely high for an extremely short period of time as old open orders clear at prices between the old pre-gap market price and the new post-gap market price. Correcting lag with velocity works very poorly during this time of ill-defined velocity and leads to overshooting (the low-lag MA system reacts as if the velocity became very high and pushes the estimated average price above the post-gap value). Some low-lag MA systems have a tweakable parameter that tries to compensate for this (i.e., the trader gets to pick the mistake made by the MA, either overshoot or undershoot).

    <b>Evidence-Based Approach</b> I would argue that the key is to look at the original assumptions in the averaging process -- how do you know (or decide) that ALL of the data being used by the MA process came from the SAME underlying statistical population with the same parameters. In the case of a price gap, there is a discontinuity in the data. The data after the gap is from a different statistical population than the price data before the gap. Thus, the solution is to track multiple propositions about what is occurring in the market -- checking each new piece of data for evidence of being in a consolidation area, showing a continuation of a trend, showing a reversal of a trend, or being in a price gap. Each of these propositions is tracked in parallel with probabilities of each fluctuating as new evidence confirms or disconfirms each respective proposition.

    Another advantage of an evidence-based approach is that we can also accommodate pathological cases. For example, misprints corrupt many trading systems. Although reputable data vendors try to clean up erroneous datapoints, they do slip through occasionally. An evidence-based approach lets us estimate the probability that each piece of data is erroneous so we can discard bad data. Similarly, an evidence-based approach can cope with specialist and market-maker head-fakes by looking for evidence of them.

    Although an evidence-based approach seems complicated (in violation of the KISS principle), it is not an example of the capricious complexity that voodoo trading systems can be prone to. Rather, the evidenced based approach represents a recognition that a realistic model of the market has complexity (and that each new bit of data either confirms or disconfirms any of a number of these realistic possibilities).

    <b>What are you gathering evidence of?</b> Finally, I have a question for you. Are you really interested in knowing an accurate, smoothed estimate of the current market price? All of this effort to create better and better moving averages assumes that the trader wants to have the best possible estimate of the current market price of the tradable. Yet, it sounds like you are interested in exit signals -- perhaps judging when previously intense and consistent trading is fading and the trend is ending? If the goal is to find the end of the trend, then maybe you want some evidence-based process that looks directly for that.

    Thanx again for starting this thread (and others),
    Traden4Alpha

    P.S. I, too, like to build my own wheels, even if it means reinventing them occasionally. I only trust the wheels that I fully understand.
     
    #20     Sep 8, 2002