OPEN-SOURCE SCRIPT
تم تحديثه

Executed Volume Restraint Zones - Bigger Candle Range

672
Executed Volume Restraint Zones

This indicator detects potential buy and sell restraint zones using actual traded volume, candle rejection, wick behavior, and ATR-based zone sizing.

It does not use pending order book data. Instead, it focuses only on executed market activity shown through chart volume.

How it works:

A SELL zone is created when a high-volume candle pushes upward but gets rejected with a strong upper wick. This may suggest sellers absorbed buying pressure and stopped price from moving higher.

A BUY zone is created when a high-volume candle pushes downward but gets rejected with a strong lower wick. This may suggest buyers absorbed selling pressure and stopped price from moving lower.

The indicator compares current candle volume against a moving average volume baseline. By default, it uses 200 candles to define normal volume. When volume is significantly higher than average and the candle shows rejection, a zone is drawn.

Label meaning:

V = volume of the candle that created the zone.
T = estimated volume traded inside the zone during later retests.
# = how many times price has touched/retested the zone.
STRONG = the zone has been touched enough times based on the user setting.

Main features:

- Detects buy and sell executed-volume restraint zones
- Uses high-volume rejection candles
- Uses ATR to control zone thickness
- Tracks future zone retests
- Estimates volume traded inside each zone
- Marks stronger zones after repeated touches
- Auto-removes invalidated zones
- Multi-column adaptive labels to reduce chart overlap
- Adjustable volume, ATR, wick, body, label, and zone settings

Best used on intraday charts such as 5m, 15m, 30m, and 1h.

Important note:

This indicator does not show real order book or hidden limit orders. TradingView Pine Script cannot access live Level 2 / DOM order book data. The zones are based only on executed volume from OHLCV candles.
ملاحظات الأخبار
Executed Volume Restraint Zones

This indicator identifies potential buy and sell restraint zones using executed candle volume, price rejection, wick structure, candle body size, and ATR-based zone sizing.

The purpose of this script is to highlight areas where strong traded volume appeared, but price failed to continue in the same direction. These areas may represent possible absorption, rejection, or short-term supply and demand zones.

How it works:

A SELL zone is created when price pushes upward with high executed volume but forms a strong upper wick and a relatively small candle body. This may suggest that sellers absorbed buying pressure and stopped price from moving higher.

A BUY zone is created when price pushes downward with high executed volume but forms a strong lower wick and a relatively small candle body. This may suggest that buyers absorbed selling pressure and stopped price from moving lower.

The script compares current candle volume with a moving average of volume. By default, it uses a larger volume lookback range to reduce noise. Zones are sized using ATR, and invalidated zones are automatically removed when price clearly breaks through them.

Label meaning:

V = volume of the candle that created the zone
T = estimated volume traded inside the zone during later retests
# = number of times price has touched or retested the zone
STRONG = the zone has been retested enough times based on the user setting

Main features:

- Detects buy and sell executed-volume restraint zones
- Uses high-volume rejection candles
- Uses ATR-based zone thickness
- Tracks future retests of each zone
- Estimates retest volume inside the zone
- Marks stronger zones after repeated touches
- Automatically removes invalidated zones
- Uses multi-column adaptive labels to reduce overlap
- User-adjustable volume, ATR, wick, body, zone, and label settings

Suggested use:

This indicator is best used on liquid markets and intraday timeframes such as 5m, 15m, 30m, and 1h. It can help traders visually study where executed volume may have created short-term support, resistance, supply, or demand areas.

Important note:

This indicator does not use pending order book, DOM, or Level 2 data. TradingView Pine Script cannot access live order book data. All zones are calculated only from OHLCV candle data and executed volume.
ملاحظات الأخبار
This version improves the indicator by making the chart cleaner, more adaptive, and more volume-focused. Zones are now colored by creation volume, so higher-volume zones appear darker and lower-volume zones appear lighter. The script now keeps only the top-volume zones instead of simply keeping the newest zones, which means the most important historical volume areas remain visible. Triangle signals were removed to reduce chart clutter, and all volume numbers are displayed in millions, such as 1.38M. Label placement was improved with multi-column adaptive positioning, larger spacing, and automatic label sizing, so labels spread out more and shrink when many zones are shown. Short label mode was added to make labels easier to read, using S for sell zones, B for buy zones, * for strong zones, old for invalidated historical zones, V for creation volume, T for estimated touch volume, and # for touch count. Invalid zones are preserved by default and shown as faded historical zones instead of being deleted. A strong-wick override was added so high-volume candles with very long wicks can still create zones even if the candle body is slightly larger. Touch volume was also improved: instead of counting the full candle volume, the script estimates how much volume occurred inside the zone based on the candle’s overlap with that zone.
ملاحظات الأخبار
The latest version changes the indicator from heavy box-style zones into cleaner line-filled regions. Each zone is now drawn with a top boundary line, a bottom boundary line, and a soft filled area between them. The unsupported Pine argument `max_linefill_count` was removed, so the script compiles correctly. Zone color intensity is now softer: higher-volume zones are only slightly darker, and lower-volume zones are slightly lighter, without an exaggerated color difference. The script still keeps only the highest-volume zones by deleting the smallest-volume zone when the limit is exceeded. Labels remain adaptive with multi-column placement, auto sizing, short text, and wider spacing to reduce overlap. Triangle signals remain removed, so the chart only shows clean zones, boundary lines, filled regions, and labels.
ملاحظات الأخبار
This version updates the indicator to focus only on the most important recent volume zones. It now uses a **6-month lookback window**, so zones created outside the selected window are removed. Within that window, the script keeps only the **top 10 highest-volume zones**. Nearby same-direction zones are automatically merged, but instead of stretching the merged area across the full price range, the merged zone is rebuilt around a **volume-weighted value line**. This keeps regions compact and prevents them from covering the whole chart. Zones are now drawn as **two boundary lines plus a soft filled region**, with a dotted value line in the middle. Color intensity still reflects volume, but the difference is kept subtle so the chart remains clean. Labels remain adaptive with multi-column placement, automatic sizing, short text, and spacing logic to reduce overlap. Invalid zones can stay visible as faded historical zones, while alerts still trigger when new buy or sell executed-volume restraint zones are detected.
ملاحظات الأخبار
This version changes the indicator into a cleaner **soft-band style** display. Instead of drawing box-like zones with strong upper and lower borders, it now focuses on a subtle red or green filled band, while the boundary lines and center value line are heavily faded so the region feels like a clean volume band rather than a rectangle. The script still only looks at zones from the recent 6-month window and keeps the top 10 highest-volume zones. Nearby same-direction zones are merged, but the merged area is rebuilt around a volume-weighted value line so it stays compact instead of spreading across the whole chart. Zone color still reflects volume, but the intensity difference is intentionally mild, so high-volume areas are only slightly darker. Labels remain adaptive with short text, auto sizing, multi-column placement, and spacing logic to reduce overlap. Invalid zones can remain visible as faded historical bands, while new buy and sell executed-volume restraint zones still trigger alerts.
ملاحظات الأخبار
Enhanced zones with stronger soft-band visibility, subtle boundaries, clearer value line, bold-style yellow labels, and top 6-month volume filtering.
ملاحظات الأخبار
## Release Note

This version improves the indicator’s real-time Volume Profile display and label readability.

The script now keeps the original executed-volume restraint zones while adding a cleaner real-time Volume Profile score label. The live label is attached closer to the current Volume Profile band so it is easier to read on the chart. It also shows the nearest high-volume price area from the recent Volume Profile calculation, helping users quickly identify the most relevant nearby price level.

The indicator continues to scan recent executed-volume rejection areas, merge nearby zones, keep only the strongest recent zones by volume, and display soft red or green bands instead of heavy box-style areas. Labels use short, readable text and adaptive placement to reduce overlap.

## Main Changes

* Added a clearer stacked live label.
* Moved the live VP label closer to the real-time zone band.
* Added `VP @ price`, showing the nearest high-volume price area.
* Kept the live direction label: `LIVE B SCORE` or `LIVE S SCORE`.
* Kept the 80-candle Volume Profile volume display.
* Improved readability by keeping the label near the active VP band.
* Maintained the top 10 strongest volume zones from the recent 6-month window.
* Continued using soft-band visual zones instead of box-style rectangles.

## Label Explanation

### `LIVE B SCORE`

`LIVE B SCORE` means the current price is below the recent Volume Profile POC, so the script treats the current area as a buy-side reference zone.

It does not mean price must go up. It means the current price is located in a lower-side Volume Profile area where buyers may become more relevant.

### `LIVE S SCORE`

`LIVE S SCORE` means the current price is above the recent Volume Profile POC, so the script treats the current area as a sell-side reference zone.

It does not mean price must go down. It means the current price is located in an upper-side Volume Profile area where sellers may become more relevant.

### `SCORE 66`

The score compares the current price bin’s volume against the highest-volume bin in the recent Volume Profile.

Formula:

`Current price bin volume / Highest bin volume × 100`

Example:

`LIVE B SCORE 66`

This means the current price area has about 66% of the volume strength of the strongest price area in the recent 80-candle Volume Profile.

Simple interpretation:

* `80–100` = very strong volume area
* `60–80` = meaningful volume area
* `40–60` = moderate volume area
* below `40` = weaker volume area

### `VP @ 106.05`

`VP @ 106.05` shows the nearest and most relevant high-volume price level from the recent Volume Profile calculation.

It is selected by combining:

* how much volume traded near that price
* how close that price is to the current price

So this is not always the absolute POC. It is the closest high-volume price area that is most relevant to the current market position.

### `80C VOL 0.4M`

`80C VOL` means the estimated volume inside the current Volume Profile price bin, calculated from the most recent 80 candles.

Example:

`80C VOL 0.4M`

This means the current price area has approximately 400,000 volume based on the estimated 80-candle Volume Profile.

## Important Note

This script does not use real order book data or tick-by-tick volume. TradingView Pine Script only has access to OHLCV candle data. Therefore, the Volume Profile calculation is an approximation based on candle high, low, and volume distribution.

The score should be understood as a volume-strength reference, not a guaranteed prediction.
ملاحظات الأخبار
## Release Note

This update improves the indicator’s real-time Volume Profile analysis, label readability, and confidence calculation.

The script now keeps the original executed-volume restraint zone logic while adding a stronger real-time Volume Profile label. The live label shows the current buy-side or sell-side Volume Profile score, the nearest high-volume price level, the current 80-candle price-bin volume, that volume’s share of total 80-candle volume, and a confidence score based on a normal distribution percentile.

## Main Updates

### 1. Real-Time Volume Profile Label

The indicator now displays a clearer live label:

`LIVE B SCORE` or `LIVE S SCORE`

This shows whether the current price is below or above the recent Volume Profile POC.

* `LIVE B SCORE` means the current price is below the POC, so it is treated as a buy-side reference area.
* `LIVE S SCORE` means the current price is above the POC, so it is treated as a sell-side reference area.

This is not a guaranteed buy or sell signal. It is a real-time Volume Profile strength reference.

### 2. Volume Profile Score

The score compares the current price bin’s volume with the highest-volume bin from the recent 80-candle Volume Profile.

Formula:

`Current price bin volume / Highest bin volume × 100`

Example:

`LIVE B SCORE 66`

This means the current price area has about 66% of the volume strength of the strongest price area in the recent 80 candles.

### 3. Nearest High-Volume Price

The label now includes:

`VP @ price`

This shows the nearest and most relevant high-volume price level.

The script selects this price by combining:

* how much volume traded in that price bin
* how close that price bin is to the current price

This helps identify the nearest meaningful Volume Profile price area.

### 4. 80-Candle Volume Share

The label now shows:

`80C VOL 0.40M / 6.2%`

This means:

* `0.40M` = estimated volume inside the current price bin
* `6.2%` = this price bin’s volume share of the total estimated volume from the latest 80 candles

This gives more context than raw volume alone.

### 5. Normal Distribution Confidence

The `CONF` value has been changed to a normal-distribution-based percentile.

It compares the current price bin’s volume against all Volume Profile price bins.

Formula concept:

`z = (current bin volume - average bin volume) / standard deviation`

Then the script converts the z-score into a normal CDF percentile.

Example:

`CONF 80`

This means the current price bin volume is stronger than most other Volume Profile bins.

Simple interpretation:

* `CONF 80+` = strong volume concentration
* `CONF 50` = average volume concentration
* `CONF below 40` = weaker volume concentration

Important: `CONF` is not an up/down probability. It is a volume-confidence percentile.

### 6. Stronger Label Readability

The live label text has been made more visible by using:

* larger label size
* yellow text
* darker background
* bold-style Unicode text

This makes the real-time Volume Profile information easier to read on the chart.

### 7. Existing Zone Logic Preserved

The indicator still keeps the original executed-volume restraint zone logic:

* detects high-volume rejection candles
* creates buy-side and sell-side restraint zones
* merges nearby zones
* keeps only the strongest recent zones
* displays zones as soft bands instead of heavy boxes
* uses adaptive labels for zone volume and touch information

## Label Explanation

Example label:

`LIVE B SCORE 66`
`VP @ 106.05`
`80C VOL 0.40M / 6.2%`
`CONF 74`

Meaning:

`LIVE B SCORE 66`
The current price is below the recent Volume Profile POC, and the current price bin has 66% of the strongest bin’s volume.

`VP @ 106.05`
The nearest meaningful high-volume price area is around 106.05.

`80C VOL 0.40M / 6.2%`
The current price bin contains about 0.40M estimated volume, equal to 6.2% of total estimated 80-candle volume.

`CONF 74`
The current price bin volume is in a relatively strong percentile compared with all Volume Profile bins.

## Important Note

TradingView Pine Script does not have access to real order book data or exact tick-by-tick volume distribution. This indicator estimates Volume Profile using candle OHLCV data.

The score and confidence values should be used as volume-structure references, not as guaranteed predictions.
ملاحظات الأخبار
## Change Log

* Changed `ZONE @` to `NEXT ZONE @`.
* `LIVE B` now looks for the nearest **SELL zone above**.
* `LIVE S` now looks for the nearest **BUY zone below**.
* Recalculated `CONF` based on the selected target-side zones.
* `CONF` now matches the meaning of `NEXT ZONE @`.
* Kept `200C VOL` as the live Volume Profile volume reference.
* Live label is drawn last, so it stays visually in front.

## Explanation

### `LIVE B SCORE`

Means the current price is below the Volume Profile POC.

Simple meaning:

```text
Current price is in a buy-side area.
```

It does **not** mean price must go up.

---

### `LIVE S SCORE`

Means the current price is above the Volume Profile POC.

Simple meaning:

```text
Current price is in a sell-side area.
```

It does **not** mean price must go down.

---

### `NEXT ZONE @`

This is the next target zone.

```text
LIVE B → NEXT ZONE @ = nearest SELL zone above
LIVE S → NEXT ZONE @ = nearest BUY zone below
```

Example:

```text
LIVE B SCORE 33
NEXT ZONE @ 120.50
```

Means:

```text
Current area is buy-side.
The nearest resistance / sell zone above is around 120.50.
```

---

### `200C VOL`

Example:

```text
200C VOL 1.21M / 4.5%
```

Means:

```text
1.21M = estimated volume in the current VP price bin
4.5% = this bin’s share of total estimated volume from the latest 200 candles
```

---

### `CONF`

`CONF` now matches `NEXT ZONE @`.

```text
LIVE B → CONF = selected SELL zone strength among SELL zones above
LIVE S → CONF = selected BUY zone strength among BUY zones below
```

Example:

```text
CONF 82
```

Means:

```text
The selected next zone is stronger than about 82% of valid target-side zones.
```

It does **not** mean:

```text
82% chance price will reach that zone
```

It means:

```text
Target zone volume strength percentile.
```
ملاحظات الأخبار
fix bugs
ملاحظات الأخبار
Updated labels to use the largest Pine-supported font size available for each zone’s current height.
ملاحظات الأخبار
Change log: live VP band now uses the explicit value-zone top and bottom returned by `calcCurrentVPScore()` instead of deriving them from `vpCenter ± vpBinSize / 2`.
ملاحظات الأخبار
Change log: label backgrounds were made fully transparent so only the text remains, while preserving the same label positions.





ملاحظات الأخبار
Change log:

- Added a dominant-label filter so overlapping zones only show one label.
- Added a dominant-zone visual filter so overlapping buy/sell bands no longer stack red and green colors.
- Dominant zone is chosen by created volume first, then touch volume, then touch count, then older zone as tie-breaker.
- Hidden weaker overlapping zones are not deleted; their lines/fill/label are made transparent so they can reappear later if they stop overlapping or become dominant.
- Kept the live VP label and live VP band logic unchanged.
ملاحظات الأخبار
Change log:

- Fixed overlapping text between regular zone labels and the live Volume Profile label.
- Added collision detection for the LIVE label using the existing `usedLabelPrices` spacing array.
- When the LIVE label is too close to an existing BUY/SELL label, it now shifts horizontally using the same `labelColumnSpacing` logic.
- Updated LIVE label style dynamically:
- left-side labels use `label.style_label_right`
- right-side labels use `label.style_label_left`

Changed area: [tv_script](/Users/limingcui/Documents/travdingview/tv_script:754).
ملاحظات الأخبار
fix bugs
ملاحظات الأخبار
Updated labels larger, improved black-background colors, added visible muted zones, capped fading so zones don’t disappear, optimized rendering to final bar, improved LIVE zone visibility/performance.
ملاحظات الأخبار
fix bugs

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.