EliCobra

TrendLine Toolkit w/ Breaks (Real-Time)

The TrendLine Toolkit script introduces an innovating capability by extending the conventional use of trendlines beyond price action to include oscillators and other technical indicators. This tool allows traders to automatically detect and display trendlines on any TradingView built-in oscillator or community-built script, offering a versatile approach to trend analysis. With breakout detection and real-time alerts, this script enhances the way traders interpret trends in various indicators.

🔲 Methodology

Trendlines are a fundamental tool in technical analysis used to identify and visualize the direction and strength of a price trend. They are drawn by connecting two or more significant points on a price chart, typically the highs or lows of consecutive price movements (pivots).

Drawing Trendlines:
  • Uptrend Line - Connects a series of higher lows. It signals an upward price trend.
  • Downtrend Line - Connects a series of lower highs. It indicates a downward price trend.
Support and Resistance:
  • Support Line - A trendline drawn under rising prices, indicating a level where buying interest is historically strong.
  • Resistance Line - A trendline drawn above falling prices, showing a level where selling interest historically prevails.
Identification of Trends:
  • Uptrend - Prices making higher highs and higher lows.
  • Downtrend - Prices making lower highs and lower lows.
  • Sideways (or Range-bound) - Prices moving within a horizontal range.

A trendline helps confirm the existence and direction of a trend, providing guidance in aligning with the prevailing market sentiment. Additionally, they are usually paired with breakout analysis, a breakout occurs when the price breaches a trendline. This signals a potential change in trend direction or an acceleration of the existing trend.

The script adapts this methodology to oscillators and other indicators. Instead of relying on price pivots, which can only be detected in retrospect, the script utilizes a trailing stop on the oscillator to identify potential swings in real-time, you may find more info about it here (SuperTrend toolkit). We detect swings or pivots simply by testing for crosses between the indicator and its trailing stop.

type oscillator
    float o = Oscillator    Value
    float s = Trailing Stop Value

oscillator osc = oscillator.new()

bool l = ta.crossunder(osc.o, osc.s) => Utilized as a formed high
bool h = ta.crossover (osc.o, osc.s) => Utilized as a formed low

This approach enables the algorithm to detect trendlines between consecutive pivot highs or lows on the oscillator itself, providing a dynamic and immediate representation of trend dynamics.

🔲 Breakout Detection

The script goes beyond trendline creation by incorporating breakout detection directly within the oscillator. After identifying a trendline, the algorithm continuously monitors the oscillator for potential breakouts, signaling shifts in market sentiment.


🔲 Setup Guide

A simple example on one of my public scripts, Z-Score Heikin-Ashi Transformed


🔲 Settings

  • Source - Choose an oscillator source of which to base the Toolkit on.
  • Zeroing - The Mid-Line value of the oscillator, for example RSI & MFI use 50.
  • Sensitivity - Calibrates the Sensitivity of which TrendLines are detected, higher values result in more detections.

🔲 Alerts

  • Bearish TrendLine
  • Bullish TrendLine
  • Bearish Breakout
  • Bullish Breakout

    As well as the option to trigger 'any alert' call.

By integrating trendline analysis into oscillators, this Toolkit enhances the capabilities of technical analysis, bringing a dynamic and comprehensive approach to identifying trends, support/resistance levels, and breakout signals across various indicators.

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?