BacktestRookies

Automatic Trendlines

Introduction
For a full free tutorial explaining this code in more detail, visit the backtest-rookies (.com) website.

This indicator will plot two trend lines at any given time. A resistance trend line and a support trend line. The resistance trend is shown with red circles and is created by joining swing highs together. The second is a support trend which is created by joining swing lows.

Since we need swings to make the trend, the trend line code contains code for the swing detection. You can play around with the swing detection to alter how frequently new trend lines are detected. Relying on swings also means that there will be some delay in trend detection depending on how you configure the swing detection. The higher you set rightbars, the more lag you will have before a trend is detected. However, at the same time the quality of the pivots found will increase. So it is a trade-off you need to come to terms with and decide what the best settings are for you.

Lines

A single trend line is made up of several components.

  • Pivot Points: Marked as blue or orange circles. There will be two pivots per trend.
  • Orange/Purple Lines: Connecting all pivot points. You will see these lines change direction slightly each time a new pivot is detected (new circles appear).
  • Green/Red Circle lines: Showing the trend line from the earliest moment a new trend is detected.
  • Blue Dashed lines: Joining the purple and green/red circle lines so the full trend line can be seen.

Note: The blue dashed lines use pine-scripts drawing functions. As such, there is a limit to how many of these can be placed on a chart. When the limit is reached, the oldest line will be removed so the newest can be drawn. This means that if you detect enough trends and scroll back in time, the blue dashed lines will disappear at some point!

오픈 소스 스크립트

이 스크립트의 오써는 참된 트레이딩뷰의 스피릿으로 이 스크립트를 오픈소스로 퍼블리쉬하여 트레이더들로 하여금 이해 및 검증할 수 있도록 하였습니다. 오써를 응원합니다! 스크립트를 무료로 쓸 수 있지만, 다른 퍼블리케이션에서 이 코드를 재사용하는 것은 하우스룰을 따릅니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.

차트에 이 스크립트를 사용하시겠습니까?