Need advice on algorithm for finding trend moves

Discussion in 'Strategy Building' started by lynx, Jul 29, 2009.

  1. lynx

    lynx

    Hi Everyone,

    I want to do some analysis and classification of trend moves, much like Victor Sperandeo said he did in his first book.

    Basically what I want to do is "draw" (virtually) connecting lines from major highs to major lows, for which prices do not deviate more than X amount from the line.

    Can anyone give me any advice on how to approach this algorithm, and also on how to define the amount of deviation from a line that would start a new trend?

    I've tried a bit in the past, but it's trickier than it sounds.

    I'm an experienced programmer, so no need to provide code. However my math is sorely lacking, so any explanations or pointers on that front would be welcome.

    Thank you.

    EDIT: I'm not using the word "trend" in the usual sense -- in my case a pullback would constitute a new trend. Also this isn't about finding trends early, it's about classifying them in old data. So look-ahead is OK.
     
  2. Beezer-1

    Beezer-1

  3. It's two problems:

    1) Smooth the line; and then

    2) Pick the highs and lows.

    To smooth in the manner you're describing scan the price for movement that's within a short-term volatility measure from the average.

    Once that's done it's trivial to pick the highs and lows (t-1 < t > t+1).