Mathematically computing a trendline

Discussion in 'Technical Analysis' started by SeventhCereal, Jul 23, 2011.

  1. I would like to basically compute a trendline of the form (y - y0) = m (x-x0). I want to use this to determine box ranges and triangles.

    I tried thinking about it for a little bit, and there are many little details to get this working and I am thinking, this has to be a solved problem.

    Sure enough FinViz does have some algorithm for doing it. How do they do it? Is there a link to a paper or book? Thanks.
     
  2. gtor514

    gtor514

    I'd start by looking at the Linear Regression Line over some time period and see if that is what your looking for.. This many times can approximate a discretionary trendline vey well.

    Can't say for sure unless I had some picture of what your trying to accomplish.
     
  3. College math 101.
     
  4. You can't do it accurately or consistently on time or tick based charts because the volume weight of each bar varies too dramatically.
     
  5. Finding local minima and maxima (which is needed to correctly draw trendlines) is *not* trivial.
     
  6. Kubinec

    Kubinec

    At least some people know about it, I don't even know what the hell a math-computed trendline is. How is it different from a regular trendline one puts on a chart?
     
  7. Manual trendlines are discretionary, computed ones are not.

    Step #1 -
    Objectively define "Trend" as it applies to your specific charting environment. (IMHO - Constant Volume Bar charting works the best.)

    Step #2 -
    Objectively define not only support & resistance but the apex of the arc that makes up each support & resistance oscillation as it applies to your specific charting environment.

    Step #3 -
    Create a program to draw a trendline & to extend that trend line along your continuing resistance apex points in real time as resistance is making HH's and to draw a trendline & to extend that trend line along your continuing support apex points in real time as support is making HL's in a Bull Trend. The inverse is necessary to have the program draw a trendline & to extend that trend line along your continuing resistance apex points in real time as resistance is making LH's and to draw a trendline & to extend that trend line along your continuing support apex points in real time as support is making LL's in a Bear Trend.
     
  8. Kubinec

    Kubinec

    Thanks Prof.

    From what I understood of your post, it's basically a programmed function that automatically draws trendlines on a chart. I've seen indicators out there that do that.
     
  9. The key is to do it objectively in real time.
    Not so easy.
     
  10. computing a trendline is easy. The hard part is getting the start of the trend right, something that requires sophisticated A.I. to do well...
     
    #10     Jul 25, 2011