OPEN-SOURCE SCRIPT
更新済

High Probability Order Blocks [AlgoAlpha]

3 683
🟠OVERVIEW
This script detects and visualizes high-probability order blocks by combining a volatility-based z-score trigger with a statistical survival model inspired by Kaplan-Meier estimation. It builds and manages bullish and bearish order blocks dynamically on the chart, displays live survival probabilities per block, and plots optional rejection signals. What makes this tool unique is its use of historical mitigation behavior to estimate and plot how likely each zone is to persist, offering traders a probabilistic perspective on order block strength—something rarely seen in retail indicators.

🟠CONCEPTS
Order blocks are regions of strong institutional interest, often marked by large imbalances between buying and selling. This script identifies those areas using z-score thresholds on directional distance (up or down candles), detecting statistically significant moves that signal potential smart money footprints. A bullish block is drawn when a strong up-move (zUp > 4) follows a down candle, and vice versa for bearish blocks. Over time, each block is evaluated: if price “mitigates” it (i.e., closes cleanly past the opposite side and confirmed with a 1 bar delay), it’s considered resolved and logged. These resolved blocks then inform a Kaplan-Meier-like survival curve, estimating the likelihood that future blocks of a given age will remain unbroken. The indicator then draws a probability curve for each side (bull/bear), updating it in real time.

🟠FEATURES
  1. Live label inside each block showing survival probability or “N.E.D.” if insufficient data.
    スナップショット
  2. Kaplan-Meier survival curves drawn directly on the chart to show estimated strength decay.
    スナップショット
  3. Rejection markers (▲ ▼) if price bounces cleanly off an active order block.
    スナップショット
  4. Alerts for zone creation and rejection signals, supporting rule-based trading workflows.
    スナップショット


🟠USAGE
Read the label inside each block for Age | Survival% (or N.E.D. if there aren’t enough samples yet); higher survival % suggests blocks of that age have historically lasted longer.
スナップショット

Use the right-side survival curves to gauge how probability decays with age for bull vs bear blocks, and align entries with the side showing stronger survival at current age.
スナップショット

Treat ▲ (bullish rejection) and ▼ (bearish rejection) as optional confluence when price tests a boundary and fails to break.
スナップショット

Turn on alerts for “Bullish Zone Created,” “Bearish Zone Created,” and rejection signals so you don’t need to watch constantly.

If your chart gets crowded, enable Prevent Overlap; tune Max Box Age to your timeframe; and adjust KM Training Window/Minimum Samples to trade off responsiveness vs stability.
リリースノート
Removed minor comments
リリースノート
-Survival % now counts open/aged-out zones too.

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。