OPEN-SOURCE SCRIPT

Pressure Delta

316
Pressure Delta is a volume-weighted candle-pressure indicator designed to identify directional participation and unusually strong buying or selling activity. It estimates buy and sell pressure from the candle's closing position and wick structure, distributes the candle's volume according to that estimated pressure, and then normalizes the resulting directional delta against average volume. The indicator combines Pressure, Relative Volume Delta, Relative Volume Percentage, Delta Spike and Relative Volume to distinguish ordinary price movement from high-volume directional events.

The most useful way to think about it is:
Pressure = direction
RVoL = participation
RVoL Δ = directional participation
RVoL % = imbalance
Spike = unusualness

1. The core idea: estimating buy vs. sell pressure
The script first examines the candle:
high
low
open
close
volume
It calculates the candle's range:
candleRange = high - low
Then it asks two questions:
Where did the candle close within its range?
closeRatio = (close - low) / range
A close near the high gives a value close to 1.
A close near the low gives a value close to 0.
It also examines the wicks:
wickBias = (lowerWick - upperWick) / range
A relatively large lower wick contributes bullish pressure, while a relatively large upper wick contributes bearish pressure.
Those two components are then combined:
buyPressureRaw =
60% × close location
+ 40% × wick bias
So the indicator gives 60% weight to where the candle closes and 40% weight to the wick structure.

2. Pressure
This is probably the most intuitive component.
pressureFinal = buyPressureRaw × 100
So it produces a number between approximately:
0% → 100%
Conceptually:
0–20% → very strong selling pressure
20–40% → bearish pressure
40–50% → mildly bearish/neutral
50–60% → mildly bullish
60–70% → bullish
70–85% → strong bullish pressure
85–100% → very strong bullish pressure
Your chart labels the last 7 candles with this value.
The colors reinforce the interpretation:
🟢 >60 = bullish
🟡 40–60 = neutral/mixed
🔴 <40 = bearish
Example
Suppose a candle:
opens at 100
trades to 95
trades to 108
closes at 107
The close is very near the high, and the candle may have a relatively meaningful lower wick.
The algorithm therefore might calculate something like:
Pressure = 82%
That means:
"Based on this candle's structure, the indicator estimates strong buying dominance."
It does not mean that exactly 82% of actual trades were buys.

3. Estimated buy and sell volume
The script takes the estimated pressure and applies it to the candle's volume:
buyVol = buyPressureRaw × volume
sellVol = sellPressureRaw × volume
For example, imagine:
Volume = 1,000,000
and:
Pressure = 70%
The script estimates:
Buy volume ≈ 700,000
Sell volume ≈ 300,000
Then:
netDelta = buyVol - sellVol
giving:
+400,000
Again, this is modelled volume, not exchange-reported buy/sell volume.

4. RVoL — Relative Volume
The script calculates a 20-bar average volume:
avgVol = ta.sma(volume, 20)
Then:
rvol = volume / avgVol
So if:
Current volume = 2,000,000
and:
20-bar average = 1,000,000
then:
RVoL = 2.0x
Meaning:
The current candle traded approximately twice the normal volume.
This is useful because pressure by itself isn't necessarily meaningful.
A candle showing 80% pressure on extremely low volume is very different from an 80% pressure candle occurring on 3× normal volume.

5. RVoL Δ — probably one of the most important readings
The script calculates:
rvolBuy = buyVol / avgVol
rvolSell = sellVol / avgVol
and:
rvDelta = rvolBuy - rvolSell
This combines directional pressure + abnormal volume.
For example:
Scenario A
Pressure = 70%
RVoL = 1×
You might get a relatively modest positive RVoL Delta.
Scenario B
Pressure = 70%
RVoL = 3×
The RVoL Delta becomes much larger.
That's because the second candle has substantially more volume behind the estimated buying pressure.
So conceptually:
RVoL Δ attempts to measure the strength of directional volume pressure relative to normal volume.
Your alerts use thresholds of:
5, 6 and 7
So you're essentially saying:
"Alert me when estimated buying pressure is not only positive, but exceptionally large relative to normal volume."

6. RVoL %
This calculation is:
rvPct = (rvDelta / rvol) × 100
This is interesting because it normalizes the delta by total relative volume.
Mathematically, it effectively brings you back toward the buy/sell imbalance expressed as a percentage of volume.
For example:
+50%
means the estimated buying component is substantially greater than the estimated selling component.
The indicator colors:
>50% = green
0–50% = yellow
<0% = red
Your alerts are focused on 40% and 50%.

7. Spike
This is designed to identify unusually large directional-volume events.
The script calculates:
avgAbsDelta = ta.sma(math.abs(rvDelta), 5)
Then:
spike = rvDelta / avgAbsDelta
In other words:
How large is the current directional volume delta compared with the average magnitude of the last five deltas?
For example:
Spike = 0.5×
Normal-ish / relatively weak.
Spike = 1×
Around the recent average.
Spike = 2×
Approximately twice the recent average magnitude.
Spike = 4×
A potentially significant directional-volume event.
Your table highlights values above 2×.
One subtle point: because the denominator uses abs(rvDelta) but the numerator retains its sign, a large negative event can produce a strongly negative Spike.


Exención de responsabilidad

La información y las publicaciones no constituyen, ni deben considerarse como, asesoramiento o recomendaciones financieras, de inversión, de trading u otro tipo, proporcionadas o respaldadas por TradingView. Obtenga más información en Condiciones de uso.