OPEN-SOURCE SCRIPT
Cập nhật

High Probability Order Blocks [AlgoAlpha]

4 444
🟠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.
    ảnh chụp nhanh
  2. Kaplan-Meier survival curves drawn directly on the chart to show estimated strength decay.
    ảnh chụp nhanh
  3. Rejection markers (▲ ▼) if price bounces cleanly off an active order block.
    ảnh chụp nhanh
  4. Alerts for zone creation and rejection signals, supporting rule-based trading workflows.
    ảnh chụp nhanh


🟠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.
ảnh chụp nhanh

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.
ảnh chụp nhanh

Treat ▲ (bullish rejection) and ▼ (bearish rejection) as optional confluence when price tests a boundary and fails to break.
ảnh chụp nhanh

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.
Phát hành các Ghi chú
Removed minor comments
Phát hành các Ghi chú
-Survival % now counts open/aged-out zones too.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.