OPEN-SOURCE SCRIPT

Pressure Release Confirmation Engine [PhenLabs]

848
📊 Pressure Release Confirmation Engine [PhenLabs]

Version: PineScript™ v6

📌 Description
Pressure Release Confirmation Engine waits for trend-pressure to print a real extreme, then it does nothing until that pressure releases back through a hysteresis band on a closed bar. That release is the trade decision: fade a divergent extreme, or (optionally) take an aligned capitulation/extension release.

It is built for the exhaustion / trend-pressure workflow traders are actually using right now — without another locked-in oscillator recipe and without a Premium data gate. Use the built-in Range Position Pressure, or point Source at any plot you already trust (RSI, MACD, WaveTrend, a paid oscillator). Same arm → release → divergence gate either way. Markers print on price from this pane script, alerts fire both directions, and two numeric plots are Pine Screener columns.

🚀 Points of Innovation
  • Discrete release trigger, not a paint-the-trend oscillator. Nothing fires at the extreme. The signal is the closed-bar hysteresis cross that ends the extreme.
  • Any-source engine via input.source — run the same gate on built-in pressure or on an oscillator you already have on the chart.
  • Divergence quality at the trigger, not as a second indicator. DIVERGENT = price refused to confirm the pressure extreme (higher-low / lower-high). ALIGNED = price confirmed it.
  • One live arm at a time, timeout expiry, no same-bar arm-and-release, no dual-direction fire.
  • Pane oscillator plus force_overlay price markers from a single script — no second indicator to add.
  • Full value on every TradingView plan. No footprint, no tick chart, no lower-timeframe request as a requirement.
  • Pine Screener columns (PRCE Signal, PRCE State) plus four alertconditions.


🔧 Core Components
  • Range Position Pressure: close located inside the N-bar high/low, EMA-smoothed to 0–100. External mode replaces this with your selected plot (optionally min-max normalized so 80/20 still mean something).
  • Extreme arm: pressure must be the lookback highest/lowest and through Overbought/Oversold. The engine stores the arm-bar high or low as the price-confirmation reference.
  • Hysteresis release: bullish cross of Oversold+Hysteresis, bearish cross of Overbought−Hysteresis, evaluated only on barstate.isconfirmed.
  • Quality gate: while armed, a new price low (bull) or new price high (bear) marks ALIGNED. No new extreme marks DIVERGENT. Default markers show divergent releases only.
  • Dashboard: source mode, pressure, phase, quality, bars armed, last signal, screener codes.


🔥 Key Features
  • Built-in and External source modes with progressive disclosure (dependent inputs stay inactive until External is selected).
  • Readable defaults: divergent triangles only, arm dots off, short dashboard, no extra labels on price.
  • Timeout so stale arms die instead of lingering into the next swing.
  • Named alerts for divergent-only and any-release, both directions, plus alert() on the close.
  • Screener-ready numeric plots hidden from the pane (data window / screener only).
  • Armed-state background and dashed/dotted level plots so the hysteresis band is visible.


🎨 Visualization
  • Pressure line (pane): colored by live arm. Green = bull arm, red = bear arm, gray = idle.
  • Dashed Overbought/Oversold, dotted mid-line and release levels.
  • Green triangle below the bar = bullish divergent release (force_overlay on price).
  • Red triangle above the bar = bearish divergent release.
  • Optional tiny circles = aligned releases (off unless Price Markers = All releases).
  • Top-right dashboard: Source, Phase, Quality, Bars Armed, Last Signal, Screener codes. Hover any value cell for the definition.


📖 Usage Guidelines
  • Pressure Source — Default: Built-in Pressure — Built-in uses this chart. External applies the identical gate to another indicator’s plot.
  • External Plot — Default: close — Active only in External mode. Add your oscillator first, then pick its plot here.
  • Normalize External to 0–100 — Default: true — Leave on for MACD, delta, unbounded sources. Off if the source is already 0–100 (RSI, Stochastic, %R flipped).
  • Pressure Length — Default: 14 — Range: 3–100 — Lookback of built-in range-position pressure.
  • Pressure Smooth — Default: 3 — Range: 1–30 — EMA on the raw pressure series (both modes).
  • Extreme Lookback — Default: 10 — Range: 3–50 — Highest/lowest test that qualifies an arm.
  • Overbought / Oversold — Default: 80 / 20 — Arm thresholds.
  • Hysteresis — Default: 10 — Range: 1–25 — Release band. Bull fires on a close-bar cross of 30 with defaults; bear on a cross of 70.
  • Arm Timeout — Default: 25 bars — Armed extremes that never release expire with no signal.
  • Price Markers — Default: Divergent only — Divergent only / All releases / Hide shapes.
  • Show Arm Markers — Default: false — Tiny pane dots at the arm bar.
  • Table Size — Default: Small — Tiny / Small / Normal / Large.


✅ Best Use Cases
  • Intraday and swing fade of exhausted pressure on indices, FX, gold, and crypto — the engine is asset-agnostic.
  • Traders who already have a favorite oscillator and want a closed-bar trigger instead of reading slope by eye.
  • Screening a watchlist for PRCE Signal = 2 (divergent bull) or −2 (divergent bear) on the Pine Screener.
  • Pairing Built-in Pressure with a higher-timeframe chart for swing, then dropping External Source onto an RSI/MACD on the execution timeframe.


⚠️ Limitations
  • This is a confirmation engine, not a full system. It does not size positions or place stops. Use your own invalidation (arm-bar extreme is the natural reference).
  • External mode is only as honest as the plot you feed it. If that plot repaints, PRCE will inherit it. Built-in pressure does not.
  • Hysteresis will miss V-reversals that never cross the release level before timeout. That is intentional.
  • One live arm. A new opposite extreme cancels the previous arm.
  • Not financial advice. Past pressure releases do not guarantee future results.


💡 What Makes This Unique
  • The product is the release gate, not a new oscillator brand. Removing the arm → hysteresis → divergence sequence removes every signal.
  • Works as a standalone pane tool and as a meta-tool on any other plot, without a Premium data dependency.
  • Default chart shows only the higher-quality divergent events, so the picture stays readable.


⚙️ Under the Hood
  • input.source(): the same extreme/release/divergence state machine can run on close-derived Range Position Pressure or on any other script’s plot. That is the core method — not a decorative source picker. Built-in mode is the default so the script is complete on a blank chart.
  • input.enum + active: External Plot and Normalize stay inactive until Source = External. Progressive disclosure, not a 40-input wall.
  • force_overlay on plotshape: a pane oscillator that still marks the price candle from one script. Solves the “add two indicators” friction.
  • plot() linestyle: dashed thresholds and dotted release/mid levels with zero drawing-object budget.
  • Closed-bar gate: ta.crossover / ta.crossunder and all arm/release mutations sit behind barstate.isconfirmed. Historical and realtime agree. No lookahead.
  • Data mode / plan note: no plan-gated APIs. Dashboard row Source = BUILT-IN or EXTERNAL is the only mode flag, and both modes are available on every plan.
  • Screener & alerts: PRCE Signal (2 divergent bull, 1 aligned bull, −1 aligned bear, −2 divergent bear) and PRCE State (1 armed bull, −1 armed bear, 0 idle) are data-window plots. alertcondition exists for divergent and any-release, both directions.


🔬 How It Works
  1. Pressure is computed (or ingested) onto a 0–100 scale and smoothed. Overbought/Oversold are the arm lines; hysteresis sits inside them as the release line.
  2. On a confirmed bar, if pressure is the lookback extreme and through the arm line, the engine stores that bar’s low (bull) or high (bear) and waits. Opposite arms cancel each other.
  3. While armed, any new price low/high versus the arm reference flips quality from DIVERGENT to ALIGNED. If the hysteresis line is not crossed before timeout, the arm expires silent.
  4. A closed-bar crossover of Oversold+Hysteresis (bull) or crossunder of Overbought−Hysteresis (bear) consumes the arm and emits the signal, quality tag, price marker (if enabled), screener value, and alerts.
  5. Read the dashboard: Phase tells you whether to wait or act; Quality tells you whether price confirmed the extreme; Source tells you which series the gate is running on.


💡 Note:
Add the script, leave defaults, and wait for a triangle. Hover the dashboard cells the first time — they are the legend. For External mode, add your oscillator first, switch Pressure Source, pick its plot, and keep Normalize on unless that plot is already 0–100. Alerts: use “PRCE Bull/Bear Divergent Release” unless you explicitly want aligned events. Screener: filter PRCE Signal = 2 or −2.

This is an analytical aid, not financial advice. You are responsible for risk, execution, and whether a release is worth taking in the current market.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.