Are there any references online with examples of logic for identifying a sequence of higher/lower highs or lows that form a trendline? I've done plenty of code to calculate basic time-price logic but not something as varied in nature as a trendline. For example, how might one express the purple line on this chart for AAPL http://finviz.com/quote.ashx?t=aapl in basic code form (C/Java/Python/other)?
After brief search, may have answered my own question - using fitment to a power law may be most apt http://stats.stackexchange.com/ques...goodness-of-fit-of-a-trendline-to-a-power-law
And how do you propose to interpret the regression line and trade off of that? Do you define an uptrend as when the slope is > 0? Do you go long when the slope turns positive? Do you extrapolate the line and go long when price closes above the line? How you determine the lookback period to run the regression and what makes that number special from any other number? Just asking.
A computer drawn trendline often has little to do with the usual chartist drawn trendline. IMO trendlines are good only for visual TA. If you are going to use a computer, then there are much better things you could do than trendlines. Besides these lines mean nothing in particular. Anyone who relies on such lines is a pure gambler with no sense of reality. This is what the facts say.
Panzer: to answer all of your questions at once - no, as the decision to act upon an identification of a trendline is highly situational with regard to the actual price action...if a few higher highs are noted and a 'trendline' is enacted, but price action starts to churn in a tight range without reinforcing the assumed formation going forward, even with higher lows (ascending channel, rising wedge, steep-sloped expanding channel, etc), any trendline is viewed as a secondary indicator (and a distant one at that) in the context of the overall trading rules here.
On the contrary, if you could tell your computer what a trendline is, then you would be able to backtest its (alleged) predictive power. Same thing with support and resistance lines, if you could computerize them then you would be able to see if they truly give a trading edge or if they are just random lines, like any other line on the chart.
On the contrary, if you could tell your computer what a trendline is, then you would be able to backtest its (alleged) predictive power. Same thing with support and resistance lines, if you could computerize them then you would be able to see if they truly give a trading edge or if they are just random lines with no real and particular predictive power. To this day, no technical analysis author or expert has ever backtested these trendlines and support and resistance lines via a computer program. Unless they are quietly keeping the (good) results to themselves...
Attached is an example of computer drawn trend lines from well known trading software. Not so easily done!