OPEN-SOURCE SCRIPT

AetherEdge - Bayesian Level Probabilities

413
🖊️ Overview

AE-BLP presents the probability of statistical events — prior-day high/low taps, gap fills — with Bayesian estimation (credible intervals) and conditioning on context. Most statistical tools quote a raw historical frequency ("the prior high is tapped 70% of the time"), which hides two things: the uncertainty around that number, and how it changes with context. AE-BLP models each event as a Beta-Bernoulli posterior and conditions it on context (prior-period direction, gap direction) to show P(event | context) with a credible interval.

🔶 Key Features

Plots the prior completed period's high (PDH), low (PDL), and close (fixed during the current period — no repaint)
Bayesian probabilities — posterior mean + credible interval (80/90/95% selectable); a decay weights recent periods more
Conditional probabilities — bucketed by context known at the period's open, giving P(event | context)
Three events: PDH tap, PDL tap, gap fill
A signal to fade an unfilled gap toward the prior close when the fill probability clears a threshold
A gold HUD with context, each probability [credible interval], the favored level, and the period count; probability labels on the levels too
Levels come from the last closed period and outcomes resolve at period close — no repaint

🧠 Technical Architecture

Levels: request.security pulls the prior completed period's H/L/C/O (lookahead_off, fixed during the current period).
Event tracking: within the current period it flags "high reached the prior high," "low reached the prior low," and "price returned to the prior close," and observes the finalized outcomes when the period rolls over.
Bayesian (Beta-Bernoulli): each (event × context) is a Beta(α, β) posterior; α/β update per observation (with a decay discounting the past). Posterior mean = α/(α+β); the credible interval is a normal approximation using the posterior variance αβ/((α+β)²(α+β+1)). The prior is Beta(priorStrength, priorStrength).
Conditioning: the bucket is chosen from context known at the period's open — prior-period direction (bullish/bearish) for the high/low taps, gap direction (up/down) for the gap fill — so you read an un-blended P(event | context).
Honest scope: Beta-Bernoulli posteriors with a normal-approximation credible interval. Not deep learning, and not a guarantee of probability.

⚙️ Recommended Settings & Tuning Guide

Key parameters: statistics period (periodTF), prior strength, evidence decay, credible interval, min gap, gap-fill probability threshold.
Set periodTF higher than the chart (e.g., D on a 15m chart = prior day's high/low)
Lower decay → faster adaptation to recent regime changes; 1.0 → weights all history equally
Raise prior strength → more conservative when data is scarce (pulls toward 0.5)
Crypto starting points (tune on your chart):
BTC / ETH (5m–1H chart, periodTF = D): defaults are the baseline (decay 0.99, 90% CI)
SOL / XRP and high-vol alts: decay 0.97 to track regime shifts
In 24-hour markets gaps are rare, so gap-fill statistics accumulate mainly around weekend opens
For stable long-run statistics use decay 1.0; to favor recent behavior ~0.95
No signals until the period count reaches the minimum (for a trustworthy posterior)

💡 How to Use in Practice

Daily roadmap: P(tap PDH) and P(tap PDL) show which level price is more likely to reach today
Reading the interval: a narrow interval = confident with ample data; wide = uncertain with few samples
Gap fade: after a gap, if P(fill | direction) is high, target the move back toward the prior close (the signal assists)
Context matters: tap probabilities differ after a bullish vs bearish prior day — read alongside the HUD context
Tapped display: if a level is already tapped/filled it shows status instead of a probability — focus on the remaining level
Combinations: pair with AE-OBQ's high-quality zones or AE-AMF's big-picture momentum, and factor BLP's probabilities into how likely a level is to be reached

⚠️ Important Notes

Learning period: no signals until enough periods accumulate; the posterior needs several periods to spin up
Learning reset: changing inputs, symbol, or period settings rebuilds the posteriors
Normal-approximation limits: when probabilities are near 0/1 or observations are very few, the credible interval is approximate (treat as a guide)
Probability, not a guarantee: even high-probability events can fail to occur — this is a first-order statistical tendency, so use stops and position sizing

🚨 Disclaimer

This indicator is for educational and informational purposes only and is not financial advice or a recommendation to buy or sell. No method guarantees future profits; past performance does not indicate future results, and trading carries the risk of loss. All trading decisions are your own — use proper backtesting and disciplined risk management.

Penafian

Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.