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

Market Pressure

667
Market Pressure — Description & Usage

Market Pressure is a normalized oscillator designed to characterize whether buying or selling pressure is dominating the market, and how persistent that pressure is over time. It does not attempt to predict price or generate signals. Instead, it measures the consistency of directional behavior by combining where price closes within each bar, the strength of the candle body, the level of volume participation, and alignment with trend. These components are smoothed and scaled into a range between -100 and +100, allowing the user to quickly assess who is in control and how strong that control is relative to recent conditions.

Values above zero indicate net buying pressure, while values below zero indicate net selling pressure. The most important region is the neutral zone around zero, defined by the user, which represents a balanced market where neither side has clear control. When the histogram remains within this neutral range, price action is typically rotational and prone to false moves. When the indicator moves and sustains itself outside of that range, it reflects a shift toward directional control. Strong readings toward the extremes suggest persistent and coordinated pressure, often associated with trend continuation rather than random movement.

This indicator is best used as a contextual filter rather than an entry tool. When Market Pressure is positive and holding above the neutral boundary, it suggests focusing only on long opportunities and avoiding shorts. When it is negative and holding below the neutral boundary, the opposite applies. When it is inside the neutral zone, the most effective action is often to stand aside, as the market lacks a dominant participant. The behavior of the histogram also provides insight into the quality of a move. Expanding values indicate strengthening pressure, while contracting values suggest that the dominant side may be losing control.

Because the indicator is normalized using a rolling lookback window, all readings are relative to recent history rather than fixed absolute levels. This allows it to adapt across different markets and timeframes, but also means that extremes represent the strongest pressure observed within that window, not an absolute threshold. The result is a flexible tool that highlights when the market is trending with conviction, when it is losing momentum, and when conditions are best avoided altogether.
ملاحظات الأخبار
This update adds an optional ATR-based dead zone to the trend component to prevent reactions to minor price movements around the EMA. Previously, even small crosses would flip the trend bias and introduce noise. With the dead zone enabled, the trend remains neutral unless price moves a meaningful distance from the EMA, defined as a fraction of ATR. Because the threshold adjusts with volatility, it expands in high-volatility conditions and tightens in low-volatility environments. The result is a more stable and reliable trend influence, especially in choppy markets, without affecting behavior during strong trends.
ملاحظات الأخبار
Pine category updated.
ملاحظات الأخبار
This update significantly reworks the core engine and adds a new squeeze detection layer, making the indicator more accurate, more statistically honest, and purpose-built for identifying pressure building before a breakout.

---

**What Changed**

**Z-score normalization** replaces the previous min/max rolling normalization. The old approach always stretched output to fill the ±100 range regardless of actual pressure intensity — meaning thresholds were relative, not absolute. Z-score preserves amplitude. A flat ranging week and a trend explosion now produce genuinely different readings. The indicator will correctly sit near zero during low-momentum conditions; that's not a bug, it's the point.

**Volume-weighted CLV** ties the dominant component (35% of the score) to actual money flow. Previously, Close Location Value was a pure price-location metric with no volume information. Multiplying by relative volume means the heaviest-weighted component now reflects genuine buying or selling participation, not just bar anatomy.

**Magnitude-weighted direction** replaces the previous binary ±1 tick direction. A 0.01-point move and a 5-point move previously contributed equally to the score. Direction is now normalized to the bar's range, so large moves register proportionally and tiny ticks barely register.

**Signal line** adds a short EMA of the normalized output plotted over the histogram. Crossovers above and below zero make momentum shifts explicit rather than requiring eye-reading of histogram shape alone.

---

**New: Squeeze Detection Layer**

The indicator now combines two complementary questions that neither tool can answer alone:

- *TTM Squeeze logic* answers: "Is a move about to happen?" — by detecting when Bollinger Bands compress inside Keltner Channels, flagging volatility contraction phases that historically precede breakouts.
- *Pressure engine* answers: "Which direction, and with how much conviction?" — using the volume-weighted, ATR-dead-zone-filtered composite score.

**Squeeze state dots** appear on the zero line: red while the squeeze is active (volatility compressing), orange on the first bar the squeeze fires (the release bar). The green no-squeeze dots are hidden by default to reduce clutter.

**Pressure trend during squeeze** modifies the histogram color when a squeeze is active. If pressure conviction is growing as compression deepens — the strongest possible setup — the histogram brightens. If pressure is fading or flat during a squeeze, it dims to gray, flagging a lower-quality setup.

**Five alert conditions** are included: squeeze fired, squeeze fired with bullish pressure, squeeze fired with bearish pressure, and bullish/bearish confluence (squeeze active with pressure above threshold).

---

**How to Read It**

The sequence to look for:

1. Dots turn red — squeeze active, watch the histogram
2. Histogram holds above neutral and brightens — pressure building during compression
3. Dots turn orange — squeeze releases
4. Histogram stays directional — breakout has conviction behind it

The standard TTM Squeeze fires and relies on a basic linear regression to guess direction. This version uses a volume-weighted, multi-component pressure model as the directional filter — a materially stronger signal quality when both conditions align.

---

**Inputs & Tooltips**

Every input has a detailed tooltip explaining what it controls, what changing it does, and any tradeoffs to be aware of. Inputs are organized into four groups — Pressure Settings, Squeeze Settings, Confluence Signal, and Thresholds — so the settings panel stays navigable as the indicator grows. Hover over any input label in the settings dialog to see the full explanation before making adjustments.

---

*All original inputs retained. New squeeze and signal inputs are grouped separately. Tooltips on all inputs.*
ملاحظات الأخبار
Update — Non-Repainting Toggle

Added a non-repainting toggle to the indicator settings, enabled by default. When turned on, every calculation — pressure, squeeze detection, confluence signals — is based entirely on bars that have already closed. Nothing on the forming bar is used. This means signals that appear on your chart are final and won't repaint or disappear before the bar closes.

The trade-off is a one-bar delay. Signals confirm on the bar after close rather than during it, but what you see is locked in and reliable for backtesting and alerts. If you prefer the original live-bar behavior and don't mind the repainting, you can disable the toggle in the Non-Repainting group at the top of the settings.

Everything else about the indicator is unchanged.

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

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