Start with the tutorial for learning coding. A lot trendlines are already available, you normally don't need to code a new one.