I know of one professional trading shop that trades several different systems. I don't know all the details, but I know that trendlines feature heavily in one of their systems. As I understand it, they trade breaks of established trend lines based on daily charts. Typically, they wait for a trend line to be broken, but they do not open a trade until the candle that broke the trend line is itself broken. As to an 'established' trend line...that's based on their traders' discretion.

If I was going to code up an indicator that identified trend lines, I'd probably start with identifying areas where price clustered and then build a linear regression model using these points.