How to find lines that intersect at least 3 different points on Y axes with 2 % error range?
I have time series data which consists of the time and closing prices of a stock. To automatically find trend (or trend like) lines I tried best fit – poly fit (polyfit(x,y,1)). As it is known, lines passing through 3 or more points are considered as trend lines financially and these points must be the lows or highs in the data set. So to be able to find local lows/highs IsChange() function which finds abrupt changes in data seems to be useful. The problem is that after finding local highs (or lows) how to find a line/lines that at least intersect 3 different points with max. 2% error range? Thanks.I have time series data which consists of the time and closing prices of a stock. To automatically find trend (or trend like) lines I tried best fit – poly fit (polyfit(x,y,1)). As it is known, lines passing through 3 or more points are considered as trend lines financially and these points must be the lows or highs in the data set. So to be able to find local lows/highs IsChange() function which finds abrupt changes in data seems to be useful. The problem is that after finding local highs (or lows) how to find a line/lines that at least intersect 3 different points with max. 2% error range? Thanks. I have time series data which consists of the time and closing prices of a stock. To automatically find trend (or trend like) lines I tried best fit – poly fit (polyfit(x,y,1)). As it is known, lines passing through 3 or more points are considered as trend lines financially and these points must be the lows or highs in the data set. So to be able to find local lows/highs IsChange() function which finds abrupt changes in data seems to be useful. The problem is that after finding local highs (or lows) how to find a line/lines that at least intersect 3 different points with max. 2% error range? Thanks. interpolation, curve fitting, line, best fit, trend MATLAB Answers — New Questions