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.