Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
The problem is defining when a trend is a trend. When is it confirmed? IMHO you could begin with a simple approach and then add more complexity layers later. I would begin with an exponential MA, for example.