PROTECTED SOURCE SCRIPT

YBL – Double Axis Volume (Profile + Vertical)

41
**YBL – Double Axis Volume (Profile + Vertical)**
by **YBL / Yuriel**

This script draws an **intraday volume profile on the price axis (X)**, with:

- Dynamic **horizontal volume bars (bins)**,
- Clear **POC line** and dynamically colored bins (buyers vs sellers),
- Optional **Value Area (VAH / VAL) zone**.

It is designed as a **clean, fast volume map** that shows where the market is really trading, and which side is winning at each price level.

---

## 🔍 Core Logic (Horizontal Volume Profile on Price Axis)

The profile is built over a **lookback window of bars**, divided into a set of **price bins**:

1. **Price range detection**
- Uses `highest high` and `lowest low` over `Barras a analizar (profile)`.
- The range is then split into **N bins** (`Cantidad de niveles (bins)`).

2. **Up vs Down volume per bin**
- For each bar in the lookback:
- A **mid-price** is computed: `(high + low) / 2`.
- This bar is assigned to a specific bin.
- Volume is split into:
- **up volume** → candles where `close >= open`,
- **down volume** → candles where `close < open`.
- Each bin stores:
- `volUpBins` = total volume on up candles,
- `volDownBins` = total volume on down candles.

3. **POC (Point of Control)**
- For each bin:
- `vTotal = volUp + volDown`.
- The bin with the **highest total volume** is used as **POC**.
- Its **mid price** is plotted as the **POC line**.

---

## 🎨 Visuals (Profile Rendering)

For each bin, a **horizontal bar (box)** is drawn on the right or left side of the chart:

- **Width**
- Proportional to `vTotal / maxVol` within the window.
- Controlled by `Anchura máx. profile (en barras)`.

- **Vertical position**
- Each box covers the bin’s price range:
- `y1 = lower price of bin`,
- `y2 = upper price of bin`.

- **Side (Right / Left)**
- `Lado derecho del gráfico`:
- ON: boxes extend from right edge towards the chart.
- OFF: boxes extend from left side.

- **Transparency**
- Based on relative volume fraction:
- Higher volume → more opaque.
- Lower volume → more transparent.

- **Color per bin (who is winning)**
- If the bin is **POC** → `Color POC`.
- Else:
- If `volUp > volDown` → `Color volumen ganador (alcista)` (bullish).
- If `volDown > volUp` → `Color volumen ganador (bajista)` (bearish).
- If equal → neutral profile color.

This gives you a **heat-like profile** that not only shows where volume is, but also **which side (buyers/sellers) dominate that price zone**.

---

## 📦 VAH / VAL (Value Area)

The script also computes **Value Area High and Low**, based on total volume:

1. Calculates total volume across all bins.
2. Starts from the POC bin and expands **left / right** until it accumulates a target percentage of volume:
- `Porcentaje Value Area` (default: 70%).
3. Defines:
- **VAL** = lower boundary of the lowest bin in the value area.
- **VAH** = upper boundary of the highest bin in the value area.

Visuals:
- **VAH / VAL lines** with customizable colors.
- Optional **Value Area fill zone** between VAH and VAL:
- `Relleno zona VA` → semi-transparent band highlighting the value area.

---

## ⚙️ Inputs (Settings Overview)

### Group: Horizontal Volume Profile (Eje X)

- **Mostrar Volume Profile**
Toggle the entire profile on/off.

- **Barras a analizar (profile)**
Number of bars used to build the profile (window).

- **Cantidad de niveles (bins)**
Controls the vertical resolution of the profile (how many price slices).

- **Anchura máx. profile (en barras)**
Maximum horizontal width in “bars units.”

- **Lado derecho del gráfico**
Choose whether the profile is drawn on the right edge or on the left.

- **Mostrar línea POC**
Show/hide the POC line.

- **Colors**
- `Color neutro profile` → base color.
- `Color POC` → for POC bin & line.
- `Color volumen ganador (alcista)` → when up volume dominates.
- `Color volumen ganador (bajista)` → when down volume dominates.

- **VA Settings**
- `Mostrar VAH / VAL` → toggle value area.
- `Porcentaje Value Area` (default 0.7 = 70% of total volume).
- `Color VAH`, `Color VAL`, `Relleno zona VA`.

---

## 🧠 How to Use (Practical Ideas)

- Load this script **on top of your main price chart** (`overlay = true`).
- Use it to:
- Identify **high volume nodes** where price likes to trade.
- Find **POC** of the current session/segment (magnet levels).
- Detect **bullish/bearish dominance** inside key price zones.
- Combine VAH/VAL with:
- VWAP,
- liquidity pools,
- support/resistance,
- or your own order flow tools.

Trading use cases:
- **Intraday**: track where today’s volume is building up.
- **Swing**: analyze medium-term levels where the market is accepting price.

---

## ⚠️ Disclaimer

This script is for **educational purposes only** and does **not** constitute financial advice.
Always test and use proper risk management when trading.

---

© YBL / Yuriel – “YBL – Double Axis Volume (Profile + Vertical)”
If you like this tool, please **leave a like ⭐ and add it to your favorites.**

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。