OPEN-SOURCE SCRIPT

Trendline Breakout Navigator [LuxAlgo]

96 200
The Trendline Breakout Navigator indicator shows three trendlines, representing trends of different significance between Swing Points.

Dots highlight a Higher Low (HL) or Lower High (LH) that pierces through the Trendline without the closing price breaking the Trendline.

A bar color and background color option is included, which offers insights into the price against the trendlines.

🔶 USAGE

스냅샷

Trendlines (TL) are drawn, starting as a horizontal line from a Swing Point.

When an HL (in the case of a bullish TL) or an LH (bearish TL) is found, this Swing Point is connected to the first Swing Point. In both cases, the TL can be optimized when one or more historical close prices breach the TL (see DETAILS).

A solid-styled long-term trendline represents the overall market direction, while a dashed-styled medium-term trendline captures medium-term movements within the long-term trend. Finally, a dotted-styled short-term trendline tracks short-term fluctuations.

🔹 Swing Points vs. Trend

A "Higher High" (HH) or "Lower Low" (LL) will initialize a new trendline, respectively, starting from the previous "Swing Low" or Swing High".

To spot the trend shift, "HH/LL" labels and an optional background color are included. They can be enabled/disabled or set at "Long, Medium, or Short" term TL (Settings—"MS", "HH/LL" and "Background Color").

These features are linked to one Trendline of choice only.

스냅샷

Where the "HH/LL" labels can show a potential trend shift, the background color is:
  • Green from the moment the close price breaks above a bearish trendline or when an HH occurs
  • Red from the moment the close price breaks below a bullish trendline or when an LL occurs


🔹 Bar Color

The bar color will depend on the location of the closing price against the three trendlines. When a trendline is unavailable (for example, if the close price breaks the TL and there is no HH/LL), the last known trendline value will be considered.

All three trendlines influence the bar color.

If the close price is above the "Long Term" TL, the bar color will show a gradient of green, darker when the close price is below the "Medium Term" and/or "Short Term" TLs.

On the other hand, when the close price is below the "Long Term" TL, the bar color will show a gradient of red, which becomes darker when the close price is above the "Medium Term" and/or "Short Term" TLs.

스냅샷

To keep the above example simple, only the "Long Term" TL is considered. The white line (not included in the script) resembles the actual value of the TL at each bar, where you can see the effect on the bar color.

스냅샷

Combined with the trendlines and dots, the bar color can provide extra depth and insights into the underlying trends.

🔹 Tested Trendlines

스냅샷

If a new HL/LH pierces the Trendline without the close price breaking the Trendline, the Trendline will be updated.

The exact location where the price exceeded the Trendline is visualized by a dot, colored blue on a bullish trendline and orange when bearish.

스냅샷

These dots can be indicative of a potential trend continuation or reversal.

🔹 Higher TimeFrame Option

스냅샷

The "Period" setting enables users to visualize higher-timeframe trendlines as long as the line length doesn't exceed 5000 bars.

🔶 DETAILS

스냅샷

When a new trendline is drawn, the script first draws a preliminary line and then checks whether a historical close price exceeded this line above (in the case of a bearish TL) or below (in a bullish case).

Subsequently, the most valid point in between is chosen as the starting point of the Trendline.

스냅샷

🔶 SETTINGS

  • Period: Choose "chart" for trendlines from the current chart timeframe, or choose a higher timeframe


🔹 Swing Length

  • Toggle and Swing Length for three trendlines: Period used for the swing detection, with higher values returning longer-term Swing Levels.


🔹 Style

  • Trendline: color for bullish/bearish Trendline
  • Wick Dot: color for bullish/bearish trendline test

  • Term: Long-, medium- or short-term
  • HH/LL: Show HH/LL labels (with or without previous Swing High/Low) of chosen Term
  • Background Color: Green when the closing price is above the trendline of choice, red otherwise

  • Bar Color

면책사항

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