Reversal Hammer, Star Breakout v1Reversal Hammer/Star Breakout is a candlestick-reversal breakout tool with a built-in trade-simulation and statistics engine. It detects exhaustion candles at the end of a move, arms a stop-entry on the breakout of a reference level, manages the resulting position with a fixed stop and a configurable target, and then logs and scores every trade in a self-contained performance dashboard — all from a single indicator, without a separate strategy script.
The goal is not to display a pattern and leave the rest to the eye. Every detected setup is turned into a fully specified order (entry, stop, target), filled or expired according to explicit rules, resolved intrabar for stop/target precision, and recorded with realistic costs. What you see on the dashboard is therefore an internal back-of-the-envelope simulation of how that exact rule set would have behaved on the loaded symbol and timeframe.
The setup
Long (bottom reversal). At the end of a down move the script looks for a bullish reversal candle — a Hammer, a Bullish Spinning Top, or (optionally) a Bullish Engulfing candle. When one prints in a valid context, a buy stop is armed above a reference level. The protective stop is placed at the low of the reversal candle.
Short (top reversal). At the end of an up move it looks for a bearish reversal candle — a Shooting Star / Inverted Hammer, a Bearish Spinning Top, or (optionally) a Bearish Engulfing candle. A sell stop is armed below a reference level, with the protective stop at the high of the reversal candle.
Entry reference. The breakout level is configurable:
Candle before reversal — break of the high (long) / low (short) of the candle that precedes the reversal candle. More confirmation, later entry.
Reversal candle — break of the reversal candle's own high/low. Earlier, tighter entry.
Stop. Opposite extreme of the reversal candle (with an optional tick buffer), or a fixed tick distance from entry.
Target. A configurable R multiple of the entry-to-stop risk (default), or the reversal candle range.
Pattern definition (fully adjustable)
Candle shapes are defined by ratios rather than fixed thresholds, so they adapt to any instrument:
Max body size as a fraction of the candle range.
Minimum dominant wick, expressed both as a multiple of the body and as a fraction of the range (the latter keeps doji-like candles honest).
Maximum opposite wick as a multiple of the body.
Spinning-top minimum wick on each side.
You can independently enable Hammer, Bullish/Bearish Spinning Top, Shooting Star / Inverted Hammer and Bullish/Bearish Engulfing, and optionally require the reversal candle to close in the trade direction. Lowering the dominant-wick multiple below 1.0 lets you accept larger-bodied hammers/stars; engulfing covers strong-bodied reversals that have little or no wick.
Filters
Each filter is optional and independent, so you can isolate exactly what adds value:
Trend context. Confirms the reversal occurs at the end of a trend. EMA trend (price beyond a sloping EMA) or Swing extreme (the reversal candle prints a fresh N-bar low/high), or either, or off.
Higher-timeframe filter. A fast/slow EMA relationship on a higher timeframe. It can require the higher timeframe to agree with the trade direction (confluence) or to still agree with the prior trend (early-reversal). It is read from confirmed higher-timeframe values with a one-bar offset and no look-ahead, so it does not repaint.
Breakout structure. Requires the entry to clear the extreme of the last N bars while excluding the most recent M bars. In a clean trend each bar prints a fresh extreme; taking the reference from the older window prevents the level from being redefined every bar, which curbs cascade entries.
RSI extreme. Longs only when RSI is oversold, shorts only when overbought, with adjustable thresholds and length.
Distance from a moving average. Requires price to be stretched at least k daily-ATR units away from a moving average (SMA/EMA, adjustable length) — below it for longs, above it for shorts — to favour genuine exhaustion. The reference average is plotted on the chart.
Simulation engine and no-repaint design
Bar-close-only processing. Setups, fills and exits can be evaluated only when a bar closes, so the historical and the real-time picture match.
Intrabar resolution cascade. Stop-entry fills and stop/target hits are resolved by walking sub-candles in chronological order, cascading 1-minute → 2-minute → 5-minute and falling back to the bar OHLC when sub-candle data is unavailable. The active source is shown in the diagnostic panel.
Tie handling and dirty bars. When a single bar would touch both the stop and the target, the order is ambiguous; the outcome is resolved by a conservative (stop-first) or optimistic (target-first) rule, and the trade is flagged as a dirty bar and counted separately so you can judge how much of the result is path-dependent.
Realistic costs. Per-side slippage in ticks is applied to every fill, and instrument tick size / tick value / contract size can be read automatically or set manually, so currency results match the traded product.
Trade management
One trade at a time, with an optional cooldown after each close.
Maximum bars in trade (time stop) and an optional force-flat window at the end of the session.
Entry time window and maximum trades per day, with a selectable session timezone.
Optional post-win no-chase cooldown that blocks new same-direction entries priced worse than the last winner's exit for a number of bars, to avoid chasing a move you just profited from.
Statistics dashboard
A compact panel reports, in points, currency and R: number of trades and long/short split, win rate (overall and per side), profit factor, net result, expectancy in R and in currency, average and largest win/loss, maximum drawdown in currency and in R, maximum win/loss streaks, average bars per trade, dirty-trade share, and the live status of any open or pending order (direction, entry, stop, target, risk).
Diagnostic panel
A second panel makes it easy to understand why a setup did or did not trade: counts of reversal candles, qualified long/short patterns, pattern types (hammer, spinning top, engulfing), orders placed, filled and expired, fill rate, the active intrabar source, and the current state of every filter (trend context, structure, RSI value, stretch distance in ATR units). If a candle you expected to trigger does not, these counters localise the cause immediately.
Visuals, logs and alerts
The reversal candle is highlighted, with optional projected entry/stop/target lines and small entry/exit labels.
An open-position banner shows live PnL in currency, points and R.
Every closed trade is printed to Pine Logs as a single CSV line (with a header row), so the full trade list can be exported and analysed externally.
Alerts are available for a detected long/short reversal and for a stop-entry order being placed.
Suggested workflow
Set the instrument tick size, tick value, contract size and slippage to match your product.
Start with the pattern set and entry/stop/target rules only, all filters off, and read the dashboard.
Enable one filter at a time and compare the dashboard before and after, so each filter has to justify its inclusion rather than being added on faith.
Use the diagnostic panel whenever an expected signal is missing.
Treat dirty-bar share and slippage-adjusted expectancy as quality gates before trusting the numbers.
Notes on realism
The dashboard is an internal simulation, not the native Strategy Tester, and it is deliberately built to err toward conservative, realistic results: bar-close processing, intrabar ordering for stop/target, explicit dirty-bar accounting, modelled slippage and instrument-accurate currency. Results still depend on the loaded symbol, timeframe and the availability of sub-minute data for the intrabar cascade. Widening pattern definitions or relaxing filters to capture a specific past setup is a classic route to overfitting; after any such change, re-evaluate the aggregate statistics rather than a single trade.
Disclaimer
This script is published for educational and research purposes only. It is not financial advice and not a recommendation to buy or sell any instrument. Backtested and simulated results do not guarantee future performance. Trading futures and leveraged products involves substantial risk of loss. Always test on your own data and trade only with capital you can afford to lose. Indicator

Indicator

Indicator

Indicator

Indicator

Indicator

AetherEdge - Adaptive Anchored VWAP🖊️ Overview
Anchored VWAP marks the volume-weighted cost basis from an event. AE-VWAP picks the anchor for you and learns whether reclaiming the VWAP actually means something. It auto-anchors at significant swings, conformally calibrates its volume-weighted σ-bands to a target containment, and learns the follow-through probability after price crosses the anchored VWAP.
🔶 Key Features
Auto-anchored VWAP — anchors at significant swings (Session / Manual also available)
Volume-weighted σ-bands — standard-deviation bands weighted by volume
Conformally calibrated bands — no normality assumption; band width k is set to hit a target containment
Learned reclaim edge — follow-through probability after a VWAP reclaim/loss (signal only when the odds back it)
Realized containment — shows how well the bands are calibrated
Reclaim signals + anchor markers + alerts; bar-close training — no repaint
🧠 Technical Architecture
VWAP: the source (hlc3/close/ohlc4) is volume-weighted: vwap = Σ(price·vol)/Σvol, σ = √(Σ vol·price²/Σvol − vwap²). Anchor modes: Auto (pivot confirmation) / Session (daily) / Manual (date).
Bands (conformal calibration): k is set to the (1−α) quantile of the standardized deviation |src−vwap|/σ, matching the target containment empirically. A fixed normal-assumption k tends to under-contain on fat tails — conformal fixes that.
ML (online logistic): at a VWAP reclaim (close × VWAP cross), six side-oriented features (momentum, trend alignment, RSI, σ-band-width regime, volume, anchor age) predict the follow-through probability = P(price continues tpK·ATR in the cross direction before recrossing, within N bars) via a triple barrier. No lookahead.
Honest scope: a volume-weighted mean + conformal calibration + a linear classifier (no RL). Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: anchor mode, pivot strength, band width k / conformal calibration, target outside fraction, follow-through (ATR), horizon N, min follow-through probability.
Anchor: "Auto (pivots)" to catch trend origins, "Session" for a daily basis, "Manual" for a specific event
Higher pivot strength anchors only on bigger swings (fewer re-anchors)
Turn on conformal calibration so bands match the real containment (check the containment %)
Follow-through (ATR) defines what counts as success
Best on liquid symbols with reliable volume (major crypto, futures)
💡 How to Use in Practice
Use the anchored VWAP as the institutional cost basis / fair value (above = buyers in control, below = sellers)
Use the σ-bands for overextension/containment; outside the band is statistically unusual
Use reclaim signals (with probability) to filter genuine VWAP-reclaim breaks
If containment drifts from target, reconsider calibration or σ validity
Combine with AE-CVD (flow) or AE-RISK (sizing)
⚠️ Important Notes
Auto-anchoring lags by the pivot confirmation, and the basis shifts on re-anchor
The follow-through forecast is a probability and will miss (reclaims can fail)
Needs a learning period (warmup); learning resets on anchor/timeframe/parameter change
Probability, not a guarantee — always do your own due diligence and use risk management
🚨 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 decisions are your own — use proper validation and disciplined risk management. Indicator

AetherEdge - Seasonality🖊️ Overview
Seasonality tools show raw averages and let you fool yourself with three-sample "edges." AE-SEAS measures the time-of-day / day-of-week / month return profile properly, with significance. It learns each bucket's mean return, win-rate, sample count and t-stat, and shrinks small-sample buckets toward the global mean (empirical Bayes) to prevent overfitting — answering "which time periods have a real edge" with data.
🔶 Key Features
Time-of-period profiles — learned mean return and win-rate by hour / weekday / month
Significance (t-stat) — separates a real edge from noise (don't trust raw averages)
Empirical-Bayes shrinkage — small-sample buckets shrink toward the global mean (anti-overfitting)
Current-bucket bias — the shrunk expected return, win-rate and significance for the bucket you're in
Heatmap table — all buckets at a glance, current one highlighted
Signals + alerts on entering a significant-edge bucket; bar-close accumulation — no repaint
🧠 Technical Architecture
Bucket statistics: each time bucket (hour 0–23 / weekday / month) accumulates the bar's return, yielding mean, variance, sample count, win-rate and a t-stat (mean ÷ standard error). Larger |t| = a less-likely-to-be-chance edge.
ML (empirical-Bayes shrinkage = regularized estimation): shrunk mean = global mean + (bucket mean − global mean) × n/(n+k). Low-sample buckets shrink hard toward the global mean; well-sampled buckets approach the raw value. This stops a five-sample bucket from masquerading as a strong signal — regularized estimation, not raw counting, is the "ML."
Timezone: buckets are computed in the selected timezone (Exchange / UTC / NY / London / Tokyo).
Honest scope: regularized per-bucket statistics (empirical-Bayes shrinkage + t-test) (no RL). Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: active profile (hour/weekday/month), timezone, shrinkage strength k, significance threshold |t|, min samples.
Profile: "Hour" for crypto intraday, "Weekday" for weekly tendencies, "Month" for the long run (higher timeframes)
Timezone: UTC is standard for crypto; exchange TZ for equities
Higher shrinkage k pulls small samples harder toward the global mean (conservative)
Significance |t| defaults to 2.0 (≈95%); use 2.5–3.0 to be stricter
Longer history / timeframe means more samples per bucket and higher reliability
💡 How to Use in Practice
Use the heatmap table to spot hours/days with a large mean and a ✦ (significant)
Reference the current-bucket bias as the backdrop for the period you're in
Treat entering a significant bull/bear bucket as a trend/caution cue
Ignore buckets with low sample count (n) or small t
Combine with AE-VOL (volatility) or AE-CVD (flow) to layer time × context
⚠️ Important Notes
Seasonality is a historical tendency with no guarantee of persistence (structural shifts break it)
Low-sample buckets remain uncertain even after shrinkage (always check n and t)
Needs a learning period (warmup) and ample history; accumulation resets on timeframe/timezone change
Probability, not a guarantee — always do your own due diligence and use risk management
🚨 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 decisions are your own — use proper validation and disciplined risk management. Indicator

AetherEdge - Adaptive Risk Engine🖊️ Overview
Most sizing is a static "1% every time." AE-RISK sizes to a learned edge and volatility, and pulls risk back automatically when you're cold. It learns the trigger's win-probability online, sizes via fractional Kelly, and lays out the full per-trade risk package — ATR stop/target, $ risk and reward, and position size in units.
🔶 Key Features
Edge-linked sizing — fractional Kelly from the learned win-rate (size up only when the odds justify it)
Loss-streak throttle — scales risk down/up with realized losing/winning runs (drawdown-aware)
Adaptive stop/target — ATR stop distance, R target
Per-regime optimal R — a UCB learns the best-expectancy R per volatility regime (information, decoupled from sizing)
Full risk package — units / % equity / $ risk-reward / R:R / win-rate / Kelly f*
Level lines + trigger triangles; bar-close training — no repaint
🧠 Technical Architecture
Trigger: EMA cross (default) or Donchian breakout; used for both learning and display.
ML (online logistic): at each trigger, six features (trend alignment, momentum, RSI, vol regime, volume, breakout position) predict P(win) = P(reach the R-target before the stop within N bars) via a triple barrier over an array, resolved conservatively with SL priority (max-favorable-excursion counted only up to the stop).
Sizing (fractional Kelly): f* = max((p(b+1)−1)/b, 0) with b = target R; risk % = Kelly fraction × f* (capped); units = equity × risk % ÷ stop distance. A vol-target size is shown for reference.
RL (UCB / per-regime optimal R): per volatility regime, a UCB learns the best-expectancy R from the realized MFE distribution, shown as "opt R" (decoupled — information, not an override).
Throttle: a realized win/loss streak scales the multiplier (down through losing runs).
Honest scope: a linear classifier + Kelly + a bandit. Not deep learning, and not financial advice.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: equity, base/max risk %, Kelly fraction, ATR stop, target R, trigger, barrier horizon N, throttle factor.
Kelly fraction ≈ 0.2–0.3 (full Kelly overbets; stay conservative)
Always set max risk % (caps large Kelly outputs)
Design payoff with stop (ATR) / target R; consult the per-regime "opt R"
A higher throttle factor cuts risk harder on losing runs
Start from defaults for crypto 15m–1H (slMult 1.5, R 2.0, N 20); enter your real equity
💡 How to Use in Practice
Use the trigger's risk package (size / SL / TP / $ risk) as your order template
Stand aside when P(win) and Kelly f* are low (thin edge)
A throttle multiple below 1 signals poor fit with the market — go smaller
If opt R diverges from your target R, reconsider the target
Combine with AE-ACE or AE-MRB signals, using this tool to manage size and stops
⚠️ Important Notes
Needs a learning period (warmup); learning resets on parameter/timeframe change
Intrabar order is unknown, so MFE/SL resolution is a conservative approximation (it can differ from real fills)
Kelly is sensitive to the estimated win-rate — keep the fraction small and always cap risk
This is not financial advice. The displayed size is only a starting point; final decisions and orders are your own
🚨 Disclaimer
This indicator is for educational and informational purposes only and is not financial advice, a trading recommendation, or money-management advice. Displayed position sizes and risk amounts are mechanical example calculations; no method guarantees future profits. Past performance does not indicate future results, and trading carries the risk of loss. All decisions and capital allocation are your own — use proper validation and disciplined risk management. Indicator

AetherEdge - Pattern Edge Learner🖊️ Overview
Most pattern tools hard-code the textbook ("engulfing = bullish"). AE-PAT throws that out and measures each shape's forward edge from this market's own history. It encodes recent price action as a normalized signature and aggregates what past analogues did next via kernel regression — telling you which shapes actually work now, as an up-probability, expected move, and confidence (effective neighbors). It also shows learned win-rates for five classic candlestick patterns.
🔶 Key Features
Learned shape signatures — encodes the last L bars as an ATR-normalized shape and learns the forward edge from analogues
Non-parametric (kernel regression) — estimates "this shape did X" from data, no hard-coded lore
Up-probability + expected move + confidence — including how many analogues exist (effective neighbors)
Measured win-rates of classic patterns — bull/bear engulfing, hammer, shooting star, doji (the record, not the textbook)
Pattern signals — fire only when the learned edge is strong with enough analogues
Bar coloring for the edge; bar-close training and signals — no repaint
🧠 Technical Architecture
Shape signature: the last L bars encoded as four features each (body / upper wick / lower wick / return, normalized by each bar's ATR = scale-invariant), F = L×4 dims.
ML (Nadaraya-Watson kernel regression): a memory bank stores, each bar, the signature from N bars ago plus its realized outcome (up/down + forward return; no lookahead). The current signature is weighted against the whole memory by a Gaussian kernel exp(−dist²/2h²), yielding P(up), expected move, and effective neighbors (confidence). The estimate adapts as shapes change.
Stats (Beta-Bernoulli): online win-rates for five classic patterns, updated from the outcome N bars after each occurrence.
Honest scope: kernel regression + Bernoulli counting (no RL). Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: signature window L, outcome horizon N, up threshold (ATR), memory size, kernel bandwidth, bull/bear edge thresholds, min effective neighbors.
Window L ≈ 3–5 (larger captures complex shapes but yields fewer analogues)
N is the bars to measure the outcome; 8–15 for 15m–1H
Bandwidth controls match tolerance (smaller = stricter/fewer neighbors, larger = smoother)
Min effective neighbors ensures firing only with enough analogues
⚠️ It's a memory × dimension scan; if you hit a "script takes too long" error on long timeframes, lower the memory size
💡 How to Use in Practice
Use the pattern triangles for shape-backed entries
Read P(up) and expected move for direction/size, and stand aside when effective neighbors is low
Use the classic-pattern table to check "is the hammer working now / what's the engulfing win-rate" and drop assumptions
Combine with AE-MRB (mean reversion) or AE-CORR (drivers) to layer shape × context
⚠️ Important Notes
Needs a learning period (warmup) and memory to build; memory resets on timeframe/parameter change
Past analogues are not guaranteed to resolve the same now (regime shifts break it)
Rare shapes have few neighbors and lower confidence
Probability, not a guarantee — always do your own due diligence and use risk management
🚨 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 decisions are your own — use proper validation and disciplined risk management. Indicator

AetherEdge - Mean-Reversion Bands🖊️ Overview
Ordinary bands flag the stretch but say nothing about what happens next. AE-MRB learns the probability that price reverts to the mean at a band touch and only fades when the odds support it. A UCB-style threshold adapts per trend regime — aggressive in chop, cautious in a trend — with the mean (band center) as the target.
🔶 Key Features
Learned reversion probability — online P(revert) at each band touch (not every touch reverts)
Triple-barrier training — learns from the real outcome: revert / extend (trend) / timeout
Regime-adaptive threshold — UCB tunes the firing probability per ranging/normal/trending regime
Fade signals — long at the lower band, short at the upper band, targeting the mean
σ stretch readout and regime-colored bands
Alerts on high-probability touches; bar-close training and signals — no repaint
🧠 Technical Architecture
Bands: basis (EMA/SMA) ± kBand·standard deviation; stretch = (close − basis)/σ (z-score).
ML (online logistic): at a band touch (a fresh |stretch| ≥ threshold cross), seven fade-oriented features (stretch, trend strength, RSI extremity, band-width regime, volume, mean slope, exhaustion) predict P(reverts to the mean within N bars). Labels are triple-barrier — revert (returns to mean) = 1, extend (stretches further = trend/breakout) = 0, timeout judged by how far it pulled back. Resolved over an array with SL priority.
RL (UCB-style adaptive threshold): per trend regime (trend-strength terciles), a UCB tunes the firing probability threshold; reward is tied to the same reversion outcome (one learning loop). Stronger trends demand higher conviction.
Honest scope: a linear classifier + a bandit over standard features. Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: basis length, band width σ, touch threshold σ, barrier horizon N, revert/extend levels, learning rate, UCB exploration, min reversion probability.
Touch threshold σ ≈ 1.5–2.0 (lower = more frequent, higher = more selective)
N is the max bars to wait for reversion; 8–15 for 15m–1H
Revert level / extend distance define what counts as success vs failure
Min reversion probability is a floor that suppresses weak-market misfires
Best on range-prone symbols/sessions; in strong trends the UCB automatically throttles firing
💡 How to Use in Practice
Use the fade triangles for counter-trend entries and the mean as the take-profit target
Watch P(revert) vs threshold and take only setups that clear it
When the regime reads TRENDING, fade lightly (pair with a trend tool)
Use the realized revert rate to gauge how reversion-friendly the market is now
Combine with AE-VOL (range envelope) or AE-CORR (drivers) to layer reversion × level
⚠️ Important Notes
Needs a learning period (warmup); learning resets on parameter/timeframe change
Mean reversion fails in strong trends (extend = loss; manage via threshold and regime)
The target mean moves (its level shifts before price reaches it)
Probability, not a guarantee — always do your own due diligence and use risk management
🚨 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 decisions are your own — use proper validation and disciplined risk management. Indicator

AetherEdge - Intermarket Correlation🖊️ Overview
Correlation tables are static; AE-CORR learns which markets actually drive this symbol. Alongside rolling correlation and beta of the chart symbol versus six reference markets (BTC / ETH / crypto cap / DXY / Gold / S&P 500, etc.), an online regression learns each market's predictive weight, producing a next-bar return forecast (with a conformal-calibrated band) and an intermarket directional bias.
🔶 Key Features
Learned driver analysis — learns which markets drive the next move (identifies the dominant driver)
Rolling correlation + beta — live coupling and sensitivity per reference
1-bar lead-lag — how much a reference's prior move predicts the next bar (signed)
Predicted next-bar return — with a ± conformal band for honest uncertainty
Intermarket bias — long/short/flat from the structure
Coupling — overall co-movement strength (a risk-on/off gauge)
Chart triangles + alerts on bias flips; bar-close updates — no repaint
🧠 Technical Architecture
Stats: rolling correlation (ta.correlation) and beta = correlation × (chart σ / ref σ) (contemporaneous coupling and sensitivity).
ML (online linear regression): features are six standardized reference returns plus the chart's own momentum, trained on lag-1 (weights that predict the next bar, updated without lookahead). The learned weights expose each market's drive and sign; the largest is shown as the dominant driver. The live prediction estimates the next-bar return (%) from current returns.
Calibration (split-conformal): the (1-α) quantile of realized residuals forms the band, so predicted ± band matches the target coverage empirically.
Honest scope: linear regression over standard features + nonparametric conformal calibration (no RL). Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: reference timeframe, correlation length, standardization length, learning rate, band significance (1-α), calibration window, bias threshold (× vol), the six references.
Correlation length ≈ 50 is standard; shorter tracks recent coupling, longer is steadier
References are fully swappable (for crypto, BTC/ETH/TOTAL/DXY/GOLD/SPX are classics); blank = skipped
Bias threshold = how many multiples of normal vol the prediction must exceed (≈ 0.5)
Pin references to a higher timeframe for a macro-structure bias
⚠️ The number of referenced markets (security calls) is capped
💡 How to Use in Practice
Check the dominant driver and watch that market as a lead
Use the sign of correlation to design hedges/diversification (negative-corr markets as insurance)
Use predicted next ± band for short-term expectation and risk
Use the bias triangles as an intermarket filter on single-symbol signals
Combine with AE-VOL (volatility) or AE-BPE (breakout probability) to layer driver × level
⚠️ Important Notes
Needs a learning period (warmup); weights re-learn on reference/timeframe change
Correlation is not causation (coupling can break down)
The next-bar forecast is short-horizon and probabilistic — large shocks will miss
Probability, not a guarantee — always do your own due diligence and use risk management
🚨 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 decisions are your own — use proper validation and disciplined risk management. Indicator

AetherEdge - Volatility Forecast🖊️ Overview
ATR shows yesterday's volatility; AE-VOL forecasts the next move and states the uncertainty honestly. An adaptive EWMA variance model estimates forward volatility, drawn on price as a conformal-calibrated expected-range envelope, alongside a volatility regime and a vol-targeted position-size readout.
🔶 Key Features
Adaptive vol forecast — the EWMA decay λ is learned online and reacts to volatility clustering
Calibrated range envelope — the N-bar range is statistically calibrated to hit a target coverage
Forward cone — projects the forecast range into the future
Volatility regime — low/normal/high with expanding ↑ / contracting ↓
Expected move — next-bar ±% and N-bar ±%
Vol-targeted sizing — a multiple that shrinks when forecast vol is high, grows when low
Alerts on regime change; bar-close updates — no repaint
🧠 Technical Architecture
Vol model (adaptive EWMA): h_t = λ·h_{t-1} + (1-λ)·r² (RiskMetrics — a GARCH(1,1) special case with ω≈0; reactivity = 1-λ, persistence = λ). The single decay λ is learned online by quasi-likelihood (QLIKE) with a recursive derivative. A full 3-parameter GARCH has a flat, ill-conditioned likelihood that single-pass SGD won't recover, so AE-VOL adapts one well-conditioned parameter — robust and honest. Returns are in % for numerical stability.
Calibration (split-conformal): the forecast is wrapped in a distribution-free band — the (1-α) quantile of realized standardized moves rescales the envelope so coverage matches the target empirically (fat tails included). No lookahead: the standardizer is the forecast made N bars ago.
Sizing: multiple = clamp(target vol / forecast vol, min, max).
Honest scope: an EWMA variance recursion + one online-adapted parameter + nonparametric conformal calibration (this tool uses no RL). Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: decay learning rate, initial λ, horizon N, band significance (1-α), calibration window, target per-bar vol %.
Initial λ ≈ 0.94 is standard; it auto-adjusts (higher-vol assets converge to lower λ = more reactive)
N is how far ahead you care about; 5–20 bars for 15m–1H
Calibration window ≈ 200; longer is steadier, shorter tracks the recent regime
Target vol % is the per-bar vol you want per position; 0.5–1.5% for crypto 15m–1H
Band significance defaults to 0.90 (10% expected outside); the HUD shows realized coverage
💡 How to Use in Practice
Use the range envelope for take-profit/stop or range judgment (outside the band = statistically unusual)
Regime HIGH favors breakout/trend; LOW (squeeze) flags reversal/range setups
Use the size multiple for vol-targeted money management (auto-smaller in high vol)
The closer coverage is to target, the more trustworthy the band; if it drifts, adjust N or the window
Combine with AE-BPE (breakout probability) or AE-AVP (volume profile) to layer regime × level
⚠️ Important Notes
Needs a learning period (warmup); λ re-learns on timeframe/parameter change
The envelope is a probabilistic range, not a guarantee that price stays inside
The vol forecast gives magnitude, not direction
Probability, not a guarantee — always do your own due diligence and use risk management
🚨 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 decisions are your own — use proper validation and disciplined risk management. Indicator

AetherEdge - Adaptive Volume Profile🖊️ Overview
AE-AVP pairs an auction-theory volume profile (POC and value area) with an engine that learns whether a value-area-edge break gets accepted (a real breakout) or rejected (faded back into value). It shows where volume concentrated and puts a probability on the most tradeable moment — the fight at the value-area edge.
🔶 Key Features
A real volume profile — POC, value area (VAH/VAL), and node strength drawn as a right-side histogram
ML: acceptance/rejection — online-learns whether an edge break continues or reverts; low probability flags a fade to the POC
RL self-tuning threshold — a UCB bandit tunes the acceptance threshold per volatility regime
Signals — distinguishes accepted breakouts (follow) from edge rejections (fade to POC)
POC/VAH/VAL are usable horizontal levels
Learning/signals on bar close — no repaint
🧠 Technical Architecture
Volume profile: the recent lookback bars' price range is split into rows bins; each bar's volume is distributed across the bins its spans. POC = highest-volume bin; value area = expand from the POC toward the heavier neighbour until vaPct% (default 70%) of volume is enclosed → VAH/VAL; node strength = bin volume / max.
ML (online logistic regression): when price breaks above VAH or below VAL, seven features (edge node strength, approach momentum, volume surge, stretch from POC, trend, volatility regime, VA width — oriented to the break direction) feed a model of P(acceptance). Events are held in an internal array and labeled by a triple barrier (accept = beyond the edge by k·ATR; reject = back inside; time-out discarded) — no future data.
RL (UCB contextual bandit): tunes the acceptance threshold per volatility regime (ATR-percentile terciles); the reward is tied to the same edge resolution, so ML and RL share one judgment loop.
Signals: acceptance (P ≥ threshold) → follow the break direction; rejection (P ≤ 1 − threshold) → fade toward the POC.
Honest scope: a linear classifier + a UCB bandit over standard profile/price features. Not deep learning, not a guarantee.
⚙️ Recommended Settings & Tuning Guide (crypto 15m–4H)
Key parameters: profile lookback, bins (rows), value-area %, acceptance/rejection distance (ATR), horizon M, threshold search range.
Larger lookback → big-picture POC (stable, slower); smaller → sensitive to recent volume
More bins → higher resolution (finer, heavier to draw)
Higher value-area % → a wider VA and stricter break conditions
Guide: BTC/ETH (15m–1H) defaults (lookback 150, rows 24, VA 70%); 4H/daily a longer lookback; high-vol alts slightly wider acceptance/rejection distances
P(acceptance), threshold, and accuracy are coarse until warmup plus enough edge events accumulate
💡 How to Use in Practice
The POC is a magnet price; VAH/VAL are the battle lines — range inside value, direction on an edge break
Acceptance signals (BRK) mean follow the break; rejection signals (REJ) mean fade the edge toward the POC
Use P(acceptance) and node strength to judge whether a break is real (breaking a weak node with high acceptance)
Leave the auto threshold to the learner by default
Combine with a higher-timeframe value area or a trend tool for added precision
⚠️ Important Notes
Needs a learning period (warmup); weights and the Q-table re-learn on input/symbol/timeframe change
The profile is computed from closed bars; the histogram shows the current window
An edge break does not guarantee acceptance (which is exactly why it's shown as a probability)
Probability, not a guarantee — always 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. Indicator

Distance From Entry + Max Excursion**What this script does**
This indicator displays a small, fully customizable table on the chart that shows two pieces of information relative to a manually defined entry price:
1. **Distance From Entry** — the absolute difference, in points, between the current price and the entry price, along with whether price is currently above, below, or at that level.
2. **Max Excursion** — the largest favorable move price has made since the most recent time it touched the entry level. If price is currently above entry, this tracks the highest high reached since that last touch; if price is currently below entry, it tracks the lowest low reached since that last touch. The figure shown is the point distance between entry and that extreme.
**How it works (concept)**
The script does not pull live position data from any broker. Pine Script has no access to a connected broker account's open trades, fill price, or quantity, so this tool instead uses a single user-defined input (the entry price you place by clicking on the chart) as its reference point.
From there, the script watches every bar to detect a "touch" of that entry price, defined as any bar whose high-low range brackets the entry level (low <= entry <= high). Each time a touch occurs, the running high/low tracker resets to that bar's range. Between touches, the tracker expands to capture the highest high (if price is above entry) or lowest low (if price is below entry) reached during that stretch. This produces a continuously updating "maximum excursion" figure without requiring the user to manually mark when a trade started or which direction it was — direction is inferred automatically from where price currently sits relative to the entry level.
**Why it's useful**
Traders who manually track trade management metrics — specifically, how far price has moved from an entry level, and the best the trade has looked since price last revisited that level — typically do this with mental math or by eyeballing the chart. This script automates that single calculation and displays it persistently in a screen-fixed table, so it doesn't require redrawing tools or recalculating by hand every time price moves.
**Customization**
Nearly every visual aspect of the table is exposed as an input, organized into grouped sections in the settings panel:
- Table position (any of the 9 standard chart anchor points)
- Cell width/height (manual sizing or auto-fit)
- Text horizontal/vertical alignment
- Text size (5 steps) and font family (default or monospace — the two families Pine Script supports)
- Decimal precision (0–4 digits)
- Optional prefix text and direction wording
- Background color, border color, and border width
- Optional color-coding of text based on whether price is above or below entry
**How to use it**
1. Add the indicator to your chart.
2. When prompted, click on the chart at your entry price (or place it roughly and drag the resulting line to the exact level).
3. The table will appear in your chosen screen corner, showing live point distance from entry and the running maximum excursion since the last touch of that level.
4. Open the indicator's settings at any time to adjust position, sizing, colors, font, and decimal precision to your preference.
5. To start tracking a new trade, simply update the entry price input to the new level.
**Limitations**
- This script does not read live broker/account data of any kind. The entry price is a manual input and will not update automatically when a position is closed or a new one is opened.
- If price gaps cleanly across the entry level on a single bar (the bar's open and close both clear entry, but its high/low range does not bracket the entry price), that bar will not register as a "touch," and the excursion tracker will not reset on that bar. This is uncommon in actively traded intraday futures but can occur around large gaps in thinner markets.
- This tool is for visual reference only. It does not generate buy/sell signals, does not constitute trading advice, and makes no claims about trading performance or outcomes. Indicator

IB Break StatisticsIB Break Statistics
Tracks the behavior of the Initial Balance (IB) — the price range formed in the first hour of
the session — across the last N trading days.
Sections:
Break Type — how often the session ends with no break, a single-sided break (high or low only),
or a double break (both sides).
Day of Week — break frequency broken down by weekday, to identify which days tend to trend vs.
range.
Extension after break — of the days that broke, how far price traveled beyond the IB level,
expressed as a multiple of the IB range (e.g. 0.5× IB). Useful for calibrating take-profit
targets.
Retrace after break — on single-break days, how far price pulled back toward the IB after the
break. Bucketed as shallow (≤10%), entry zone (11–25%), deep (26–50%), or back inside IB (>50%).
Useful for calibrating retrace entries and stop placement.
IB Size — the daily IB range expressed as a percentage of the session's mid-price. Bucketed as
narrow (<0.3%), normal (0.3–0.7%), wide (0.7–1.0%), and very wide (>1.0%). Useful for
understanding the typical volatility regime and filtering setups by IB size.
Settings: configure IB window (default 9:30–10:30 NY), lookback period, and tracking end time. Indicator

Indicator

Indicator

Illiquidity 1m gaps// WHAT IT DOES
// Detects illiquid stocks by counting how often consecutive 1-minute bars
// fail to touch each other. On liquid names trades print continuously, so
// each bar's open is essentially equal to the previous bar's close. On
// illiquid names there are minutes with zero trades, and when a trade
// finally happens it can land at a meaningfully different price - leaving
// a visible gap between bars. Many such gaps in a session is a direct
// signal of thin liquidity.
//
// The indicator runs the 1-min gap analysis even when applied to higher
// timeframes (e.g. daily). Each daily candle is annotated with the total
// number of 1-min gaps that occurred during that session, broken into
// gap-ups and gap-downs. When the count exceeds the threshold, the
// display turns red.
//
// HOW IT WORKS
// 1. Fetches 1-minute data via request.security_lower_tf(), regardless
// of the chart's current timeframe.
// 2. For each 1-min bar, compares open to the prior close.
// 3. A gap is registered when |open - prevClose| / prevClose * 100
// exceeds the configured threshold.
// 4. Session-boundary jumps (overnight, lunch break) are excluded by
// checking the time delta between consecutive bars - only bars less
// than 5 minutes apart in real time are considered.
// 5. Gaps are summed across all 1-min bars within the current chart bar.
//
// INPUTS
// - Min gap size pct: Minimum price jump (% of price) that counts as a
// gap. Default 0.10%. Increase for cheap stocks (Rs.3000 use 0.05%).
// - Gaps per chart bar to flag illiquid: Threshold above which the bar
// is marked red. Suggested starting values by category:
// Nifty 50 / large caps : 10
// Mid caps : 20 (default)
// Small caps : 35
// Microcaps / SME : 60+
// - Show on chart (table): Toggle the corner table.
// - Show in status line: Toggle the three numbers in PulseWire's
// status line (Total / Up / Down).
// - Table position: 9-way position picker (top/middle/bottom x
// left/center/right).
// - Text size: Tiny / Small / Normal / Large.
//
// DISPLAY
// - Table shows: "g u d" e.g. "14g 8u 6d".
// - Status line shows the same three numbers as separate plot values.
// - Background of the readout flips red when total >= threshold.
//
// LIMITATIONS
// - PulseWire caches a limited amount of lower-timeframe history. On
// a daily chart pulling 1-min data, typically only the most recent
// 10-40 trading days will populate accurately. Older bars may show
// zero gaps because the 1-min data is unavailable, not because the
// stock was liquid.
// - Free/Basic plans have stricter intrabar limits than paid plans.
// - Works best on equity instruments with regular sessions. For 24/7
// markets (crypto), the session-boundary filter is unused.
//
// USE CASE
// Screen out illiquid stocks before adding them to a watchlist or sizing
// into a position. Apply this indicator to your daily chart, glance at
// the corner readout, and skip any name flagged red - the spread and
// slippage on those will eat your edge.
//
// CALIBRATION
// Apply to three reference tickers on your daily chart:
// - A known liquid name (RELIANCE) - should read ~0-5 gaps.
// - A midcap you actually trade - note the typical count.
// - A microcap or SME - should read 50+.
// Set your threshold to roughly 2x the typical count of your tradeable
// midcap.
// ============================================================================= Indicator

Daily VWAP Deviation MapDaily VWAP Deviation Map plots the current exchange day's VWAP and volume-weighted standard-deviation bands around it.
The purpose of this script is to show how far price is trading from the day's volume-weighted mean. Distance is displayed in price units, percent, and sigma distance. This is a context and visualization tool. It does not provide trade-action instructions and it is not a trading system.
What it shows
- Daily VWAP based on the selected source, default hlc3.
- Inner, outer, and optional tail deviation bands.
- Sigma distance from the current day's VWAP.
- A neutral state model that describes price location relative to VWAP.
- A compact dashboard with state, sigma distance, percent distance, VWAP, and volume mode.
- Optional non-arrow event markers for factual band-crossing events.
How it works
At the start of each exchange day, the calculation resets and begins accumulating volume-weighted sums from the current chart bars.
The script maintains:
- cumulative volume
- cumulative price times volume
- cumulative price squared times volume
- session bar count
From these values, it calculates:
VWAP = cumulative price times volume / cumulative volume
variance = cumulative price squared times volume / cumulative volume - VWAP squared
sigma = square root of variance, guarded against rounding noise
The script then calculates:
- raw distance from VWAP
- percent distance from VWAP
- sigma distance from VWAP
All calculations use current chart bars only. The script does not use request.security(), lookahead, or future data. Historical values are not recalculated with future information.
Daily anchoring
The daily reset follows the chart symbol's exchange day and timezone. This reset is used only to anchor the VWAP calculation to the current day. It is not a session highlighter and it does not shade Tokyo, London, New York, or other trading sessions.
Deviation states
The dashboard uses neutral descriptive states:
- Warming up
- Near VWAP
- Inner range
- One-sigma edge
- Two-sigma extension
- Outer tail
These states describe current price location. They do not imply future reversal or continuation.
Bands and multipliers
The inner, outer, and tail band multipliers are user-configurable. The active outer tier is kept above the active inner tier, and the active tail tier is kept above the outer tier. Event markers and alerts follow the active inner and outer band tiers so they remain aligned with the displayed bands when users customize the multipliers.
Volume handling
When usable volume is available, the calculation is volume-weighted. If volume is missing or not positive and fallback is enabled, the script uses an equal-weight fallback so the display can remain continuous. The dashboard discloses this clearly.
The dashboard volume mode can show:
- Volume-weighted
- Equal-weight fallback
- No usable volume
On some symbols, especially certain FX or CFD feeds, volume may represent tick volume or may not be available. This affects how VWAP and deviation bands should be interpreted.
Events and alerts
Event markers are small, neutral, non-arrow plotshape markers. They describe factual events only, such as:
- crossed above the upper inner band
- crossed below the lower inner band
- crossed above the upper outer band
- crossed below the lower outer band
- returned inside from an upper or lower extension
- crossed VWAP
Alerts use the same neutral event logic. The default setting evaluates events on confirmed bars only to reduce intrabar repainting.
Customization
Users can adjust the dashboard position, layout density, text size, plot colors, table colors, marker colors, and transparency settings.
The default dashboard position is Top right padded. It keeps the panel in the upper-right area while using subtle internal spacing to reduce clutter near the chart's right-side price-scale labels. Users can switch to standard Top right or any other available table anchor.
The default layout is Compact for a clean chart. Standard and Detailed layouts are available for users who want more information.
Intended use
This indicator is designed for intraday charts. On daily or higher timeframes, the script avoids showing misleading daily VWAP deviation bands and displays an intraday-use notice instead.
Limitations
This script is not financial advice and not a trading system.
Distance from VWAP does not guarantee reversal or continuation.
Default settings are starting points, not optimized settings.
Early-session VWAP and sigma readings can be sensitive because fewer bars have been accumulated.
Volume quality differs across markets and symbols.
Japanese notes
当日VWAPと出来高加重標準偏差バンドを使って、価格が当日の平均価格からどれだけ乖離しているかを表示します。状況把握用の可視化ツールであり、売買判断や将来の値動きを示すものではありません。出来高が使えない銘柄では等加重フォールバック、または No usable volume を表示します。イントラデイ向けです。 Indicator

Machine Learning Adaptive DMI Signals [AlgoAlpha]🟠 OVERVIEW
The Directional Movement Index (DMI) is commonly calculated using a fixed lookback length. But market conditions change over time, and a length that works well during one period may become less effective during another.
This script builds multiple DMI models across a user-defined range of lengths and continuously evaluates their past performance. Each DMI length acts as an independent expert. As new directional flips occur, the script measures how well each expert performed and updates its internal scoring system.
The result is an adaptive DMI that automatically shifts toward lengths that have recently produced better directional signals while reducing the influence of weaker performers.
🟠 CONCEPTS
Expert DMI — A DMI calculation running at a specific lookback length within the tested range.
Directional Flip — A change in trend state when +DI crosses above -DI or when -DI crosses above +DI.
Reward Score — A performance score assigned to each completed flip based on return, move quality, pullback behavior, or win rate.
Maximum Favorable Excursion (MFE) — The largest move in the trade's favor before the next directional flip.
Maximum Adverse Excursion (MAE) — The largest move against the trade before the next directional flip.
Recency Decay — A weighting system that gradually reduces the influence of older observations so recent market behavior has greater impact.
Softmax Weighting — A probability-style weighting process that gives greater influence to higher-scoring DMI lengths when estimating the adaptive length.
🟠 FEATURES
Adaptive +DI and -DI Lines — Displays directional movement using a dynamically selected DMI length that adjusts over time.
Directional Clouds — Color-filled regions between the DI lines help visualize which side currently has directional control.
Bullish and Bearish Flip Signals — ▲ and ▼ markers appear when the Adaptive +DI and -DI lines cross.
ADX Strength Display — Strength squares at the bottom of the pane become more visible as trend strength increases and fade as strength decreases.
Information Table — Displays the active adaptive length, selected scoring mode, memory count, and current bullish or bearish trend state in a customizable table.
🟠 HOW TO USE
Watch for bullish flips when Adaptive +DI crosses above Adaptive -DI to identify potential shifts toward upward directional control.
Watch for bearish flips when Adaptive -DI crosses above Adaptive +DI to identify potential shifts toward downward directional control.
Use the ADX strength squares to gauge whether directional movement is strengthening or weakening.
Increase the tested length range when evaluating a wider variety of market conditions.
Increase Memory and Forget Old Trades values for more stable adaptation and slower length changes.
Decrease Memory or lower the decay factor when faster adaptation to recent behavior is preferred.
Experiment with the available scoring methods to determine whether return, trend quality, or consistency is more important for your analysis.
🟠 CONCLUSION
Machine Learning Adaptive DMI combines traditional DMI calculations with a performance-driven adaptive length selection process. Instead of relying on a fixed lookback period, it continuously evaluates how different DMI lengths have behaved and adjusts accordingly. This provides a dynamic view of directional strength, trend bias, and signal quality that reflects recent market behavior. Indicator

Risk-Neutral Probability Cone [v1]The Risk-Neutral Probability Cone is a forward-looking volatility projection tool designed to help traders estimate probable future price ranges over a selected number of bars.
The indicator projects a probability cone from the current anchor price using a lognormal price-process framework. It plots expected path, ±1σ, ±2σ, and ±3σ forward price bands based on the selected volatility model, drift model, and projection horizon.
This is not a buy or sell signal indicator.
It is a scenario-planning, risk-management, and probability-mapping tool.
The goal is to help traders answer:
“How far could price reasonably move over my selected horizon?”
and
“Is my price target inside or outside the expected probability range?”
The indicator can be used across FX, crypto, equities, indices, commodities, futures, and other liquid markets.
WHAT THE INDICATOR DOES
━━━━━━━━━━━━━━━━━━━━━━
The indicator starts from an anchor price and projects a forward probability cone.
The cone is based on:
• Anchor price
• Selected volatility model
• Selected drift model
• Projection horizon
• Bars per year
• Lognormal price dynamics
• Standard deviation bands
The main output is a forward cone showing possible future price ranges.
The cone expands over time because uncertainty increases as the projection horizon becomes longer.
A short projection horizon will produce a narrower cone.
A long projection horizon will produce a wider cone.
CORE IDEA
━━━━━━━━━━━━━━━━━━━━━━
The indicator assumes that future price movement can be approximated using a lognormal distribution.
This is similar to the framework used in many derivatives and option-pricing models.
The projected price level is calculated using:
Expected price movement over time
plus
Volatility-adjusted standard deviation bands
The indicator then plots the following paths:
• Expected path
• +1σ and -1σ bands
• +2σ and -2σ bands
• +3σ and -3σ bands
These bands help traders visualize a probability-based forward range.
WHAT THE CONE LEVELS MEAN
━━━━━━━━━━━━━━━━━━━━━━
Expected Path
The expected path is the central projection line.
It reflects the selected drift model and the volatility adjustment used in the lognormal framework.
It should not be treated as a forecast.
It is a model-based expected reference path.
1σ Cone
The ±1σ cone shows the normal expected range around the projected path.
This is the most practical zone for ordinary price movement.
If price remains inside the 1σ cone, it is generally moving within a normal volatility-adjusted range.
2σ Cone
The ±2σ cone shows a more extended move.
Price moving toward or beyond the 2σ cone suggests a larger-than-normal move relative to the selected volatility model.
This may indicate:
• Momentum expansion
• Event-driven repricing
• Trend acceleration
• Liquidity shock
• Mispriced volatility assumption
3σ Cone
The ±3σ cone shows an extreme move zone.
This is useful for stress testing, event-risk planning, and identifying unusually large price moves.
A move toward the 3σ cone should not automatically be treated as a reversal signal.
Strong markets can remain outside expected ranges when volatility expands or when the original volatility input becomes stale.
MAIN COMPONENTS
━━━━━━━━━━━━━━━━━━━━━━
1. Anchor Price
The anchor price is the starting point of the probability cone.
The script supports four anchor modes:
• Close
• Manual
• EMA
• VWAP
Close uses the latest closing price.
Manual allows the trader to enter a specific price level.
EMA uses a moving average as the anchor.
VWAP uses volume-weighted average price as the anchor.
For live projection, Close is usually the easiest setting.
For scenario planning, Manual is useful because it allows the trader to anchor the cone from a specific entry price, event level, or key market level.
2. Projection Horizon
The projection horizon determines how far into the future the cone extends.
It is measured in bars.
For example:
• On a 1-hour chart, 24 bars means approximately 24 trading hours
• On a daily chart, 20 bars means approximately 20 trading days
• On a 5-minute chart, 48 bars means approximately 4 trading hours
The longer the horizon, the wider the cone becomes.
3. Cone Drawing Step
Cone Drawing Step controls how frequently the cone lines are drawn.
A smaller step makes the cone smoother.
A larger step makes the cone lighter and less visually crowded.
For shorter horizons, a smaller step can be used.
For longer horizons, a larger step can help keep the chart clean.
4. Volatility Model
The indicator includes three volatility model options:
• Realized Volatility
• ATR Proxy
• Composite
Realized Volatility uses log returns and rolling standard deviation.
ATR Proxy uses average true range as a percentage of price.
Composite blends realized volatility and ATR volatility.
Realized Volatility is more statistically direct.
ATR Proxy is more sensitive to intrabar range.
Composite is often the most practical default because it captures both close-to-close movement and range-based movement.
5. Drift Model
The indicator includes three drift models:
• Risk-Neutral
• Zero Drift
• Historical Drift
Risk-Neutral uses risk-free rate minus carry or dividend yield.
Zero Drift assumes no directional drift.
Historical Drift estimates drift from past log returns.
For short-term trading, Zero Drift or Risk-Neutral usually provides cleaner projections.
Historical Drift can be unstable and may overfit recent trends.
6. Risk-Free Rate and Carry / Dividend Yield
These inputs are used when the Drift Model is set to Risk-Neutral.
For equities, carry or dividend yield can represent dividend assumptions.
For FX, the difference between domestic and foreign rates may be relevant.
For crypto, users may prefer Zero Drift unless they have a clear carry assumption.
7. Probability to Target
The script includes an optional probability-to-target feature.
When enabled, the user can enter a target price.
The indicator estimates the model-based probability that price will finish above that target by the end of the projection horizon.
This is useful for scenario planning and target evaluation.
It should not be treated as a guaranteed forecast.
HOW TO READ THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
The indicator plots a forward cone on the price chart.
General visual guide:
• White path = expected path
• Green cone = ±1σ range
• Orange cone = ±2σ range
• Red cone = ±3σ range
The dashboard shows:
• Anchor price
• Volatility model
• Annualized volatility
• Drift model
• Annual drift
• Horizon bars
• Expected terminal price
• +1σ and -1σ terminal levels
• +2σ and -2σ terminal levels
• +3σ and -3σ terminal levels
• Probability above target if enabled
The cone should be read as a forward probability range, not as support and resistance.
HOW TO USE THE INDICATOR
━━━━━━━━━━━━━━━━━━━━━━
Use the Risk-Neutral Probability Cone as a forward scenario tool.
The main workflow is:
1. Choose the market and timeframe.
The indicator can be used on intraday or daily charts.
The timeframe should match the trader’s holding period.
2. Choose the anchor mode.
Use Close for live projection.
Use Manual for trade planning.
Use EMA for smoother trend-based projections.
Use VWAP for intraday execution context.
3. Select the projection horizon.
Match the horizon to the trade idea.
A scalp should use fewer bars.
A swing trade should use more bars.
4. Select the volatility model.
Use Realized Volatility for a cleaner statistical model.
Use ATR Proxy for a more range-sensitive model.
Use Composite for a balanced approach.
5. Select the drift model.
Use Risk-Neutral for derivatives-style scenario mapping.
Use Zero Drift for clean short-term projections.
Use Historical Drift only when you intentionally want recent trend behaviour included.
6. Read the cone.
If price is inside the 1σ cone, the move is relatively normal.
If price approaches the 2σ cone, the move is becoming extended.
If price approaches the 3σ cone, the move is extreme relative to the selected assumptions.
7. Compare price targets to the cone.
Targets inside the 1σ cone are more conservative.
Targets near the 2σ cone are more aggressive.
Targets near or beyond the 3σ cone require a much stronger volatility or trend justification.
PRACTICAL TRADING USE CASES
━━━━━━━━━━━━━━━━━━━━━━
1. Trade Target Planning
The cone helps traders assess whether a target is realistic for the selected holding period.
If a target is far beyond the 2σ or 3σ cone, the trader should question whether the target is realistic without a major catalyst.
2. Stop-Loss Planning
The cone can help traders understand normal adverse movement.
A stop placed too close inside the normal 1σ range may be vulnerable to ordinary volatility.
A stop placed outside the expected range may require smaller position size.
3. Event-Risk Planning
The cone can be used before major events such as:
• CPI
• NFP
• FOMC
• ECB decisions
• Earnings
• Crypto unlocks
• Geopolitical events
• Major macro data
The trader can compare expected event movement against the cone.
If price moves outside the 2σ or 3σ cone after the event, it may indicate that the market is repricing beyond normal volatility assumptions.
4. Breakout Assessment
If price breaks above the 1σ cone and volatility is also expanding, the breakout may have more momentum support.
If price breaks the 1σ cone but immediately returns inside the cone, the breakout may be weaker.
5. Mean-Reversion Monitoring
Price near the 2σ or 3σ cone may be extended.
However, the cone should not be used to fade price blindly.
A better mean-reversion setup requires confirmation such as:
• Failed continuation
• Re-entry inside the cone
• Break of short-term structure
• Volatility cooling
• Reclaim of a key moving average
• Liquidity sweep and rejection
6. Scenario Analysis
The cone can be used to frame bull, base, and bear scenarios.
The upper cone levels represent upside scenarios.
The lower cone levels represent downside scenarios.
The expected path represents the model’s central scenario.
SUGGESTED SETTINGS
━━━━━━━━━━━━━━━━━━━━━━
FX 1-Hour
• Anchor Mode: Close or Manual
• Volatility Model: Realized Volatility or Composite
• Realized Volatility Lookback: 30 to 50
• ATR Lookback: 14
• Horizon Bars: 24 to 72
• Cone Drawing Step: 4 to 8
• Bars Per Year: 6240
• Drift Model: Risk-Neutral or Zero Drift
Crypto 1-Hour
• Anchor Mode: Close or Manual
• Volatility Model: Composite
• Realized Volatility Lookback: 50
• ATR Lookback: 14 to 21
• Horizon Bars: 24 to 168
• Cone Drawing Step: 6 to 12
• Bars Per Year: 8760
• Drift Model: Zero Drift or Risk-Neutral
Daily Equities / Indices
• Anchor Mode: Close or EMA
• Volatility Model: Composite
• Realized Volatility Lookback: 20 to 30
• ATR Lookback: 14
• Horizon Bars: 10 to 30
• Cone Drawing Step: 2 to 5
• Bars Per Year: 252
• Drift Model: Risk-Neutral
Intraday Indices
• Anchor Mode: Close, Manual, or VWAP
• Volatility Model: Composite
• Realized Volatility Lookback: 30 to 50
• ATR Lookback: 14
• Horizon Bars: 24 to 96
• Cone Drawing Step: 4 to 8
• Bars Per Year: adjust to the timeframe
• Drift Model: Zero Drift or Risk-Neutral
DRIFT MODEL GUIDE
━━━━━━━━━━━━━━━━━━━━━━
Risk-Neutral Drift
Risk-Neutral drift uses:
Risk-Free Rate minus Carry / Dividend Yield
This is useful for a derivatives-style probability framework.
For FX, this may approximate the interest rate differential.
For equities, the carry input may represent dividend yield.
For crypto, this is often less relevant unless there is a specific funding or carry assumption.
Zero Drift
Zero Drift assumes no expected directional drift.
This is often useful for short-term trading because drift is usually small relative to volatility over short horizons.
Zero Drift is a clean default for intraday analysis.
Historical Drift
Historical Drift estimates drift from recent average log returns.
This can make the cone follow recent trend behaviour, but it is also more prone to overfitting.
Historical Drift should be used carefully.
VOLATILITY MODEL GUIDE
━━━━━━━━━━━━━━━━━━━━━━
Realized Volatility
Realized Volatility uses close-to-close log returns.
This is statistically clean and works well for probability-based modelling.
ATR Proxy
ATR Proxy uses range-based volatility.
It is more sensitive to intrabar movement and can be useful for instruments with large wicks or wide trading ranges.
Composite
Composite blends realized volatility and ATR volatility.
This is often the best practical default because it captures both return-based and range-based volatility.
PROBABILITY TO TARGET
━━━━━━━━━━━━━━━━━━━━━━
The probability-to-target feature estimates the probability that price will finish above the selected target price by the end of the projection horizon.
This can be useful for:
• Checking whether a target is realistic
• Comparing upside and downside scenarios
• Evaluating trade targets before entry
• Stress testing expectations
• Avoiding overly ambitious targets
Important note:
The probability is model-based.
It depends heavily on the selected volatility, drift, anchor, and horizon inputs.
It should not be treated as a guaranteed probability.
HOW TO COMBINE WITH OTHER INDICATORS
━━━━━━━━━━━━━━━━━━━━━━
This indicator works best as part of a broader volatility and market-structure framework.
Useful combinations:
• Expected Move Bands
• Realized Volatility Regime Indicator
• Implied Volatility Proxy
• Delta-Hedging Pressure Proxy
• Dynamic Stop-Loss Using Expected Move
• VWAP
• Moving averages
• Support and resistance
• Liquidity zones
• Market structure breaks
• Macro and event calendars
Suggested framework:
Expected Move Bands show near-term projected levels.
Realized Volatility Regime shows whether volatility is low, normal, high, or extreme.
IV Proxy shows whether broader uncertainty is rising or cooling.
Delta-Hedging Pressure Proxy shows whether directional pressure is positive or negative.
Dynamic Stop-Loss Using Expected Move converts volatility into stop and target levels.
Risk-Neutral Probability Cone maps a full forward probability range.
Together, these tools help answer:
• How far can price move?
• What is the probable forward range?
• Is the target realistic?
• Is volatility expanding or cooling?
• Is directional pressure aligned?
• Where should stops and targets be placed?
• Should position size be reduced?
TRADING EXAMPLES
━━━━━━━━━━━━━━━━━━━━━━
Example 1: Target Planning
A trader is long EUR/USD on the 1-hour chart.
The trader sets the cone horizon to 24 bars.
The upside target is close to the +1σ terminal level.
This suggests the target is within a normal expected range.
If the target is above +2σ, the trader may need stronger confirmation from trend, momentum, or event risk.
Example 2: Breakout Confirmation
Price breaks above a key resistance level and moves outside the +1σ cone.
If volatility is expanding and the IV Proxy is rising, the breakout may have stronger continuation potential.
If price quickly returns inside the cone, the breakout may be weaker.
Example 3: Event Risk
Before a central bank decision, a trader anchors the cone from the pre-event price.
After the event, price moves beyond the 2σ cone.
This suggests the event caused a larger-than-normal repricing relative to the volatility assumptions used before the event.
Example 4: Mean-Reversion Watch
Price trades near the +3σ cone.
This is an extreme move relative to the model.
However, the trader should not automatically short.
A better setup would require failed continuation, volatility cooling, and price re-entry inside the cone.
Example 5: Stop Placement Context
A trader wants to place a stop inside the 1σ cone.
The cone suggests that ordinary volatility could reach that level.
The trader may choose to reduce size and place the stop beyond a more meaningful structure level, or avoid the trade if reward-to-risk is poor.
RISK MANAGEMENT NOTES
━━━━━━━━━━━━━━━━━━━━━━
The cone is most useful when combined with position sizing and trade invalidation logic.
Practical risk rules:
• Do not treat cone levels as guaranteed support or resistance
• Do not fade 2σ or 3σ moves without confirmation
• Reduce size when volatility is high and the cone is wide
• Avoid unrealistic targets far outside the cone without a catalyst
• Use the cone to judge whether stops and targets are reasonable
• Re-anchor the cone after major events or regime shifts
• Treat the cone as a scenario map, not a forecast
A wider cone means uncertainty is higher.
Higher uncertainty should generally mean smaller position size.
WHAT THIS INDICATOR IS BEST FOR
━━━━━━━━━━━━━━━━━━━━━━
This indicator is best used for:
• Forward probability mapping
• Scenario analysis
• Target evaluation
• Event-risk planning
• Stop and target context
• Volatility-adjusted range projection
• Identifying normal versus extreme price movement
• Trade planning
• Risk management
It is useful for traders who want to frame markets probabilistically instead of relying only on static support and resistance.
WHAT THIS INDICATOR IS NOT
━━━━━━━━━━━━━━━━━━━━━━
This indicator is not:
• A buy or sell signal generator
• A standalone trading strategy
• A guarantee that price will stay inside the cone
• A Monte Carlo simulation
• A true options-implied probability model
• A replacement for risk management
• A replacement for market structure
• A complete trading system
The cone describes a model-based forward distribution.
It does not predict the future with certainty.
IMPORTANT LIMITATIONS
━━━━━━━━━━━━━━━━━━━━━━
The indicator depends on model assumptions.
Key assumptions include:
• Volatility estimate is relevant for the future horizon
• Price movement can be approximated by a lognormal process
• Drift input is reasonable
• Market conditions remain broadly comparable
• No sudden structural break occurs
These assumptions can fail.
The cone may become inaccurate during:
• Economic data shocks
• Central bank decisions
• Earnings surprises
• Geopolitical events
• Liquidity gaps
• Crypto liquidation cascades
• Market opens and closes
• Sudden volatility regime shifts
The indicator does not include:
• Options implied volatility
• Options skew
• Volatility term structure
• Dealer positioning
• Order flow
• Market depth
• News sentiment
• Fundamental data
• Liquidity conditions
The cone should be used as a decision-support tool, not as a standalone trading system.
FINAL NOTES
━━━━━━━━━━━━━━━━━━━━━━
The Risk-Neutral Probability Cone helps traders convert volatility, drift, and time into a forward probability map.
Instead of asking only whether price is bullish or bearish, this tool helps answer:
• What is the probable forward range?
• Is the current move normal or extended?
• Is my target realistic?
• Is my stop too close?
• Is the market moving beyond expected assumptions?
• Should I reduce size because uncertainty is high?
• Has the market repriced beyond the cone after an event?
The indicator is designed to improve scenario planning, risk discipline, and volatility-aware decision making.
Indicator

Runs Test Z-Score# Runs Test Z-Score
## What It Is
The Runs Test Z-Score is a statistical time-series indicator that applies the Wald-Wolfowitz Runs Test to directional price change sequences to measure departures from randomness.
Advantages: The Runs Test is non-parametric, simple to compute, and does not require assumptions about the distribution of returns.
Limitations: It considers only the direction of price changes, ignoring their magnitude, and may have limited power to detect more complex forms of dependence.
Runs are uninterrupted sequences of the same directional state. For example, the sequence (+, +, +, −, −, +, +) forms three runs: (+++), (--), and (++). The Runs Test compares the observed number of runs to the number expected under pure randomness to determine whether price changes exhibit persistence, anti-persistence (alternation), or random sequencing.
The indicator evaluates the **sequential randomness of price changes** to determine whether directional movements occur in a manner consistent with a random walk, or whether they exhibit persistent or alternating structural behavior.
The indicator produces a standardized Z-score:
**Negative values** indicate persistence (fewer directional state changes than expected under randomness).
**Values near zero** indicate random-like sequencing.
**Positive values** indicate anti-persistence (more directional state changes than expected under randomness).
Three independent price sequences can be analyzed:
### 1. Close-to-Close
Measures the sequential pattern of where price closed on the current bar relative to the previous bar's close. It captures the net directional outcome between consecutive intervals, incorporating all activity—including overnight or weekend gaps—while ignoring the path taken within the bar itself. This is typically the broadest, most aggregated mode.
### 2. Open-to-Close
Measures the sequential pattern of directional movement strictly *within* each bar by comparing the close to the open. Positive states indicate an upward drive during the session; negative states indicate a downward drive. This sequence reveals whether intraday or intra-bar directional drive tends to persist or alternate through time.
### 3. Midpoint Position
Measures where price closes relative to the high-low midpoint of each bar. A close above the midpoint indicates that buyers controlled the final portion of the bar's range, while a close below indicates seller control. This pattern captures whether range-control dominance tends to persist or alternate across consecutive bars, regardless of the net change between closes.
---
## What Divergence Means in Practice
Divergence is not a failure of the indicator. It is the indicator revealing something more precise than any single sequence could.
The three sequences measure distinct aspects of price behavior. When they diverge, they reveal structural differences in how directional progression, intra-bar drive, and range control are expressed through sequential price changes.
**All Three Agree:** Sequential structure is highly coherent across inter-bar direction, intra-bar drive, and range control. Price changes are expressing a consistent behavioral pattern across all three dimensions of price action.
**Close-to-Close Persists | Open-to-Close is Random:** The broader trend is being carried primarily by net bar-to-bar advances — including gap contributions — rather than persistent intra-bar directional drive.
**Open-to-Close Persists | Close-to-Close is Random:** Bars exhibit consistent internal directional drive, but that drive does not translate into sequential progress across bars. Strong movement occurs within sessions, but net inter-session direction remains inconsistent.
**Midpoint Position Diverges From Both:** Intra-bar auction control is decoupled from directional movement. Buyers or sellers may be consistently dominating the close of the bar's range even while net trend progression and intra-bar drive remain mixed or random.
**Close-to-Close & Open-to-Close Agree | Midpoint Disagrees:** Directional movement is consistent both within and between bars, but closing location within the range suggests underlying auction dynamics are less consistent with the prevailing directional movement. Trend progression and range control are actively diverging.
**Open-to-Close & Midpoint Agree | Close-to-Close Disagrees:** Intra-bar directional drive and range control are aligned, but that internal behavior fails to translate into persistent directional progression across consecutive bars.
**Close-to-Close & Midpoint Agree | Open-to-Close Disagrees:** Directional progression and range control are aligned, but movement occurring within individual bars lacks persistence. Price changes are making net progress despite inconsistent intra-bar drive.
**All Three Disagree:** Structural signals are mixed across all three dimensions, indicating low agreement regarding the prevailing sequential regime.
---
## Why It Was Built
Most technical indicators focus on trend strength, momentum, volatility, or price efficiency. Far fewer attempt to quantify the underlying sequencing structure of consecutive price changes.
Sequential price changes can produce identical net price movements while exhibiting entirely different internal structures:
**Persistent sequences** contain fewer directional state changes than expected under a random process.
**Random sequences** exhibit no detectable departure from random ordering.
**Alternating sequences** contain more directional state changes than expected under a random process.
Understanding which structural environment currently dominates provides objective, statistical context for trend-following systems, mean-reversion approaches, pattern analysis, and price structure assessment.
---
## Core Concepts
### Persistence
Persistence occurs when directional moves tend to continue. In a persistent environment, state changes occur less frequently than expected under randomness. This produces fewer overall runs and yields a negative Z-score.
### Randomness
Randomness refers to the *ordering* of directional outcomes, not the overall trend vector. Prices can trend strongly while still exhibiting random directional sequencing. Trend direction and sequential randomness are separate price properties. Price may trend upward while directional changes remain statistically random. Z-scores near zero indicate no detectable departure from random sequencing.
### Anti-Persistence
Anti-persistence occurs when directional states alternate more frequently than expected under randomness. This produces more runs than predicted by a random process and results in a positive Z-score.
### Partition Methods
The indicator offers two distinct classification models:
**Zero-Split:** Partitions observations around zero. This mode preserves directional bias and trend influence, measuring randomness while retaining directional drift. Useful when directional bias is core to the analysis.
**Median-Split:** Partitions observations around the rolling median. This removes directional imbalance from the classification process, isolating sequencing behavior from the overarching trend direction.
Comparing both modes helps distinguish persistence arising from directional drift from persistence arising from the sequencing structure itself.
---
## Z-Score Interpretation
| Zone | Z-Score | Structural Interpretation |
🟦 **Strong Persistence** | Z ≤ −1.96 | Sequential changes tend to persist (+/+ or −/−) rather than alternate.
🔵 **Mild Persistence** | −1.96 < Z ≤ −1.0 | Increasing evidence of continuations in sequential price changes.
⬜ **Random-Like** | −1.0 < Z ≤ 1.0 | No detectable sequential structure; outcomes occur with similar frequency.
🟨 **Mild Anti-Persistence** | 1.0 < Z < 1.96 | Increasing evidence of alternations (+/− or −/+) in price changes.
🟧 **Strong Anti-Persistence** | Z ≥ 1.96 | Sequential changes alternate (+/− or −/+) rather than persist.
Color Legend: Dark Blue = Strong Persistence, Light Blue = Mild Persistence, Gray = Random-Like, Light Orange = Mild Anti-Persistence, Dark Orange = Strong Anti-Persistence.
**Statistical Note:** The ±1.96 thresholds correspond to the conventional 5% two-tailed significance level. Values beyond these thresholds indicate statistically significant departures from randomness under the assumptions of the Runs Test. Intermediate zones represent varying degrees of structural evidence but should be interpreted as descriptive rather than formally significant.
---
## Empirical Validation
Validation was conducted using approximately 150,000 daily observations across 50 liquid U.S. equities, ETFs, and sector funds spanning roughly ten years of market history. Lookback periods of 20, 30, and 40 bars were evaluated. Results confirmed that runs-based measurements reliably isolate structural shifts in sequential price behavior.
The study demonstrated:
* Correct regime ordering across all 50 tested securities.
* Stable structural readings that persist beyond short-term noise.
* Consistent behavior across multiple lookback settings.
* Strong correspondence with serial dependence metrics.
*Essentially no correlation with Efficiency Ratio (Kaufman) measurements.**
This final finding strongly suggests that sequential randomness and trend efficiency measure distinct price sequence properties. Price changes can exhibit highly efficient directional travel while still displaying random sequencing, or vice versa. This makes the Runs Test Z-Score a valuable complementary tool rather than a duplicate of existing efficiency or momentum indicators.
---
## How To Use It
**Contextualizing Chart Patterns:** Continuation patterns (flags, channels) implicitly assume a persistent environment. Reversal patterns (double tops and exhaustion structures) are often associated with a breakdown in persistent directional movement, making alternating price changes more likely than continued runs in the same direction. Use the Z-score to determine if the price sequence structure statistically supports the pattern type forming on your chart. When the Runs Test indicates randomness, apparent technical patterns should be interpreted with caution, since their formation may be attributable to chance rather than persistent price behavior.
**Selecting Lookback Periods:** Shorter lookbacks increase responsiveness to structural change but are more sensitive to sampling variability. Longer lookbacks improve stability by filtering short-term noise and highlighting broader regime behavior.
**Applying Partitions:** Monitor the gap between Zero-Split and Median-Split. If Zero-Split shows strong persistence but Median-Split looks random, the non-randomness is entirely driven by directional drift (the trend), not the underlying sequencing mechanics.
**EMA Smoothing:** The optional EMA smoothing layer serves as a visual aid, improving interpretability and helping users track the indicator's underlying trend. Statistical interpretation should always remain anchored to the raw Z-score levels.
---
## Disclaimers & Limitations
This indicator is a descriptive statistical measurement tool, not a predictive trading system. The Runs Test Z-Score evaluates historical directional sequencing and does not forecast future price behavior. Persistent, random, or alternating conditions observed in the past do not guarantee the continuation of those regimes. It should be utilized as contextual analysis alongside proper risk management protocols. Indicator
