PROTECTED SOURCE SCRIPT
已更新

Pivot-Based Trend Labels [BETA]

85
Automatically labels Higher Highs, Lower Highs, Higher Lows and Lower Lows using pivots, with optional zigzag lines and resistance proximity alerts. BETA version for testing and feedback.


## Overview
**Pivot-Based Trend Labels v2.0 [BETA]** is a structure-focused tool that automatically detects pivot highs and lows, then labels them as:
- **HH** – Higher High
- **LH** – Lower High
- **LL** – Lower Low
- **HL** – Higher Low

It’s designed to make trend structure (higher highs / higher lows vs lower highs / lower lows) easy to read at a glance. You can optionally draw connecting “zigzag” lines between pivots and enable a resistance proximity alert.

---

## Key Features
- **Pivot-based structure labels**
- Detects pivot highs/lows using a configurable lookback period
- Labels each new pivot as HH / LH / LL / HL
- Optional filter for minimum price change to ignore noise

- **Clean visual controls**
- Show/hide all labels with a single toggle
- Choose between HH/LH/LL/HL text or actual **price values**
- Individual toggles & customizable colors for each structure label
- Label size & background transparency controls

- **Optional ZigZag lines**
- Connects successive pivots to visualize swing structure
- Customizable color, transparency, width, and style

- **Resistance proximity alert** (optional)
- Dynamic resistance using highest high of last `length * 2` bars
- Or choose a **Manual Resistance** price
- Visual ⚠ label on the chart when price gets within threshold
- Cooldown to avoid duplicate alerts

- **Date range filter** (optional)
- Show labels/lines only within selected time window
- Optional end date or live continuation

---

## Inputs (Quick Guide)

**Pivot Settings**
- Pivot Lookback Period — Pivot confirmation threshold
- Min Bars Between Labels — Prevents label overcrowding
- Min Price Change (Absolute) — Filters noise

**Visuals: Labels**
- Global “Show Labels”
- Toggle/Color HH / LH / LL / HL
- Price or Structure text display
- Adjustable size & transparency

**Visuals: Lines**
- Toggle pivot-connecting lines
- Width, color, transparency, style options

**Resistance Alerts**
- Enable/disable resistance proximity detection
- Manual or dynamic resistance logic
- Percent threshold + visual label options
- Cooldown in bars

**Date Range Filter**
- Restrict script drawings to a specific window

---

## How to Use
1. Start with default settings to view baseline structure.
2. Increase **Pivot Lookback Period** for smoother swings on higher TFs.
3. Adjust **Min Price Change** to filter small movements in volatile markets.
4. Enable **zigzag lines** for clearer visual swing structure.
5. Turn on **resistance alerts** if you want proactive warnings.
6. Use the **date filter** for clearer backtesting or focused study.

---

## Alerts
Alerts trigger automatically when:
- A **new HH, LH, LL, or HL** is confirmed
- Price **approaches your resistance level**

Configure alerts using TradingView’s “Create Alert” on this script.

---

## Notes & Limitations
- **BETA version**: features & settings may change in future updates.
- Labels appear **after confirmation** — pivots require lookback bars.
- Performance & appropriateness depend on market/timeframe — experiment!

---

## Disclaimer
This script is for **educational and informational purposes only** and does not constitute financial advice. Past performance does not guarantee future results. You are responsible for all investment decisions made while using this tool.

---

## License / Terms of Use
© 2025 YourName. All rights reserved.
Personal-use only. Redistribution, resale, or inclusion in paid products/services is prohibited without explicit written permission from the author.
發行說明
Automatically labels Higher Highs, Lower Highs, Higher Lows and Lower Lows using pivots, with optional zigzag lines and resistance proximity alerts. BETA version for testing and feedback.


## Overview
**Pivot-Based Trend Labels v2.0 [BETA]** is a structure-focused tool that automatically detects pivot highs and lows, then labels them as:
- **HH** – Higher High
- **LH** – Lower High
- **LL** – Lower Low
- **HL** – Higher Low

It’s designed to make trend structure (higher highs / higher lows vs lower highs / lower lows) easy to read at a glance. You can optionally draw connecting “zigzag” lines between pivots and enable a resistance proximity alert.

---

## Key Features
- **Pivot-based structure labels**
- Detects pivot highs/lows using a configurable lookback period
- Labels each new pivot as HH / LH / LL / HL
- Optional filter for minimum price change to ignore noise

- **Clean visual controls**
- Show/hide all labels with a single toggle
- Choose between HH/LH/LL/HL text or actual **price values**
- Individual toggles & customizable colors for each structure label
- Label size & background transparency controls

- **Optional ZigZag lines**
- Connects successive pivots to visualize swing structure
- Customizable color, transparency, width, and style

- **Resistance proximity alert** (optional)
- Dynamic resistance using highest high of last `length * 2` bars
- Or choose a **Manual Resistance** price
- Visual ⚠ label on the chart when price gets within threshold
- Cooldown to avoid duplicate alerts

- **Date range filter** (optional)
- Show labels/lines only within selected time window
- Optional end date or live continuation

---

## Inputs (Quick Guide)

**Pivot Settings**
- Pivot Lookback Period — Pivot confirmation threshold
- Min Bars Between Labels — Prevents label overcrowding
- Min Price Change (Absolute) — Filters noise

**Visuals: Labels**
- Global “Show Labels”
- Toggle/Color HH / LH / LL / HL
- Price or Structure text display
- Adjustable size & transparency

**Visuals: Lines**
- Toggle pivot-connecting lines
- Width, color, transparency, style options

**Resistance Alerts**
- Enable/disable resistance proximity detection
- Manual or dynamic resistance logic
- Percent threshold + visual label options
- Cooldown in bars

**Date Range Filter**
- Restrict script drawings to a specific window

---

## How to Use
1. Start with default settings to view baseline structure.
2. Increase **Pivot Lookback Period** for smoother swings on higher TFs.
3. Adjust **Min Price Change** to filter small movements in volatile markets.
4. Enable **zigzag lines** for clearer visual swing structure.
5. Turn on **resistance alerts** if you want proactive warnings.
6. Use the **date filter** for clearer backtesting or focused study.

---

## Alerts
Alerts trigger automatically when:
- A **new HH, LH, LL, or HL** is confirmed
- Price **approaches your resistance level**

Configure alerts using TradingView’s “Create Alert” on this script.

---

## Notes & Limitations
- **BETA version**: features & settings may change in future updates.
- Labels appear **after confirmation** — pivots require lookback bars.
- Performance & appropriateness depend on market/timeframe — experiment!

---

## Disclaimer
This script is for **educational and informational purposes only** and does not constitute financial advice. Past performance does not guarantee future results. You are responsible for all investment decisions made while using this tool.

---

## License / Terms of Use
© 2025 All rights reserved.
Personal-use only. Redistribution, resale, or inclusion in paid products/services is prohibited without explicit written permission from the author.
發行說明
Automatically labels Higher Highs, Lower Highs, Higher Lows and Lower Lows using pivots — now with an option to display the **price value alongside HH / LH / LL / HL**. Includes timeframe-adaptive pivot sensitivity, optional zigzag lines, and resistance proximity alerts. BETA version for testing and feedback.


## Overview
**Pivot-Based Trend Labels v2.01 [BETA]** is a structure-focused tool that automatically detects pivot highs and lows and labels them as:
- **HH** – Higher High
- **LH** – Lower High
- **LL** – Lower Low
- **HL** – Higher Low

The indicator provides **granular control** over pivot behavior across different timeframes — allowing fast and responsive structure labeling on lower timeframes, and smoother, more stable structure on higher timeframes.

It’s designed to make market structure easy to read at a glance. The new dual-style labels allow price values to appear **together** with the structure notation. Optional zigzag lines reveal swing structure, and resistance proximity alerts help highlight key risk zones. The labels make it easy to add alerts at key levels you are interested in.

---

## Key Features

- **Automatic market structure labeling**
- HH / LH / LL / HL trend detection
- Label content options: **Text**, **Price**, or **Text + Price** (NEW)
- Optional threshold filtering to avoid labeling minor noise

- **Timeframe-adaptive pivot logic**
- Set different pivot Length + Spacing for different chart resolutions
- Structure sensitivity adjusts intelligently when switching timeframes

- **Visual customization**
- Master toggle for all labels
- Color options for HH / LH / LL / HL
- Adjustable text color, transparency & sizing

- **Optional ZigZag**
- Connects pivots for clean visual swing tracking
- Fully customizable appearance

- **Resistance proximity alerts**
- Dynamic or manual level
- Adjustable proximity % and cooldown
- ⚠ labels on the chart when triggered

- **Date Range filter**
- Restrict labels/lines to a focused backtest window

---

## Inputs (Quick Guide)

**Structure Settings**
- Pivot Length & Spacing (adjust per timeframe)
- Price threshold filter
- Label Content: **Text / Price / Both**

**Visual Options**
- Individual label colors per structure type
- ZigZag lines on/off
- Transparency + sizing controls

**Alerts**
- Enable resistance proximity warnings
- Dynamic or manual levels
- Configurable percent threshold & cooldown

**Filtering**
- Optional start + end date limits for clarity

---

## How to Use
1. Add to chart & observe baseline structure.
2. Tune pivot sensitivity for your active timeframe(s).
3. Choose label mode: **text only**, **price only**, or **both**.
4. Enable ZigZag for a clean visual trend path.
5. Turn on Resistance Alerts to prepare for potential breakouts.
6. Use Date Filtering for focused studies.

---

## Alerts
This indicator triggers alerts when:
- A new **HH, LH, LL, or HL** confirms
- Price **approaches resistance**

To enable: **Create Alert → This Indicator**.

---

## Notes & Limitations
- **BETA** version — functions and tuning may evolve
- Pivots appear **after confirmation** (lookback required)
- Behavior adapts per timeframe using user-defined sensitivity
- Different assets may require different settings

---

## Disclaimer
Educational and informational use only.
Not financial advice.
Trading involves risk and is solely the user’s responsibility.

---

## License / Terms of Use
© 2025 All rights reserved.
Personal-use only. Redistribution, resale, or inclusion in paid products/services is prohibited without explicit written permission from the author.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。