OPEN-SOURCE SCRIPT
Updated

Block-Based Trend Breakout (YTK/DTK) – v1

233
📌 Overview

Block Trend Breakout (YTK/DTK) is a lightweight, rule-based indicator that detects potential trend reversals or volatility bursts by tracking breakouts of key structural support/resistance levels — derived from block-wise trend patterns.

The logic is simple yet effective: if a trend has been confirmed across multiple blocks (custom-length bar groups), and the price breaks its own structural boundary, a potential reversal or volatility signal is triggered.

🟥 YTK (Uptrend Breakdown) → Price breaks below the lowest low of the most recent block in an uptrend.

🟩 DTK (Downtrend Breakout) → Price breaks above the highest high of the most recent block in a downtrend.

🔍 How It Works

Block Construction: User-defined bar groups (e.g., 6 bars on a 4H chart = 24H blocks).

Trend Validation: At least N consecutive blocks must show higher highs/lows (uptrend) or lower highs/lows (downtrend).

Breakout Test: If the current bar violates the structural limit (MR block high/low), the corresponding signal is plotted.

📉 This logic identifies weakening trends or failed momentum, often preceding reversals or volatility expansions.

⚙️ Features

Adjustable block size and trend confirmation count

Option to use only closed bars (to reduce repaint risk)

Inclusive mode for “<= / >=” logic

Visual signals:

MR Block high/low levels

Trend-colored bars

Arrows for YTK (🔻) and DTK (🔺)

Built-in alerts for automated strategies

🎯 Use Cases

Spotting fakeouts and false breakouts

Identifying trend exhaustion before reversal

Confirming structural support/resistance breaks

Visual tool for discretionary traders

Signal generator for automated systems


💬 Feedback & Contributions

This script is open-source and community-driven. We actively welcome feedback, ideas, improvements, forks, and questions.

📩 Contact for collaboration or discussion:
📧 senbrke@gmail.com
Release Notes
📌 Overview

📉 This logic identifies weakening trends or failed momentum, often preceding reversals or volatility expansions.

Block Trend Breakout (YTK/DTK) is a lightweight, rule-based indicator that detects potential trend reversals or volatility bursts by tracking breakouts of key structural support/resistance levels — derived from block-wise trend patterns.

The logic is simple yet effective: if a trend has been confirmed across multiple blocks (custom-length bar groups), and the price breaks its own structural boundary, a potential reversal or volatility signal is triggered.

🟥 UTB (Uptrend Breakdown) → Price breaks below the lowest low of the most recent block in an uptrend.

🟩 DTB (Downtrend Breakout) → Price breaks above the highest high of the most recent block in a downtrend.

🔍 How It Works

  • Block Construction: User-defined bar groups (e.g., 6 bars on a 4H chart = 24H blocks).
  • Trend Validation: At least N consecutive blocks must show higher highs/lows (uptrend) or lower highs/lows (downtrend).
  • Breakout Test: If the current bar violates the structural limit (MR block high/low), the corresponding signal is plotted.


⚙️ Features

  • Adjustable block size and trend confirmation count
  • Option to use only closed bars (to reduce repaint risk)
  • Inclusive mode for “<= / >=” logic

Visual signals:

  • MR Block high/low levels
  • Trend-colored bars
  • Arrows for UTB (🔻) and DTB (🔺)
  • Built-in alerts for automated strategies


🎯 Use Cases

  • Spotting fakeouts and false breakouts
  • Identifying trend exhaustion before reversal
  • Confirming structural support/resistance breaks
  • Visual tool for discretionary traders
  • Signal generator for automated systems



💬 Feedback & Contributions

This script is open-source and community-driven. We actively welcome feedback, ideas, improvements, forks, and questions.

📩 Contact for collaboration or discussion:
📧 senbrke@gmail.com

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.