How to draw trend lines in objective (algorithmic) way

Hello everyone,

In this video, we explore how to draw trend lines in more subjective and algorithmic way.

Problem with drawing trend lines manually are
  • Subjective and may be influenced by personal factors
  • Easy to fit on historical data based on our biases.
  • Chances of overfitting to confirm our biases/ideas.


We can avoid these drawbacks by using an algorithmic method to achieve the same.

I have also developed several scripts which can help achieve this automatically. Users can refer to them for learning and practicing. Few of them are:


Coming back to process of drawing trend lines manually, here are the steps.

  • Use and apply any zigzag indicator on the chart. In the demonstration, we have used Recursive Zigzag
  • Draw lines which joins more than 2 pivot lows for lower trendline and more than 2 pivot highs for higher trend line.
  • Make sure from starting pivot to ending pivot, price has not broken trendline convincingly, there can be rejections (touches) or fakeouts (just one or two bars outside trend line)
  • Higher number of candles touching the trendline, higher the strength of trend line.
  • If both higher and lower trend lines can be established, we can identify it as pattern - which can be triangles, wedges, channels etc.
  • Use different levels and lengths of zigzag to find different combinations. And then zero down to best possible pattern or use them in confluence.


Hope it was helpful and please let me know if you have any questions.
Chart PatternshewhomustnotbenamedTechnical IndicatorsTrend Analysistrendoscope

Related publications

Disclaimer