Volatility Cone & Analog Path ProjectionVolatility Cone & Analog Path Projection — Forward Price Envelope with Fractal Replay and Terminal Probability Distribution
Overview
Nearly every overlay on PulseWire describes the past: where price has been, where volume traded, where structure broke. This tool points in the other direction. It builds a forward projection zone from the current bar using three independent layers — a realized-volatility cone, a replay of the historically most similar price fractals, and a terminal probability profile that combines both into a distribution of possible outcomes at the projection horizon.
The result is not a forecast. It is a bounded expectation: a visual answer to "given how this instrument has actually been moving, what range is normal over the next N bars, and where has price historically ended up after conditions that looked like this?"
Conceptual Framework
Price uncertainty grows with the square root of time, not linearly. A 24-bar projection is not 24 times as wide as a 1-bar projection — it is roughly 4.9 times as wide. Traders who size targets and stops on a straight-line mental model consistently misjudge what is achievable in a given number of bars.
The cone makes that curvature visible. Its width at each future bar is sigma * sqrt(t), where sigma is the standard deviation of log returns over the volatility window. Three nested bands are drawn, so you can immediately see which targets sit inside the ordinary range, which sit at the statistical edge, and which would require an exceptional move.
The Gaussian model alone, however, is a poor description of real markets: returns have fat tails, and volatility clusters. The analog layer addresses this by ignoring models entirely and asking an empirical question instead — what actually happened, historically, after the market printed this exact shape?
How It Works
Volatility estimation. Log returns are computed bar to bar. Their standard deviation over the volatility window gives the per-bar sigma; their mean gives the drift. Drift can be included or excluded from the cone's centerline.
Cone construction. For each future bar t from 1 to the horizon, the upper and lower bounds are close * exp(drift*t ± k*sigma*sqrt(t)) for each of the three band multipliers. Each band is rendered as a closed polygon with layered transparency, producing depth from the centerline outward.
Fingerprint extraction. The most recent N bars of log returns are z-scored — mean removed, divided by their own standard deviation. This makes the pattern scale-invariant: the same shape is recognised whether it happened during a quiet range or a volatile expansion, and at any price level.
Historical scan. Every candidate window inside the scan depth is z-scored the same way and compared to the current fingerprint by summed squared difference. Lower distance means a closer shape match. Candidates that overlap an already-selected match without improving on it are rejected, so the top results are not five copies of the same event shifted by one bar.
Forward replay. For each of the top matches, the bars that followed it are converted into a relative path and re-anchored to the current close. The path each analog is drawing forward is exactly the move that occurred after that historical fingerprint — nothing is fitted or optimised. Paths ending above the current price are drawn bullish, below bearish, and a thick median line traces the bar-by-bar median across all analogs.
Terminal probability profile. At the projection horizon a horizontal distribution is built across the cone's full range. Each row's density blends the Gaussian probability implied by the volatility model with an empirical kernel centred on each analog's endpoint. The Model Weight input controls that mix: 1.0 is purely theoretical, 0.0 is purely historical, and the default sits between them. The widest row — the mode of the blended distribution — is marked as the most probable zone.
Interpretation
Cone bands define what is statistically ordinary. A target beyond the outer band within the horizon is not impossible, it is simply rare — treat it accordingly when planning holding time.
Cone width itself is information. A narrow cone means compressed volatility, which historically resolves into expansion. A wide cone means the market is already moving; chasing inside it carries a worse risk profile.
Analog dispersion matters more than analog direction. Five paths that fan out in all directions means the current shape carried no historical edge. Five paths clustering in one direction is the meaningful configuration.
Best Match Quality in the panel scores how closely the nearest historical fingerprint resembles the present one. Below roughly 60%, treat the analog layer as noise and rely on the cone alone.
The most probable zone is where the blended distribution peaks. It is a magnet-style reference, not a target — the distribution is wide by construction.
Volatility Regime compares short-window volatility to the full window. Expanding means the cone is likely to understate near-term movement; contracting means the opposite.
Settings
Setting Effect
Projection Horizon Bars projected forward. Also the endpoint of the profile
Volatility Window Sample size for sigma and drift. Longer = smoother, slower to adapt
Include Drift Tilts the cone with the window's mean return
Inner / Mid / Outer Band Sigma multipliers for the three layers
Fingerprint Length Bars compared for similarity. Shorter = more matches, less specific
Scan Depth How far back to search for analogs
Number of Analogs How many historical paths to replay
Profile Rows / Width Resolution and horizontal size of the terminal distribution
Model Weight Gaussian versus empirical blend in the distribution
Redraw on Bar Close Only Recommended on. The scan is heavy; this runs it once per bar
Limitations — read this
This is not a prediction and must not be traded as one. The cone describes a statistical range under an assumption of stable volatility. Real volatility is not stable, and returns have fatter tails than the Gaussian model implies, so moves outside the outer band occur more often than the model suggests.
Analog matching is weak evidence. A few dozen bars of shape similarity is a small sample; markets are non-stationary and a pattern that resolved one way in the past carries no obligation to repeat. The paths are historical context, not a probability statement about the future.
Nothing repaints, but the whole projection is recomputed each bar. Yesterday's cone is not preserved — the drawing always reflects current data only. It is anchored to the last bar by design.
On low-volume, illiquid, or heavily gapped instruments the return distribution is distorted and both layers degrade.
No entries, no stops, no targets, no signals. This is a context tool for sizing expectations and holding time. Indicator

EdgeStatsLibrary "EdgeStats"
A win rate on its own is not evidence. This library supplies the four things that turn one into a claim you can defend, none of which Pine ships: a base rate to subtract, a sample size corrected for overlapping forward windows, a confidence interval that behaves at small n, and a p-value that knows how many settings you tried before you picked this one.
The argument in three lines, all from the same 60 wins out of 100:
assess(60, 100, 0.5, horizon = 1) p = 0.046 significant
assess(60, 100, 0.5, horizon = 10) p = 0.527 not significant
assess(60, 100, 0.5, horizon = 10, trials = 30) p = 1.000 nothing at all
Nothing changed about the data. What changed is being honest that ten-bar forward returns sampled every bar are not a hundred independent observations, and that the best of thirty settings is not the same evidence as the only setting you tried.
WHAT THE DEMO SHOWS
Added to a chart directly, the library grades an ordinary signal: close above a 50 EMA, judged on whether price is higher ten bars later, over the last 500 bars. On BTCUSD 1h at the time of writing that is a hit rate of 39.9% against a base rate of 50.4%, an edge of -10.5 percentage points, and a two-sided p of 0.297.
Read that carefully, because it is the whole point. The signal looks bad. It is not reliably bad. Twenty-five independent observations cannot separate -10.5 points from noise, and the interval runs from 23.3% to 59.3%. A tool that says "I cannot tell" when it cannot tell is the only kind worth having.
THREE HONEST CAVEATS
n / horizon is a rough correction, not a theorem. It assumes overlap is the dominant source of dependence between observations. Where returns are autocorrelated beyond the window it is still optimistic. Treat it as a floor on your uncertainty rather than a ceiling.
zFor bisects normCdf, which is itself an approximation, so it inherits that error: zFor(0.95) lands about 1.2e-6 below the textbook 1.9599640. Irrelevant in practice, but it is an approximation of an approximation and you should hear that from me rather than discover it.
roll() uses ta.cum internally, so its call site must execute on every bar. Called inside "if barstate.islast" it has one bar of history and returns nonsense, and no max_bars_back setting repairs that. This is a property of Pine functions rather than of this library, and it is worth knowing generally.
VERIFICATION
Every fixed-input value is plotted to the Data Window and two are printed on the chart, so you can check the arithmetic rather than trust it. Against Python statistics.NormalDist:
normCdf(1.96) 0.9750022 true 0.9750021
normCdf(-1.0) 0.1586553
zFor(0.95) 1.9599628 true 1.9599640
zFor(0.99) 2.5758313 true 2.5758293
wilson(60, 100, 1.96)
selectionAdjusted(0.05, 30) 0.7853612
Corrections welcome, particularly to the effective sample size treatment, which is the part I would most like to be wrong about.
REFERENCE
normCdf(x)
Standard normal cumulative distribution. Abramowitz and Stegun 26.2.17, absolute error below 7.5e-8 across the whole real line.
Parameters:
x (float) : Value to evaluate.
Returns: Probability that a standard normal variate is at most x.
zFor(conf)
Two-sided z multiplier for a confidence level. Bisects normCdf, so any level works rather than a lookup of the usual three.
Parameters:
conf (float) : Confidence level in (0, 1). 0.95 returns 1.9599628.
Returns: The z for which the central interval of that width has the given coverage.
@remark Converged to float precision against normCdf, which is itself an approximation, so the result inherits its error: zFor(0.95) lands about 1.2e-6 below the textbook 1.9599640. Irrelevant for anything you would do with it, but it is an approximation of an approximation and worth saying so.
nEff(n, horizon)
Effective independent sample size when observations use overlapping forward windows.
Parameters:
n (float) : Raw observation count.
horizon (int) : Length in bars of the forward window each observation measures.
Returns: n divided by the horizon, with the horizon floored at 1.
wilson(hits, n, z)
Wilson score interval for a proportion. Unlike the normal approximation it stays inside and stays sane when n is small or the rate sits near an edge.
Parameters:
hits (float) : Successful observations.
n (float) : Total observations. Pass an effective count here, not a raw bar count, when the windows overlap.
z (float) : Multiplier from zFor().
Returns: A tuple on the proportion, or when there is no sample.
selectionAdjusted(p, trials)
Sidak correction. If you searched k settings and reported the best one, the p-value you found is not the p-value that best one deserves.
Parameters:
p (float) : Uncorrected two-sided p-value.
trials (int) : Settings, symbols or variants searched before this one was chosen. Pass 1 if you did not search.
Returns: Probability of seeing something at least this good in k independent tries.
roll(src, len)
Rolling window sum valid from the first bar, unlike math.sum which stays na until the window fills. Useful for counting events over a lookback.
Parameters:
src (float) : Series to accumulate.
len (simple int) : Window length in bars.
Returns: Sum of the last len values of src.
@remark Uses ta.cum internally, so the CALL SITE must execute on every bar. Called inside `if barstate.islast` it has one bar of history and returns nonsense. That is a property of Pine functions rather than of this library, and no max_bars_back setting repairs it. len is `simple` so Pine can size the history buffer at compile time.
assess(hits, n, base, horizon, conf, trials)
The whole assessment in one call.
Parameters:
hits (float) : Observations where the signal was right.
n (float) : Total observations.
base (float) : Rate at which the same outcome occurred unconditionally over the same horizon. This is the number that makes an edge an edge.
horizon (int) : Bars in the forward window. Overlapping windows shrink the effective sample.
conf (float) : Confidence level for the interval, default 0.95.
trials (int) : Settings searched before choosing this one, default 1.
Returns: A Verdict.
describe(v)
One line of plain English for a Verdict, sized to drop straight into a table cell.
Parameters:
v (Verdict) : The Verdict to describe.
Returns: A human-readable summary, or "no sample" when there is nothing to say.
Verdict
Everything needed to decide whether a measured hit rate means anything.
Fields:
rate (series float) : Observed hit rate, 0 to 1.
base (series float) : Base rate the signal is measured against, 0 to 1.
edge (series float) : rate minus base, in percentage points.
n (series float) : Raw observation count as supplied.
nEff (series float) : Observation count after the overlapping-window correction.
lo (series float) : Lower confidence bound on rate, computed on nEff.
hi (series float) : Upper confidence bound on rate, computed on nEff.
z (series float) : Test statistic of rate against base.
p (series float) : Two-sided p-value, already Sidak-adjusted for the trials argument.
clears (series bool) : True when the interval on the rate excludes the base rate. Library

Liquidity Draw Probability Map [ForexCracked]🔵 OVERVIEW
Every liquidity tool draws the pools. This one measures whether price actually goes there.
The Liquidity Draw Probability Map finds the resting liquidity on your chart, equal highs and lows, the prior day high and low, the prior week high and low, and the session extremes, then studies your chart's own history and prints what actually happened to pools like each one: how often price reached them, how long it took, and how often the touch rejected versus cut straight through.
The phrase "price is drawing on liquidity" gets said a thousand times a day. This script puts a measured number on it.
🔵 HOW THE MEASUREMENT WORKS
Every pool is filed by two things: its type, and how far from price it was born, measured in ATR units so the numbers transfer across symbols and timeframes.
For each combination the script keeps running counts on your chart's own history:
• How many pools like this were created
• How many were reached within 50 bars
• Of the touches, how many rejected (price closed at least 1 ATR back inside within 20 bars) and how many cut through (price closed at least 0.5 ATR beyond). A touch that does neither within the window is filed as a stall.
• The median number of bars it took to get there
Nothing is estimated and nothing comes from outside data. Every figure is a frequency counted on the chart in front of you, and the sample size is printed next to it, so a number built on 12 events never dresses up as a number built on 300.
🔵 THE MAP
Active pools draw as horizontal lines from the swing that created them. The line gets thicker and more solid as its category's measured reach frequency gets higher, so the levels price has historically honoured stand out and the ones it historically ignores fade back. Each pool carries a compact label: type, measured reach frequency, rejection share of touches, and the sample size behind those numbers.
When a pool is touched, a small circle prints on that bar to mark the purge (these are measurement events, not signals, and they can be switched off). The engine then watches the next 20 bars, classifies the outcome, adds it to the tables, and retires the pool. Purged liquidity leaves the map, exactly as it leaves the market.
🔵 WHAT THIS IS NOT
This script fires no signals. There are no buy or sell arrows, no sweep alerts dressed as entries, no order blocks and no fair value gaps. It does not tell you to trade anything. It is a measurement instrument: it maps where the resting liquidity is and reports what historically happened to liquidity like it, with the sample sizes in plain view. What you do with that context is your decision.
🔵 NET DRAW BIAS
Each active pool contributes its measured reach frequency, discounted by how far away it currently sits. Everything above price is summed against everything below, and the result is z-scored against its own recent history. A strongly positive reading means the statistically heavier magnet is overhead. A strongly negative one means it is below. The dashboard prints the score and the direction plainly.
🔵 THE DASHBOARD
• Nearest pool above: type, distance in ATR, measured reach frequency, median bars to reach, sample size
• Nearest pool below: the same
• Net Draw Bias: score and direction
• Last purge: which pool type was taken and how the touch resolved
• Sample: total pools logged and bars of history measured
🔵 HOW TO USE
• Treat high-frequency pools as context, not entries. A pool whose category was historically reached 75 percent of the time within 50 bars is a level price has tended to gravitate toward on this chart. Useful when planning targets, never a trigger on its own.
• Read the rejection versus cut-through split before assuming a reaction. Some categories on some charts get swept and keep going. The split tells you which kind of chart you are on.
• Use Net Draw Bias for directional context between levels. It answers "which side's liquidity is heavier right now" with a measured number instead of a feeling.
• Respect the sample sizes. Early in a chart's history the tables are thin and the map says so. The numbers firm up as history accumulates.
• Combine with your own structure and risk rules. This is a measurement instrument. It does not know your plan.
🔵 SETTINGS
• Pivot strength and equal-level tolerance control how pools are detected
• Reach horizon (default 50 bars) and outcome window (default 20) control the measurement windows
• Session input defines the session whose extremes are tracked, set it to your Asia hours for the classic use
• Max pool age retires stale levels; per-side caps keep the map readable
• Dashboard position, colors, and line extension are adjustable
🔵 ALERTS
• Price approaching a high-reach pool (within 0.25 ATR, category at or above 70 percent with a meaningful sample)
• Pool purged (liquidity taken)
• Net Draw Bias flips sign
⚠️ DISCLAIMER
These are descriptive statistics of past price behaviour on your chart, not predictions. A pool that was historically reached 80 percent of the time can be ignored today. Sample sizes vary by chart and timeframe, and small samples are unreliable by nature. Nothing here is a trade signal, and results depend on market conditions, settings, and your own execution and risk management. Shared for educational and research purposes. Not financial advice. Indicator

Reversal Trap Probability Bands [BigBeluga]🔵 OVERVIEW
The Reversal Trap Probability Bands is an advanced technical indicator created by BigBeluga to identify and trade fakeout traps around market extremes. Traditional envelope or band indicators often fail because traders blindly enter breakouts that quickly reverse into whipsaw losses. In order to provide a solution to this problem, this indicator combines volatility-based envelope channels with a dynamic probability tracking engine, measuring historical RSI buckets to calculate real-time win probabilities for reversal traps.
The indicator aims to visualize institutional exhaustion and subsequent mean-reversion expansions. The core element of its calculation involves tracking baseline moving averages alongside outer volatility bounds defined as:
upper_band = basis + (multiplier * vola)
lower_band = basis - (multiplier * vola)
where basis is an exponential moving average of length envelope_len , and vola is the ATR volatility measure scaled by multiplier . Higher values of envelope_len and multiplier allow the indicator to filter out routine market noise and isolate major structural exhaustion points.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Volatility Envelope & Basis Engine
envelope_len = input.int(55, "Envelope Smoothness") : Controls the responsiveness and smoothness of the central baseline.
upper_band & lower_band : Dynamic outer boundaries that shade gradient fills to visualize upper and lower market extremes.
2 — Reversal Trap Detection & RSI Probability Tracking
trap_window = input.int(10, "Trap Window (Candles)") : Defines the maximum candle count allowed outside the bands before invalidating a fakeout setup.
rsi_bucket = math.max(0, math.min(10, math.round(rsi / 10))) : Automatically categorizes momentum into distinct RSI tiers to calculate real-time win probability rates.
3 — Dynamic Target, Stop, & Signal Management
Bull_Stop = ta.lowest(low, 2) - atr & Bear_Stop = ta.highest(high, 2) + atr : Calculates volatility-adjusted safety padding for active trade management.
Signal Labels & Targets: Plots clear entry notifications displaying win probability percentages, along with dashed target and stop lines.
🔵 HOW TO USE
Apart from the basic visualization of volatility extremes, this tool can also act in alternative ways to support decision-making:
Identify Reversal Traps: Wait for price to break outside the upper or lower envelope boundaries and subsequently close back inside within the defined trap_window .
Evaluate Win Probability: Check the probability percentage displayed on the trap signal label (backed by historical RSI bucket tracking) before entering a trade.
Manage Risk with Stops and Targets: Use the projected dashed target lines (anchored to the basis line) and ATR-padded stop lines to execute and protect positions.
🔵 NOTES
Why this implementation is unique:
It moves beyond static band indicators by integrating a self-learning historical database that calculates live win probabilities based on momentum buckets.
The automated target and stop-loss line projection engine provides clear visual roadmaps for every triggered setup.
The script is fully optimized for Pine Script version 6, utilizing high-performance array tracking (`var int bull_total = array.new_int(11, 0)`) for smooth execution.
Note: Because the win probability engine evaluates historical trade performance dynamically in real time, initial signals on a freshly loaded chart may display "Tracking..." until sufficient sample data is recorded.
Indicator

Support Resistance AI [PickMyTrade]Every support/resistance tool answers "where are the levels." None answer the question a trader actually has when price arrives at one: does THIS test look like the ones that held, or like the ones that broke?
――――――――――――――――――――――――――――――――――――――
🔷 WHAT IT MEASURES
🔸 Confirmed swing pivots, clustered into zones and merged as new evidence accumulates
🔸 Eight properties of every ARRIVAL at a zone — approach speed, relative volume, prior test count, zone age, trend pressure, zone width, pivot count, and cumulative touches
🔸 A broken level isn't discarded — it flips role once (broken support becomes candidate resistance) and only a second failure retires it
🔸 A live Previous Day/Week High/Low reference map, shown only when price is within range
――――――――――――――――――――――――――――――――――――――
🔷 THE CLASSIFIER
🔸 An online Gaussian Naive Bayes model, trained continuously as tests resolve — no repainting, no lookahead
🔸 Nothing about a level's price is used as a feature — only how price approached it
🔸 The classic claim that "a level tested repeatedly grows weaker" is measured on each chart's own history here, rather than assumed
🔸 Below a configurable warmup sample count, the script shows the chart's running hold rate instead and reads LEARNING — it never guesses early
――――――――――――――――――――――――――――――――――――――
🔷 SIGNALS AND DISPLAY
🔸 Zone boxes colored by role (support/resistance) and shaded by live conviction, with worded verdicts ("similar arrivals held X%") instead of a bare number
🔸 Rank-based visibility — only the nearest zones to current price are drawn, so old or distant levels never stretch the chart's scale
🔸 Test history ticks stamped inside each zone at the bar where its own tests resolved
🔸 An info table with Nearest Support/Resistance, model accuracy, and sample counts
🔸 3 alertconditions, worded as observations of what the classifier's reading — never as trade instructions
――――――――――――――――――――――――――――――――――――――
🔷 INPUTS
Pivot Left/Right Bars — swing detection window. Default 10/10.
Zone Width / Merge Distance — band thickness and clustering tolerance, in ATR. Default 0.5 / 0.75.
Break Buffer / Rejection Distance — how far price must close beyond or travel back from a zone to resolve a test. Default 0.25 / 0.75 ATR.
Post-Flip Cooldown — bars a flipped zone must survive before a break can retire it. Default 5.
Warmup Samples — resolved tests required before the classifier is trusted. Default 25.
Conviction Threshold — probability at which a zone is shown at full conviction. Default 0.62.
Max Live Zones / Show Distance — how many nearby zones are drawn and how far (in ATR) before one is hidden.
Show Trend EMA, Zen Mode — display toggles; Zen Mode hides labels and the table for clean screenshots.
――――――――――――――――――――――――――――――――――――――
🔷 REQUIREMENTS AND LIMITATIONS
🔸 Pivots confirm only after the right-side lookback bars close — a level appears on the chart later than the swing that created it, by design
🔸 One thing does refine retroactively: when a later pivot merges into an existing zone, its band re-centers toward the weighted average — a zone with an open test is never re-centered, so no in-progress outcome is affected
🔸 Early on a fresh chart, or for a zone with only one or two tests, its own read is thin — the model's overall sample count travels with every verdict so that's never hidden
🔸 This script reports how historical arrivals resolved. It does not predict, and it is not a trading system on its own.
――――――――――――――――――――――――――――――――――――――
Built in Pine Script v6. Open source — Mozilla Public License 2.0. Indicator

NeuPortal Empirical Range - measured bands, honest sample sizeMost volatility bands are drawn the same way: per-bar sigma times the square root of the horizon. That rule assumes returns are independent draws from one fixed distribution. Crypto returns are neither — volatility clusters, tails are fat at short horizons, and the shape of the distribution changes as the horizon grows.
This script measures instead, and draws the assumption next to the measurement so you can see the gap on your own symbol.
An example of why that matters. On BTCUSDT 4h with a 24-bar horizon, the empirical band comes out 0.95x the textbook one — slightly narrower. But at 48 bars the measured width is 1.70x the 24-bar width where root-t predicts 1.41x, and at 72 bars it is 2.03x against a predicted 1.73x. The formula is roughly right at one horizon and badly wrong at another, on the same symbol. On ETHUSDT the pattern is the opposite. You cannot know which case you are in without measuring.
WHAT IT PLOTS
- core 50% zone: the interquartile range of how this market has actually moved over your horizon
- wide 80% band: the 10th to 90th percentile, as risk context
- median of the measured distribution
- the textbook sigma x root-t band, for contrast
The band is drawn FLAT on purpose. It describes one moment in the future, not a path to it. A diagonal would be a claim about the route, and this makes no claim about the route.
WHAT IT DOES THAT OTHER BANDS DO NOT
Conditional bands. An unconditional band averages today's market with every regime the symbol has ever been in. Switch conditioning on and only windows whose starting volatility resembled today's are counted. The table shows how many windows survived, because a conditional band on 20 windows is worse than an unconditional one on 500.
Touch versus close probability. Type a price and get two numbers: the share of historical windows that FINISHED beyond it, and the share that TOUCHED it at any point on the way. These differ a lot. If you are asking whether a stop gets hit, the second number is the answer and the first is misleading. Both come from actual highs and lows of real windows, not from a closed-form approximation.
The honest sample size. Overlapping windows flatter a sample: 3,000 rolling 24-bar returns come from 125 genuinely independent windows, and quantile standard errors scale with the second number. Both are printed, and the small one is flagged when it gets thin.
Out-of-sample coverage. The band is fitted on the older part of the chart and tested on the newer part it never saw. Target 50% for the core, 80% for the wide. Both directions are marked as failures: a band that contains everything is not skill, and that is the failure mode that flatters the author. On some symbols this script will tell you its own band is too wide. That is the point.
Multi-horizon widths at 1x, 2x and 3x your horizon with the observed ratio against root-t's prediction, plus skew and excess kurtosis so you can see how far from Gaussian this symbol is at this horizon.
Alerts fire when price leaves the zone that was supposed to hold it half the time.
HOW TO USE IT
Set the horizon in bars — it means whatever your timeframe means. 24 bars on 1H is a day, 30 bars on 1D is a month. Give it as much history as the chart has. Then read the independent window count before you read anything else.
Works on any symbol and any timeframe. Nothing is hard-coded to a particular market.
WHAT IT DOES NOT DO
It says nothing about direction. There is no signal here and no entry. It is a description of uncertainty, measured rather than assumed.
Educational content - not financial advice. Indicator

NeuPortal Forecast - sealed distributions not pathsDraws a forecast as a DISTRIBUTION at a stated horizon, never as a path.
What it plots, from values you enter yourself:
- median for the horizon
- core 50% zone (25th to 75th percentile of the asset's own historical moves over the same horizon)
- wide 80% band (10th to 90th percentile)
- the seal: a vertical line at the bar the forecast was fixed on, so left of it is observed and right of it was unknown
- an explicit invalidation level
- a computed daily read (ADX, DI, RSI, MACD, %B, EMA structure, ATR) taken from the chart itself, so the table cannot drift from the price it sits on
There is deliberately no diagonal anywhere. A line drawn from today's price to a future price is read as a claimed route, and a distribution at a horizon is not a route. The size of the expected move is stated as a vertical dimension bracket instead.
Two ways to feed it. Fill the inputs by hand, or paste a single line into "Today's line" in the first settings group, in the form key=value;key=value - useful if you generate forecasts programmatically and do not want to retype twenty fields daily. Pasted values win, missing ones fall back to the manual inputs.
Free, open source, no gating, no signals, no DMs.
Educational content - not financial advice. Indicator

NeuPortal - Forecast: sealed distributions, not pathsDraws a forecast as a DISTRIBUTION at a stated horizon, never as a path.
What it plots, from values you enter yourself:
- median for the horizon
- core 50% zone (25th to 75th percentile of the asset's own historical moves over the same horizon)
- wide 80% band (10th to 90th percentile)
- the seal: a vertical line at the bar the forecast was fixed on, so left of it is observed and right of it was unknown
- an explicit invalidation level
- a computed daily read (ADX, DI, RSI, MACD, %B, EMA structure, ATR) taken from the chart itself, so the table cannot drift from the price it sits on
There is deliberately no diagonal anywhere. A line drawn from today's price to a future price is read as a claimed route, and a distribution at a horizon is not a route. The size of the expected move is stated as a vertical dimension bracket instead.
Two ways to feed it. Fill the inputs by hand, or paste a single line into "Today's line" in the first settings group, in the form key=value;key=value - useful if you generate forecasts programmatically and do not want to retype twenty fields daily. Pasted values win, missing ones fall back to the manual inputs.
Free, open source, no gating, no signals, no DMs.
Educational content - not financial advice. Indicator

NeuPortal - Forecast: sealed distributions, not pathsDraws a forecast as a DISTRIBUTION at a stated horizon, never as a path.
What it plots, from values you enter yourself:
— median for the horizon
— core 50% zone (25th–75th percentile of the asset's own historical moves over the same horizon)
— wide 80% band (10th–90th percentile)
— the seal: a vertical line at the bar the forecast was fixed on, so left of it is observed and right of it was unknown
— an explicit invalidation level
— a computed daily read (ADX, DI, RSI, MACD, %B, EMA structure, ATR) taken from the chart itself, so the table cannot drift from the price it sits on
There is deliberately no diagonal anywhere. A line drawn from today's price to a future price is read as a claimed route, and a distribution at a horizon is not a route. The size of the expected move is stated as a vertical dimension bracket instead.
Free, open source, no gating, no signals, no DMs.
Educational content — not financial advice. Indicator

NeuPortal - Forecast LevelsDraws a pre-computed probabilistic price forecast on the chart: a core-50% / 80% cone projected forward, the median path, an entry zone, an invalidation level, two reference levels, Fibonacci retracements, support/resistance and three EMAs.
This is a RENDERER, not a signal generator. You paste the numbers — produced by your own model or by hand — into the settings, and the script draws them consistently. Nothing is computed from price except the moving averages.
Why it is built this way: a forecast written down with an explicit invalidation and a stated probability band can be scored afterwards. A drawing without those cannot.
Inputs are grouped:
1) Forecast — central (median), core 50% band, wide 80% band, projection length
2) Position — bias (long / short / neutral), entry zone, invalidation, two reference levels
3) Structure — support, resistance, five Fibonacci retracements
4) Moving averages — three EMAs, bundled in to save an indicator slot
Educational content — not financial advice. Indicator

Structural Language ModelOverview
Structural Language Model treats price action as a language. Each bar is tokenised into one of five structural symbols, and a low-order Markov model learns the grammar — the probability of what comes next given the recent context. Instead of "match the nearest historical shape" (fragile, overfit-prone k-NN), it estimates P(next token | last k tokens): a nonparametric conditional-move model that proves or disproves itself, live, on your symbol. It is a research/forecast read, not a signal service.
The five-symbol grammar
Every bar becomes one token, built from robust intrabar primitives (gap-immune, no fragile sweep/FVG detection), with adaptive thresholds so the alphabet stays balanced across symbols and timeframes:
X− down impulse · d ordinary down · c compression / indecision · u ordinary up · X+ up impulse
The model then learns grammar like c → X+ (breakout), X+ → X− (reversal), runs of u/X+ (trend), X+ → c (exhaustion), using order-1 or order-2 transition counts with Laplace smoothing, updated online.
Why these parts are one tool
The tokeniser turns raw OHLC into a balanced, information-rich alphabet — without it the Markov counts are dominated by whatever token is most common.
The Markov model reads out, each bar, a directional bias (P up-ish − P down-ish), a predictability score (how peaked the next-token distribution is, via normalized entropy), a structural-surprise spike (−log P of the token that just printed — a grammar break), and the full next-bar probability ladder.
The harness is the part that makes it honest. It's prequential (predict-then-update: each transition is scored from counts that exclude its own outcome, so every score is out-of-sample), it runs a walk-forward in-sample vs out-of-sample split with Wilson 95% intervals, and it draws a reliability curve — binning OOS predictions by predicted P(up) and showing the realized up-rate per bin. A rising, significant curve = real calibrated information; a flat one = none. Remove any part and you can no longer answer "is this model actually calibrated on this market?"
How to use it
Read the directional bias line against its conviction bands as context, not a trigger, and check predictability for how peaked the forecast is. Then read the harness — the model is only worth trusting where the out-of-sample up-lean lift is above 1 and/or the reliability spread is positive and significant (✓sig). A flat or insignificant curve means there's no calibrated edge here; treat it as descriptive only, or try another symbol/timeframe. The dashboard has a Compact layout (default: forecast + the one calibration line that matters) and a Pro layout (the full ladder, in/out-of-sample lift, and the three-bin reliability curve). Bias-turn crosses are optionally mirrored on the price chart. It is never a standalone signal.
Non-repainting
Tokens and counts update only on confirmed bars, and the score for bar t uses counts as they stood before bar t's transition was added — nothing reads its own future. The live next-bar forecast naturally refines as the current bar forms (it's a forecast, not a settled statistic). All harness figures are out-of-sample by construction.
Honest limits
OHLCV only. A per-bar tokeniser maximises samples but is coarser than a swing/event grammar (a documented future extension). Any edge is typically modest and market/timeframe-dependent — directional forecasting on noisy price is hard, and no indicator has an inherent edge. That's exactly why the harness is built in: validate it before trusting it.
Outputs for other scripts
Generic EXP_* plots — bias, predictability, structural surprise, live P(next up-ish), and the OOS lift — are published to the Data Window for use from other scripts via input.source().
Concept credits
Markov chains / n-gram language models — A. Markov (1913); C. Shannon (1948)
Prequential (predict-then-update) evaluation — A. P. Dawid (1984)
Additive (Laplace) smoothing — P.-S. Laplace
Entropy — C. Shannon (1948)
Wilson score interval — E. B. Wilson (1927)
Synthesis and Pine implementation are the author's own; no third-party Pine code reused.
Disclaimer
Research and education only. Not financial advice, not a signal service, not a guarantee of future results. Validate with your own testing, apply realistic costs, and manage risk. Indicator

Event Probability Engine [Quantum Algo]Event Probability Engine
====================================================
🔶 OVERVIEW
Event Probability Engine is a statistical probability indicator that answers one question at the close of every bar: based on the measurable conditions active right now, what is the historical probability that price closes higher one, three, and five days from today? Instead of subjective pattern reading, the script builds and maintains a live rolling database of forward returns conditioned on eighteen observable market events — day-of-week seasonality, oversold and overbought readings, volume spikes, streaks, range position, volatility regime, pivot touches, and an optional lunar control — then pools the currently active events into a single composite probability, displayed as a TODAY headline, a full per-event statistics table, and a shaded forecast cone projected on the chart.
It is designed for the daily timeframe. On other timeframes, the one, three, and five day horizons become one, three, and five bars.
🔶 WHAT IS AN EVENT STUDY?
An event study measures what a market historically did after a defined, observable condition occurred — for example, what happened over the next five days every time the Relative Strength Index closed oversold, or every Monday, or every time volume spiked two standard deviations above normal. This indicator runs eighteen such studies continuously, in real time, on the chart's own data, and keeps every study honest with the statistical safeguards described below.
🔶 WHY THIS SCRIPT IS ORIGINAL
1. A live event database in Pine. Each of the eighteen events maintains its own rolling, capped sample of forward returns at three horizons, tagged with the market regime at the moment the event fired — a self-updating event-study framework, not a fixed backtest.
2. Shrinkage estimation. Every win rate is pulled toward fifty percent by a configurable number of pseudo-samples. An event with fifteen samples cannot display an extreme probability, because fifteen samples cannot justify one.
3. Overlap correction. State-based events (for example, an oversold reading persisting for a week) generate autocorrelated, overlapping samples that inflate apparent sample size. The effective sample size is deflated by the horizon length before any confidence calculation.
4. Wilson score bounds. Next to each five-day win rate, the table shows the Wilson confidence lower bound computed on the corrected sample size — the number an event must clear before its edge deserves trust, not its raw point estimate.
5. Regime conditioning with fallback. When enough samples exist in the current regime (bull or bear, defined by the two-hundred period exponential moving average), statistics are computed on regime-matched samples only, marked ® in the table. A bear-market Thursday is not assumed to behave like a bull-market Thursday.
6. Quality-weighted log-odds pooling. Active events are combined by weighted log-odds — a method related to Bayesian evidence combination — rather than naive win-rate averaging, so one strong, well-sampled edge is not diluted by three weak ones.
7. A built-in falsification control. Lunar phase events are included deliberately so the engine can audit a popular claim empirically: if full and new moons carry no edge, their quality scores sit near zero and they contribute nothing to the composite. A probability framework should be able to demonstrate which inputs fail, not only which appear to work.
🔶 HOW IT WORKS
Event detection: On every bar close the script evaluates all eighteen conditions — Monday through Friday, adaptive or fixed oversold and overbought thresholds, volume z-score spikes, up and down streaks, range-low and range-high position, volatility expansion and compression by percentile rank, confirmed pivot support and resistance touches within an Average True Range distance, and the optional lunar events.
Database recording: Whenever an event was active one, three, or five bars ago, the realized forward return is stored in that event's arrays, first-in-first-out at a configurable cap, together with the regime tag from the moment the event fired.
Per-event statistics: The table reports, for every event, the shrinkage-adjusted win rate at each horizon, the Wilson lower bound, sample count, average forward return, profit factor, a zero-to-one-hundred quality score blending edge magnitude, sample sufficiency, and recent consistency, and the resulting directional bias.
Composite probability: Active events passing the minimum-sample filter are pooled by quality-weighted log-odds into the TODAY headline (next-day probability of an up close with a visual meter), the one, three, and five day composite row with expected returns and a strength grade, and a projected forecast path with a shaded plus-and-minus one standard deviation cone drawn from the current close.
Chart layer: Optional regime background tint, the regime line, live pivot support and resistance rails with prices, and historical event markers on the candles so past occurrences of every event can be reviewed directly on the chart.
🔶 HOW TO USE IT
1. Apply it to a daily chart of any liquid symbol — cryptocurrency, stocks, indices, forex, gold, futures. Let it load its history; sample counts grow with available bars.
2. Read the TODAY headline first: the next-day probability, the meter, and the expected one-day return.
3. Scan the table for the highlighted rows — those events are active right now. Judge each by its Wilson lower bound and quality score, not the raw win rate.
4. Use the composite row and forecast cone as context: STRONG requires both a meaningful probability distance from fifty percent and high average quality.
5. Treat readings near fifty percent as exactly what they are: weak evidence. This engine is intentionally built to display small honest numbers rather than large misleading ones.
6. Combine with your own analysis — the engine measures conditional history; it does not know tomorrow's news.
🔶 SETTINGS
- Database: sample cap per event, minimum samples for composite inclusion, minimum regime-matched samples, shrinkage strength.
- Events: oscillator length and thresholds (fixed or adaptive percentile), volume z-score, streak length, range lookback, pivot lookback and touch distance, lunar events on or off.
- Statistics: Wilson z-score (default 1.645, a ninety percent one-sided bound).
- Display: dashboard position and five text sizes, forecast cone, regime tint, regime line, pivot rails, candle markers.
🔶 ALERTS
- Composite Bias Change — fires once per bar close whenever the five-day composite bias flips state, with the current one-day and five-day probabilities in the message.
🔶 FREQUENTLY ASKED QUESTIONS
Does the indicator repaint? Statistics are recorded and evaluated on closed bars, and pivot events use confirmed pivots with their standard confirmation lag. The dashboard and forecast update on the live bar by design, as a dashboard should.
Why do most probabilities sit near fifty percent? Because genuine conditional edges in daily data are small, and the shrinkage and overlap corrections are built to say so. Extreme displayed probabilities on thin samples are the signature of a dishonest tool.
What does the ® mark mean? That event currently has enough regime-matched samples, so its statistics are computed only from the current bull or bear regime rather than the full history.
Why are moon phases in a statistics tool? As a falsification control. The engine should be able to show which inputs carry no edge — and the user can watch it do exactly that.
Can I use it intraday? Yes, but the horizons become bars instead of days, and day-of-week events lose their meaning. The design intent is the daily timeframe.
🔶 CREDITS
This script stands on standard, publicly documented statistical methods, gratefully credited: the Wilson score interval by Edwin B. Wilson (1927), Laplace-style shrinkage estimation, and the event-study methodology long established in quantitative finance. Their combination into a live, regime-conditional, overlap-corrected event database with quality-weighted log-odds composite pooling, implemented entirely in Pine Script with capped arrays and user-defined types, is original work — no third-party or open-source script code was reused.
🔶 LIMITATIONS
Probabilities derived from historical conditioning are estimates, not guarantees, and conditional edges in daily data are typically small. Sample databases need history to mature; young charts produce thin, heavily shrunk statistics by design. Day-of-week events assume a five-day session calendar. Regime conditioning depends on the two-hundred period regime definition. This is a research and confluence tool, not a standalone trading system.
🔶 DISCLAIMER
This script is provided strictly for educational and informational purposes. It is not financial advice, an investment recommendation, or a solicitation to buy or sell any financial instrument. Past statistical behavior does not assure future results. Trading involves substantial risk. Always do your own research and manage risk independently. Indicator

Naked POC Magnetism Fill Probability & Median WaitNaked POC Magnetism — Fill Probability & Median Wait
What it is
A naked POC is the highest-volume price of a past session that price has not revisited since. Traders treat them as magnets — but "it usually gets filled" is folklore until it's measured. This tool measures it. Every historical naked level on your chart becomes a data point (how many sessions it survived before being touched, or whether it never was), and a survival model (discrete-hazard life table) turns that history into, for each live naked level: the probability it fills within the next N sessions and the median wait. Levels are drawn with their measured magnetism, not just their location.
How the statistics work — and their honest limits
Each session's volume-at-price profile is built from that session's bars; at session close the peak-volume price (POC) becomes a naked level.
A level is filled the first time a later bar's range touches it; its age in sessions at that moment is one observation. Levels removed unfilled (history cap) are censored at their age — counted as "survived this long," never as fills. This is the standard treatment of incomplete observations from survival analysis (Kaplan–Meier 1958; classical life tables).
Hazard at age j = fills at age j ÷ levels at risk at age j. Survival multiplies (1 − hazard) across ages; fill-probability within a horizon and the median wait follow directly.
Reliability gates, enforced not footnoted: no probability is displayed until a minimum number of levels have resolved (input, default 20) — until then the tool says BUILDING and shows only counts. And hazard estimates at ages with fewer than 5 at-risk observations are truncated rather than trusted, per standard life-table convention.
Probabilities are empirical frequencies from this symbol and timeframe's own history — they change with regime and sample, and a 70% is not a promise.
Seeing the evidence
Every historical fill prints a small ◈ marker where a naked level was touched — the resolved observations the probabilities are measured from, visible on the chart rather than hidden in a table.
The dashboard shows both the NEAREST level and the STRONGEST magnet (highest fill probability) — they are often not the same level, and the strongest one is the better answer to "where is price most drawn".
An honest design note: this tool deliberately has NO multi-timeframe stack and NO state-debounce, unlike its siblings in this suite — sessions are the model's clock regardless of chart timeframe (a higher-timeframe copy would measure the same sessions with coarser bins), and nothing here chatters (levels are born at session close and resolve on touch). Features are added where they inform, not everywhere.
How to use it
Add to a liquid intraday chart; 5m–15m gives the model the most sessions to learn from. Let it run until the dashboard reads MEASURED.
Each rail is labelled like "NPOC 24512 · 68% /5s · med 3s" — the measured chance it fills within the horizon and the median sessions historically needed. Warm, saturated rails = strong magnets; faded = weak or unrated.
The dashboard shows the nearest level's read and — deliberately — the sample size behind every number.
Use magnetism as context about where price is drawn (targets, fade zones, expectations management), never as an entry signal by itself.
What makes it original
Naked-POC indicators draw lines. This one attaches a measured fill-probability and expected wait to each line, estimated with a proper survival model that handles censoring and refuses to show numbers it can't support. Turning a folklore level into a level with a live, honest statistic is the contribution.
Concept credits
Market Profile / point of control — J. Peter Steidlmayer. Naked (virgin) POC — market-profile trading literature. Survival estimation from incomplete observations — E. L. Kaplan & P. Meier (1958); classical life-table method. Implementation and charting design are the author's own.
Important disclaimer
Research and education only. Not financial advice, not a signal service, not a guarantee of future results. Fill probabilities are empirical frequencies measured on this chart's limited history. Validate independently and manage your own risk. Indicator

Smart Ichimoku | GainzAlgoOverview
Most Ichimoku indicators give you the same signal everyone else gets, a raw cloud cross with no filter, no context, and no target. This indicator rethinks the system from the ground up by combining a smoothed Ichimoku cloud with an inline logistic regression classifier that scores every cloud break in real time, then projects statistically-derived price targets the moment a confirmed signal fires.
The result is a cleaner, higher conviction version of one of the most respected trend frameworks in technical analysis.
The Foundation: Why Smooth the Ichimoku?
Traditional Ichimoku uses simple high-low midpoints (Donchian midlines) for its Tenkan, Kijun, and Senkou components. This makes the cloud visually choppy and prone to false crosses on noisy, volatile instruments like crypto or high-beta equities.
This indicator replaces all three components with Hull Moving Averages (HMA), which are designed to be simultaneously smooth and responsive, reducing lag without the whipsaw of standard smoothing. The cloud body itself becomes cleaner, the baseline is less noisy, and the cross events that trigger signals are more structurally meaningful.
All default periods match classic Ichimoku settings (9 / 26 / 52 / 26 displacement) so the logic stays true to the original system, it's just rendered with better math underneath.
The Signal: Logistic Regression Cloud Break Classifier
Here's where this indicator separates itself. A cloud cross alone is not a signal, it's a candidate. What actually matters is whether the market conditions at the moment of the cross are consistent with a real, sustained breakout or breakdown.
The classifier answers that question with a probability score.
How it works
At the exact bar where price exits the cloud body, four normalized features are computed and fed into a logistic regression model:
1. RSI (centered at 50, scaled by 25)
Measures momentum. On a bearish break, is RSI already extended to the downside? On a bullish break, is it pointing up? RSI near 50 adds little conviction; RSI at 30 on a bear break adds a lot.
2. Stochastic Oscillator (centered at 50, scaled by 25)
Short-term overbought/oversold confirmation. Works similarly to RSI but captures faster-cycle momentum, giving the model a second read on the same question.
3. Z-Score (price vs 20-bar mean, normalized by standard deviation)
Measures how statistically extended price is relative to recent history. A cloud break accompanied by a Z-Score of -2 is much more meaningful than one at Z = -0.2. This feature effectively asks: "Is this break happening from an already-stretched position?"
4. Cloud Break Depth (normalized by ATR)
How far did price close through the cloud boundary, relative to recent volatility? A close that barely clips the edge is very different from one that punches through by a full ATR. This is the most direct measure of breakout conviction.
The Math
Each feature is multiplied by a weight and summed into a single score (z). That score is passed through the sigmoid function:
P = 1 / (1 + e^(-z))
This compresses the output to a probability between 0 and 1. If the probability clears the threshold (default 0.60), the break is confirmed and a signal fires. Below threshold, the cross is rejected — instead of being ignored, it's labeled with a risk tier so you can see exactly how close (or far) it came to confirming.
The probability score is displayed as a small percentage label directly on the signal bar so you always know how strong the classifier rated that particular break.
Self-Calibrating Weights — No Manual Tuning
Unlike a typical multi-feature model, none of the four weights are set by hand. Each one is derived automatically from that feature's own rolling correlation with next-bar returns, recalculated continuously over a user-set lookback window (the "Self-Calibration Window," default 100 bars).
In practice this means: if RSI has been a genuinely useful predictor of direction on this instrument and timeframe recently, its weight rises on its own. If Z-Score has been mostly noise in the current regime, its weight shrinks toward zero — automatically, without anyone touching a slider.
This was a deliberate design choice. Letting people hand-tune regression weights invites a lot of well-intentioned guesswork that usually overfits to a handful of recent candles. By having the model score its own features based on demonstrated, rolling predictive power, the classifier adapts to changing market conditions instead of running on opinions baked in at setup time.
Rejected Crosses: Risk-Tiered Labels
Not every cloud cross clears the threshold, and that's the point. Rather than silently discarding rejected crosses, this indicator labels every one of them with a risk tier so you know exactly what the model saw and how close it came to confirming:
Low Risk: Probability fell just short of the threshold (within 10 points below). A near-miss — the break had real conviction behind it, it simply didn't clear the bar.
Moderate Risk: Probability landed meaningfully below threshold (10–25 points). A weaker break with mixed signals underneath it.
High Risk: Probability came in far below threshold (25+ points). A break with little to no underlying conviction — most consistent with chop or noise.
Each label shows its tier and the actual probability (e.g. "Low Risk ▼ 54%"), so nothing is a black box. A cluster of Low/Moderate Risk labels in one zone often signals a contested area that's likely to resolve into a real breakout once it's worked through — useful context even though no trade signal fired. These labels can be toggled off entirely in settings if you'd rather only see confirmed signals.
The Targets: Mean, Median, Mode
Once a confirmed break fires, three dashed horizontal target lines project from the signal bar. These are not arbitrary multiples, they are derived from the actual statistical distribution of bar-to-bar price moves over the lookback window.
Mean (Yellow): The average absolute bar move over the lookback period, scaled by the target multiplier. This is the "expected" target under normal conditions.
Median (Cyan): The 50th percentile of historical moves. Because move distributions are right-skewed (a few large moves pull the mean up), the median is typically more conservative than the mean and often a more realistic first target.
Mode (Hot Pink): The most frequently occurring move size, derived by bucketing historical moves into ATR-width bins and finding the most populated bin. This represents what the market most commonly does — not what it averages, not the middle value, but the single most likely outcome based on observed frequency.
Together, the three targets give you a realistic range rather than a single arbitrary level — grounded in what this instrument has actually done over the recent past. Bull and bear target sets are tracked independently, so a new bearish break won't erase an active bullish target set still in play, and vice versa.
The Target Multiplier (default 3×) scales all three targets proportionally. Lower it for tighter, shorter-term targets; raise it for swing trades or higher-volatility instruments.
Reading the Chart
Green triangle (▲) below bar: Confirmed bullish cloud break. Price has exited the top of the cloud with sufficient classifier probability. Three upward target lines appear.
Pink triangle (▼) above bar: Confirmed bearish cloud break. Price has exited the bottom of the cloud with sufficient classifier probability. Three downward target lines appear.
Percentage label: The LR probability score for that break (e.g. "73%"). Higher is stronger.
Risk-tiered label (amber/orange/red): A cloud cross that was rejected, with its tier and probability shown.
Yellow dashed line: Mean target
Cyan dashed line: Median target
Hot pink dashed line: Mode target (thicker, as it represents the highest-frequency outcome)
Settings Guide
Smooth Ichimoku
Tenkan / Kijun / Senkou Period: Standard Ichimoku periods. Default 9/26/52 follows the classic system. Shorter periods = more sensitive, more signals. Longer = slower, fewer but stronger signals.
Displacement: How far forward the cloud is projected. Default 26.
Break Classifier
Self-Calibration Window: How many past bars the model uses to learn each feature's weight from its recent correlation with price moves. Shorter windows adapt faster to regime changes but can be noisier; longer windows are more stable but slower to react. Default 100.
Break Probability Threshold: The minimum probability required to confirm a signal. Default 0.60. Raise toward 0.75+ for fewer, higher-conviction signals. Lower toward 0.50 to see more cloud breaks confirmed (effectively turns the filter off at 0.50).
Targets
Lookback (bars): How many bars of historical move data to use for the distribution calculation. Default 60. Longer lookback = more stable targets based on longer-term behavior. Shorter = more reactive to recent volatility.
Target Multiplier: Scales all three target lines proportionally from the signal close. Default 3×. Adjust based on your timeframe and typical holding period.
Risk Labels
Show Risk Labels on Rejected Crosses: Toggles the Low/Moderate/High Risk labels on rejected cloud crosses. Off by default for a cleaner chart; turn on to see every cross the model evaluated, not just the confirmed ones.
How to Use It
As a trend confirmation tool: Use the cloud direction (cyan dominant = bullish structure, pink dominant = bearish) as your bias filter, and only trade signals that align with the cloud color. Bull signals below a cyan cloud, bear signals above a pink cloud.
As a breakout entry trigger: Wait for price to consolidate inside or near the cloud, then take the confirmed break as an entry signal. The probability label tells you how much conviction the model has at that moment.
Using rejected crosses as context: A string of Low Risk labels in a zone suggests the cloud is being tested seriously without quite breaking — often a precursor to a real move once the level finally gives.
For target setting: Use the median as a conservative first target, the mean as a mid-range objective, and the mode as a guide to where the most "normal" move tends to land. The hot pink mode line is often the most useful for setting realistic profit expectations.
For alerts — Four alert conditions are built in: "Confirmed Bull Break," "Confirmed Bear Break," "Rejected Bull Cross," and "Rejected Bear Cross." Set them on your preferred timeframe and let the classifier notify you rather than watching the chart.
Timeframe Notes
This indicator works across all timeframes but behaves differently depending on context:
1H–4H: Good balance of signal frequency and reliability. Recommended starting point.
Daily: Fewer signals, higher structural significance. Best for swing traders.
15m and below: More signals, more noise. Consider raising the threshold to 0.65–0.70 and reducing the lookback to 30. Watch the risk-tiered labels here in particular — they're most useful for filtering chop on fast timeframes.
Example on the Daily with SPY ETF:
Example on the 4 Hour with BTCUSD;
Example on the 15 Minute with QQQ:
A Note on the Model
The logistic regression here is not trained on historical data in the machine learning sense, and it no longer relies on manually-set weights either. Each feature's weight is derived from its own rolling correlation with subsequent price action, recalculated continuously. Think of it less as a black-box ML model and more as a structured, self-adjusting way to combine four momentum and positioning indicators into a single probability score, similar to our Directional Logistic Oscillator.
The advantage over a traditional multi-condition filter (RSI < 40 AND stoch < 30 AND...) is that the sigmoid function produces a continuous probability rather than a binary pass/fail, which means the model degrades gracefully, a break with three strong features and one neutral one still scores well, rather than getting blocked by an arbitrary threshold on the weak feature. And because every rejected cross is shown with its tier and score rather than discarded silently, nothing the model does is hidden from you.
We hope you enjoy! Indicator

Streaming ML Probability Triple-Barrier, Conformal & CalibratedStreaming-ML Probability — Triple-Barrier, Conformal & Calibrated
What it is
A self-training probability model that estimates P(up-barrier resolves before down-barrier) and — crucially — reports its own calibration. The differentiator is not the classifier; it is the labelling and the honesty layer wrapped around it. The pane shows a probability, an honest uncertainty band, a plain-language verdict, and a reliability diagram that tells you whether to believe any of it.
Why these components belong in ONE script (not a stack of indicators)
They are the stages of one honest prediction pipeline, each fixing a failure mode of a naive "ML" overlay:
Triple-barrier labels define what is predicted as a real, path-dependent outcome (which barrier is hit first) instead of an arbitrary "next bar up?", and resolve forward in time so training only ever sees confirmed results — no look-ahead.
Z-scored, bounded features keep every input finite so no single bar can blow up the online weights.
Logistic SGD + Lorentzian k-NN, fused in log-odds with a Kish decorrelation shrink — a linear model for the trend and a fat-tail-tolerant neighbour vote for non-linear structure, combined without double-counting the shared features.
Regime engine (efficiency + ADX + Hawkes) gives each market state its own calibration and shrinks the probability toward 0.5 where a regime is barely seen — the model defers to a coin flip where it has not learned.
Adaptive Conformal Inference turns the point estimate into a coverage-controlled band that holds under drift, so the uncertainty is honest rather than a fake point estimate.
Conviction + hard vetoes (regime, MTF, participation/CVD, calibration quality) stop the model acting on a number it cannot back up.
The calibration harness — reliability table, Brier score, and forward edge versus an unconditional base rate — is the whole point: a probability is only useful if 70% means 70%.
Labels say what to learn, features feed it, the fused classifier predicts, regime + conformal say how much to trust it, the vetoes gate it, and calibration proves whether any of it held. Remove a stage and the honesty breaks — that is why they ship as one engine.
How it works (mechanics)
Each confirmed bar opens a triple-barrier sample (unless the OU half-life says reversion is too slow to resolve in the horizon). When a sample resolves, the model takes one online gradient step on its own features and outcome, the resolved sample enters the k-NN memory, and the nonconformity score updates the conformal band via Gibbs-Candès ACI. The live probability is the log-odds fusion of the logistic output and the Lorentzian k-NN vote, regime-shrunk during warm-up. A directional signal fires only when the probability band clears the signal margin, conviction clears its floor, and no hard veto trips. Every resolved directional call is then scored against an unconditional same-horizon base rate (Hit% vs Base%, Wilson-bounded, regime- and recency-weighted).
Non-repaint: training only on resolved triple-barrier outcomes, signals on bar close, MTF requested with lookahead_off, no dynamic-length ta(). The live probability updates each bar — a current estimate from fixed historical training.
How to use
Read the VERDICT line first — ACT, STAND ASIDE (no calibrated edge), or WAIT, based on the live signal and the model's own calibration.
Check the reliability diagram / Brier. Points off the diagonal, or Brier ≥ 0.25 (worse than a coin flip), mean the probability is not trustworthy yet — the engine will tell you to stand aside.
A signal fires only on confluence: probability past the band-margin, conviction past the floor, no hard veto.
The conformal band is the honest uncertainty — a wide band means low confidence.
Everything here is descriptive, probabilistic context — never an instruction.
Note on honesty: on pure intraday noise (e.g. NIFTY 1-minute) this model will often show NO EDGE / VETO with Brier ≈ worse than a coin flip — and it says so plainly rather than inventing a signal. That is the intended behaviour.
Use on any market
The Data Source inputs (Close / High / Low / Volume) drive the features, the triple-barrier labels and the calibration, so the model runs on any series (standard candles, Heikin-Ashi, etc.) and any market. All thresholds are ATR-relative. Defaults are set for NIFTY index-futures intraday; change the source or lengths for other assets. Assets with no volume simply contribute nothing through the volume feature.
Originality
Most "machine-learning" indicators emit an uncalibrated score that is never checked against what actually happened. The contribution here is the closed, honest loop: real path-dependent labels, a fused-but-decorrelated classifier, regime-conditional shrinkage, a drift-robust conformal band, conviction/veto gating, and a built-in reliability + Brier + edge harness that can — and often does — tell you the model has no edge right now. It is built to be disprovable, which is the opposite of most signal scripts.
Credits
Triple-barrier labelling & meta-labelling — Marcos López de Prado
Logistic regression / SGD — classical statistics
Lorentzian (non-Euclidean) distance for k-NN — relativistic-distance concept
Conformal prediction — Vovk, Gammerman & Shafer; Adaptive Conformal Inference — Gibbs & Candès
Brier score — Glenn W. Brier
Wilson score interval — Edwin B. Wilson
Efficiency Ratio — Perry Kaufman · ADX / DMI — J. Welles Wilder
Hawkes self-exciting process — Alan G. Hawkes
Ornstein-Uhlenbeck / AR(1) half-life — Ornstein & Uhlenbeck
Effective-sample decorrelation — Leslie Kish
The pipeline assembly, the regime-conditional calibration and the conviction/veto layer are the author's original implementation.
Limitations (honest)
A well-calibrated probability is not an edge after costs. The forward stats are in-sample, close-to-close at a fixed horizon, with no costs, slippage or stops — a study aid, not a backtest. The model is small (six features, online weights); it warms up slowly and will stand aside often. Past behaviour does not assure future behaviour.
Disclaimer
Educational / informational study for chart analysis only. NOT financial advice, NOT a strategy, NOT a recommendation. It places no orders and guarantees no outcome. Markets carry risk; do your own research and manage your own risk. Paper-trade before risking real money. Indicator

Options Probabilistic Bounds [InferredSignals]█ OVERVIEW
Options Probabilistic Bounds (OPB) draws a forward price corridor on the daily chart — an upper and a lower band projected over a horizon you choose (1 to 20 trading days) at a confidence level you choose (default 95%).
In plain words: given how this stock has actually been moving, where could the CLOSING price realistically land over the next few days? The corridor is calibrated so that, at each horizon, roughly your chosen percentage of closes finish inside it.
It is built for option sellers — short puts in particular. The lower band is a statistically calibrated reference for where to place a strike. And because the corridor takes no view on direction, OPB adds something most volatility tools don't: a drift readout that tells you which side currently has the wind at its back, so you can see whether puts or calls are the safer leg to sell right now.
No option-chain data is used anywhere — no implied volatility, no greeks, no implied-vol skew. "Options" describes who the tool is for, not what it reads. OPB is a pure statistical model of the underlying's own price history.
█ WHAT MAKES IT ORIGINAL
• Per-symbol MAP-style calibration, entirely in Pine.
Parameters are fitted to each ticker by minimizing a penalized negative log-posterior — Student-t likelihood, Bayesian-style priors, and residual-moment penalties combined in one objective — searched multi-start and coarse-to-fine, with the winner chosen on residual quality, not likelihood alone. The result: less in-sample curve-fitting and a steadier calibration than a plain best-fit vol model.
• Two-component, leverage-aware GJR-GARCH variance.
A slow long-run level plus a faster mean-reverting short-run component, so a volatility shock decays over a few days instead of holding the corridor wide for weeks. Negative-return days get a specific leverage response — downside risk is modeled, not averaged away.
• Filtered historical tails with EVT extension.
The residual body is empirical (Filtered Historical Simulation); each tail is extended with a Generalized Pareto fit whose shape and scale are estimated in closed form by Probability-Weighted Moments (Hosking-Wallis) — more stable than method-of-moments or MLE on the small tail samples you actually get. The shape is floored at zero so equity tails are never assumed bounded, and with too few exceedances it falls back to empirical quantiles rather than overfitting noisy extremes.
• Data-driven downside asymmetry.
The downside leverage increment is routed fully to the lower band; the upper band receives only a data-driven semivariance fraction. The corridor widens below only as far as the symbol's own history justifies.
█ THE DRIFT READOUT — WHICH SIDE TO SELL
The bands are DRIFT-NEUTRAL by design: centered on today's close, never tilted up or down. Over 1–20 days, direction is effectively unestimable from price history — and a wrong directional bet would quietly under-reserve the downside, the worst place to be short a put. So the whole band width is spent on dispersion, none of it gambled on a direction the data can't support.
OPB still measures the recent drift and reports it as a small number next to σ, in :
• ↑ : favors puts — the stock has been drifting up, so the put leg has had a cushion.
• ↓ : favors calls — drifting down, the call leg has had the cushion.
• flat — no meaningful drift.
Practical read: it is usually safer to sell the leg the drift is moving AWAY from — sell puts into an uptrend, calls into a downtrend. The wind at your back.
In the backtest this shows up cleanly: on a strongly trending stock the drift-neutral bands breach the TREND side more often than the nominal rate, while the opposite side stays close to it. This is expected, not miscalibration — the corridor is honestly direction-agnostic, so the band width itself stays unbiased and the extra breaches on the trend side are pure drift. The takeaway matches the readout: the side you should be selling — the one the trend is moving away from — is the side that stays calibrated. One caveat: the drift readout is the RECENT past, never a forecast — a strong reading is often exactly where mean-reversion becomes most likely. The fat-tailed band remains the real safety net.
MU · daily · walk-forward, monthly recals. On this uptrend the trend side (Brch+) runs well above nominal while the put-sell side (Brch−) holds at/below its 2.5% target — the drift asymmetry described above, in numbers.
█ HOW TO USE IT
• Set a horizon (e.g. 5 days) and a confidence level (e.g. 95%).
• Read the upper/lower band at your horizon as a strike-placement reference.
• Glance at the drift readout to pick the safer leg — puts vs calls.
• Turn on the walk-forward backtest and check: Close-in ≈ your confidence level; Brch+ / Brch− near the per-side rate and reasonably balanced; NT dn = how often a lower-band strike was never touched over the whole path — the number that matters for assignment.
• Optional PIT diagnostic: D ≈ 1 well-sized, D < 1 too wide, D > 1 too narrow. Read h = 1 first (least affected by overlapping windows).
• Anchor mode D-1…D-5 freezes the corridor as it looked N days ago, calibrated only on data known then — handy to inspect how past corridors held.
█ SETTINGS
Defaults are robust and research-oriented: Horizon 5d · Confidence 95% · Calibration window 252d · Two-component variance ON · Leverage-asymmetric bands ON · Earnings-gap neutralization ON.
"Long-run half-life" sets how steady the long-run volatility baseline is — a higher value keeps it stiffer after a shock, which (with the two-component model on) reduces post-shock over-widening.
Every input ships with a plain-language tooltip. Daily timeframe only. Calibration runs on the last bar for performance; walk-forward recalibration is monthly, a Pine execution-time constraint.
█ WHAT IT IS NOT
• Not a directional forecast — the corridor is drift-neutral, centered on the anchor close.
• Not a joint path bound — confidence targets the close at each horizon separately; the chance of touching a band along the path is the separate No-Touch figure (see backtest).
• Not an option-pricing model — no implied volatility, greeks, or option-chain data.
• Not a guarantee — the backtest and PIT diagnostics are historical calibration evidence, not a promise of future coverage.
Full methodology, equations, and references are documented section by section in the source code. This is a research and educational tool, not investment advice.
Indicator

Self-Validating Elliott Wave EngineSELF-VALIDATING ELLIOTT WAVE ENGINE
A probabilistic Elliott Wave framework that does three things most wave tools do not: it weighs SEVERAL competing counts at once instead of asserting one, it CALIBRATES its own confidence against what actually happened on the instrument you are viewing, and it tells you honestly when no count is trustworthy. It is decision-support and context - not a signal generator, and never a claim of certainty.
WHY THESE PARTS BELONG TOGETHER (one engine, not a bundle)
Elliott Wave analysis is unavoidably ambiguous: the same swings can support an impulse, a zigzag, a flat or a triangle, and practitioners disagree constantly. A tool that draws one count and hides that ambiguity is misleading. This script is built as a single pipeline whose stages exist specifically to manage that ambiguity, and removing any one stage breaks it:
1. Structure - an alternating swing (ZigZag) series is built from confirmed pivots, and each pivot is tagged with momentum (RSI) and relative volume. This is the raw evidence every wave rule is tested against; without a clean swing series there is nothing to count.
2. Multi-count pattern engine - from that swing series the script forms several competing labelled hypotheses at once (impulse forming wave 3/4/5 or complete, zigzag, flat, contracting triangle). Because Elliott is ambiguous, evaluating alternatives is the whole point, not an add-on.
3. Scoring - each hypothesis is graded on Fibonacci fit, proportion and the alternation guideline (waves 2 and 4 should differ in form), and "wave energy" (does wave 3 thrust hardest, in trend direction, on rising volume?). These are combined deliberately: Fibonacci ratios alone mislabel corrections as impulses; momentum alone is directionless noise; only together do they discriminate real structure.
4. Regime context - a trend/range/compression read (from ADX and ATR) tilts the priors, because impulses are more likely in trends and corrections in ranges. It changes the odds, it does not override the structure.
5. Market-structure confirmation - an independent break-of-structure / change-of-character check raises or lowers the chosen count, so the wave read must agree with raw price action to score well.
6. Calibrated forecast - the forward zone is built from THIS chart's own distribution of historical retracement depths, not fixed ratios pulled from a textbook, so it reflects how the specific instrument actually behaves.
7. Outcome calibration - every forward call (target + invalidation + confidence) is logged and later checked: did price reach target before invalidation? Outcomes are bucketed by confidence, so the confidence number on screen can be mapped to a MEASURED hit-rate. This is the stage that makes the tool self-validating, and it is impossible without all the stages above feeding it.
So the components are not stacked for convenience - they form one loop: build competing hypotheses, score them on structure and momentum, tilt by regime, confirm against price structure, forecast from the instrument's own history, then grade that forecast against reality and report the measured reliability. That is why this is one indicator rather than seven separate overlays.
HOW IT WORKS ON THE CHART
- Wave labels and connecting lines draw the primary (highest-scoring) count's structure.
- A dashed projection line and a shaded forecast zone mark where the primary count expects price to go, with the zone width calibrated from the chart's own retrace history.
- A dashboard reports: the primary count with its probability share, its position and stage, the two best alternative counts, the raw confidence, the measured calibrated hit-rate once enough cases have resolved, the regime, the market-structure state (and whether it confirms or warns), the hard-rule pass/fail, wave energy, an opportunity read (confidence shaped by reward-to-risk and structure), and the target / invalidation levels.
HOW TO USE IT
- Read the ambiguity, not a single answer. The secondary and tertiary counts and their probabilities tell you how clear or murky the structure currently is.
- Trust "Calibrated" over "Confidence". Confidence is the raw structural score; the calibrated figure is the measured success rate for that confidence level on resolved cases - the honest number.
- Respect "stand aside". When confidence is below your threshold the panel says so instead of forcing a count. That is a feature.
- Use target and invalidation as context for your own plan. Invalidation is the level that would break the primary count; the forecast zone is where it expects to resolve. The script places no orders.
- Combine with your own method. The market-structure and regime rows are there so the wave read can be cross-checked against plain price action.
SETTINGS OVERVIEW
- Structure: swing sensitivity (pivot legs), max swings stored, and pivot source - wicks (high/low) or bodies (close), so it suits how you read a given market.
- Scoring weights: Fibonacci fit, proportion/look, wave-3 momentum.
- Context: ADX length and trend threshold.
- Forecast: inner/outer percentiles of the retrace distribution, minimum swings to calibrate, minimum resolved cases before the calibrated hit-rate is trusted.
- Display: minimum confidence for a "clean" count, label/zone/panel toggles, bull/bear colours.
- Alerts: new wave, count flip, invalidation breach, forecast-zone entry (via "Any alert() function call").
Pivot source is selectable and volume is used only when a symbol reports it, so the engine runs on futures, equities, forex, crypto and indices on any timeframe.
ORIGINALITY
Most Elliott tools draw a single count and stop. This one runs a bounded multi-count search, scores each hypothesis on structure plus momentum plus volume, tilts by regime and confirms against market structure, forecasts from the instrument's own retrace distribution, and - uniquely - measures its own realised hit-rate per confidence level so the number on screen is grounded in outcomes rather than asserted. It quantifies and reports its own reliability.
REPAINT NOTICE AND LIMITATIONS (honest)
- Swing detection uses confirmed pivots, which finalise a fixed number of bars after they form. The most recent leg is therefore always provisional and can change. This is inherent to Elliott structure detection and is disclosed deliberately, not hidden.
- Counts are probabilistic hypotheses, not predictions. Two analysts - and this engine on two settings - can read the same chart differently.
- Calibration is a long-run estimate over resolved cases on this chart; early on, and after a regime change, it needs samples before it means anything, and past hit-rate is not a future guarantee.
- This is context and decision-support. It is not a trading system and issues no orders.
DISCLAIMER
This script is for research and education only. It is not financial advice, not a recommendation, and not a solicitation to trade. It places no orders and guarantees no outcome. Markets carry risk; test any tool on your own data and timeframe and make your own decisions.
Indicator

Self Calibrating Probability ChannelSELF-CALIBRATING PROBABILITY CHANNEL
A forecast channel whose width is set by conformal prediction, tuned by a parameter-free online calibrator, and proven on your own chart. You pick a coverage level - say 90% - and the indicator shows you, live, the percentage it has actually achieved over recent bars, on every timeframe. Most bands assert a width; this one measures whether the width was right and corrects itself until it is, with nothing to tune.
WHAT IT IS
Bollinger Bands, Keltner Channels, Donchian Channels and standard-deviation regression channels all draw a width from a formula and ask you to trust it. None of them tell you what fraction of price actually landed inside. A "2 standard deviation" band is only a true 95% band if returns are normally distributed and stationary - which markets are not - so the real hit-rate drifts, usually without the user ever knowing.
This indicator inverts that. It forecasts where price should be next bar, measures how wrong that forecast has actually been, and builds the band directly from the empirical distribution of those errors. Then it watches its own hit-rate bar by bar and self-corrects. The result is a channel that earns its stated confidence level instead of assuming it - and reports, honestly, where it is and isn't holding.
THE METHOD (plain language)
1. Forecast path. Each bar, a one-step-ahead forecast of price is formed. You can pick a Kalman level-and-velocity tracker, a linear-regression slope, an EMA projection, or an anchored VWAP - or leave it on Auto, which runs all of them and blends them online by recent accuracy, so the centre line self-calibrates too. The forecast for the current bar uses only prior bars, so it is genuinely out-of-sample.
2. Error window. The gap between forecast and outcome is the forecast error. A rolling window of recent errors is kept, stored in volatility (ATR) units so the band breathes with the market. Each error is recorded only after its band has already been scored, so the band never includes the bar it is being tested on.
3. Conformal bands. For a chosen confidence level, the band edges sit at the matching quantiles of the recent error distribution (split-conformal prediction). Because it uses the actual error quantiles - including their skew - the bands are asymmetric when the errors are, rather than forcing a symmetric width. Four levels are drawn at once (50 / 70 / 90 / 95%) as nested zones, so the channel doubles as a probability heatmap: the dark core is where price spends most of its time, the faint outer edge marks rare excursions.
4. Parameter-free self-calibration (DtACI). After each bar the indicator checks whether price fell inside each level and nudges the width to hold the target. Rather than asking you to pick a calibration speed, it runs several speeds as competing "experts" and continuously blends them by how well each has tracked coverage recently (Dynamically-tuned Adaptive Conformal Inference). There is no rate to tune - the calibration tunes itself.
5. Live coverage proof, including by regime. The dashboard shows, for every level, the target versus the actually-achieved coverage over a rolling window, each tagged calibrated / under / over. It also reports the realised 90% coverage broken down by market regime - so you can see, for instance, that the band holds 92% in a quiet range but 87% in a volatile breakout. You are not asked to trust the band; you are shown its track record on the symbol, timeframe and regime in front of you.
6. Forward cone. A widening cone projects the likely range several bars ahead. Its width is built from actual multi-step forecast errors (not a square-root-of-time assumption), and its centre curves as projected momentum decays rather than extrapolating in a straight line. An optional bootstrap cloud resamples the real errors into sample forward paths - a direct picture of the distribution the bands come from.
7. Context and early warning. A two-axis regime read (trend strength x volatility) labels conditions; a turbulence detector watches for clustering of outer-band breaches and flags, in advance, when coverage is likely to degrade; a coiled-spring marker notes when a compressed range begins to expand; and an optional higher-timeframe row shows whether the larger trend agrees.
WHY THESE PARTS BELONG TOGETHER (one engine, not a bundle)
This is a single forecasting loop, not a collection of separate indicators sharing a chart. Each part is a required step, and removing any one breaks the whole:
- The forecast path produces an expected price and a drift. Without it there is no quantity whose error can be measured.
- The conformal band converts that path's own recent errors into prediction intervals. Without the forecast there is no error to bound; without the band the forecast is an unqualified guess.
- The online self-calibration adjusts the band to hold the target hit-rate as conditions change. Without it the intervals slowly drift out of calibration and the stated confidence becomes false.
- The live coverage readout verifies the loop is actually working, overall and per regime. It is the proof step a formula-based band cannot offer.
- The context layers (regime, turbulence early-warning, graded breaches, compression-release, higher-timeframe agreement) all read the same forecast errors and exist only to tell you WHEN the interval is most trustworthy and when it is about to fail.
So the components are not combined for convenience; they form a closed measure-and-correct cycle - forecast, bound the error, recalibrate, verify - which is precisely why they are published as one script rather than several overlays.
WHAT MAKES IT DIFFERENT
Conformal prediction is a distribution-free framework - its coverage guarantee holds for any underlying distribution given exchangeable errors, with no assumption that returns are Gaussian. It is standard in machine-learning uncertainty quantification but essentially absent from charting tools, which lean almost entirely on standard-deviation or ATR multiples. Pairing it with a parameter-free online recalibrator, a self-weighting forecast centre, and an on-chart coverage readout - including a per-regime breakdown - is the original contribution here. No moving-average envelope, regression channel or volatility band can state "I targeted 90% and have actually delivered 90% over the last 250 bars, and here is exactly where I don't" - this one can, and shows it.
WHAT YOU SEE ON THE CHART
- A multi-zone channel around a forecast centre line, shaded from the high-probability core out to the rare-excursion edge, coloured by forecast direction, and adaptive to dark or light chart backgrounds.
- A widening forward cone, optionally filled with a faint cloud of resampled paths.
- Right-side labels marking the forecast and the 90 / 95% edges as price levels.
- Small triangles when price breaks beyond the outer band; a ring when that breach is also high-quality (graded on displacement, close position, volume, range expansion and structure); an amber diamond when a quiet range starts to wake up.
- A dashboard with the live forecast, the 90% band range and where price sits within it, the full calibration table, the per-regime coverage, a reliability score, the forecast bias, the sample count, the calibration mode, and an optional higher-timeframe row.
- A plain-language "how to read" key, so the chart is approachable without any statistics background.
HOW TO READ AND USE IT
Mean reversion: when price reaches the outer (90 / 95%) zone in a ranging regime, it is statistically stretched and tends to revert toward the centre line. The "band position" readout and the calibration table tell you how stretched, and how trustworthy that edge currently is.
Trend continuation: a sustained walk along one side of the channel, especially with the cone tilted that way and the higher-timeframe row aligned, indicates a directional regime rather than noise.
Anomaly / breakout: a plain triangle is a volatility event; a ringed one is the same event confirmed as high-quality. A turbulence flag warns that the bands may be about to lose calibration.
Reliability and regime: treat the bands as most actionable when reliability is high, the calibration rows read "calibrated", and turbulence is quiet. The per-regime coverage tells you which conditions the channel is currently most trustworthy in.
SETTINGS OVERVIEW
- Forecast path (Auto / Kalman / Linear Regression / EMA / Anchored VWAP) and smoothing lengths.
- Calibration: residual window, recency window, volatility normalisation, parameter-free DtACI on/off (with a manual ACI rate as fallback), coverage-evaluation window.
- Forward projection length, cone momentum decay, optional bootstrap cloud.
- Anomaly sensitivity, swing pivot length, coiled-spring thresholds, turbulence sensitivity.
- Higher-timeframe context, price source, and full theme controls.
The price source is selectable and volume is borrowed where a symbol reports none, so it works across futures, equities, forex and crypto on any timeframe. Defaults read well intraday; longer windows suit higher timeframes.
HONESTY AND LIMITATIONS
- Non-repainting: each bar's forecast uses only prior bars, each error is recorded only after its band is scored, anomalies confirm on bar close, and the higher-timeframe row uses the last confirmed higher-timeframe value. Historical bands do not change after the fact.
- Conformal coverage is a statistical expectation over a window, not a per-bar guarantee. In a sharp regime break the realised hit-rate will dip until the window and calibrator re-adapt - and the dashboard, including its per-regime breakdown, shows that dip honestly rather than hiding it.
- The bands describe the distribution of short-horizon forecast error. They are a probabilistic context for price, not a prediction of direction and not a trading system.
- Calibration needs enough samples; on a fresh chart the channel needs its warm-up window before the figures are meaningful, and the cone needs a few extra bars beyond that.
This script is for research and education. It is not financial advice and not a solicitation to trade. Markets carry risk; test any tool on your own data and timeframe, and make your own decisions.
Indicator

Gap Fill Probability for SPY SPX XSPGap Fill Probability Viewer - open gaps with an adaptive fill probability
Gap Fill Probability Viewer automatically finds price gaps on your chart and draws each one as a colored zone - no more drawing rectangles by hand. It then tells you how likely each open gap is to "fill," and exactly how far price has to travel to close it.
What it shows
Gap zones - every gap-up and gap-down, drawn as a box that extends to the current bar.
Fill probability (P) - an estimate of how likely the gap is to close, shown as a % and color-coded (green = likely, orange = uncertain, red = unlikely).
p-value - the flip side of P: the chance the gap stays open.
Distance to close - how far the current price is from fully closing the gap, in both points and % of the charted symbol.
Stats table - a clean summary for the gap closest to filling.
How the probability works
The estimate adapts to three things research associates with gap fills:
- Size - bigger gaps are harder to fill.
- Distance - the closer price is to the gap, the higher the odds.
- Recency - fresh gaps fill faster; old, stubborn gaps lose momentum.
Handy options
- Auto-hide, fade, or keep gaps once they fill.
- Filter out tiny gaps by % or ATR.
- Detect gaps on wicks or candle bodies.
- Fully tunable probability model and colors.
⚠️ The fill probability is a heuristic estimate for study and education — not a guarantee or financial advice. Calibrate the settings to your own market and timeframe. Indicator

AI Trend Detector | Adaptive Signals [NeuraLib Machine Learning]🔷 AI Trend Detector | Adaptive Signals
AI Trend Detector is a NeuraLib-powered Machine Learning indicator. It trains a compact supervised neural model on confirmed historical movement, then uses the current market state to estimate Bear , Neutral , and Bull pressure.
The model output is converted into a clean visual system:
Trend Oscillator : A 0-100 pressure gauge. Lower values suggest bullish pressure or oversold conditions. Higher values suggest bearish pressure or overbought conditions.
Adaptive MA Cloud : A main-chart adaptive moving average with an AI-biased cloud that expands as model pressure moves away from neutral.
Confirmed Triangles : Optional chart markers for overbought and oversold interactions, with modes for zone entry, zone exit, or confirmed rotation inside a zone.
Dashboard : A compact readout showing the current state, signal value and confidence.
Triangle Alerts : Alert conditions tied to the same confirmed marker logic shown on the chart.
Directional Confidence : An optional 0-100 line showing the stronger directional model probability, calculated from the larger of Bull or Bear pressure. It does not include Neutral probability, so it reflects directional conviction rather than overall model certainty.
This is not a fixed crossover system. The signals are the visual layer of a model-driven trend pressure engine.
---
🔷 How The Model Learns
Each bar contributes a compact feature row based on price movement, adaptive MA context, and distance from the adaptive baseline. NeuraLib stores these rows in a rolling dataset, normalizes the inputs, and trains the model on recent time-series windows.
The model is trained as a 3-class classifier:
Bear
Neutral
Bull
Historical training examples use future-resolved movement to create their target class, but only after that movement has already occurred. This is the supervised learning setup: the model learns from completed historical outcomes, then applies its learned weights to the current live feature window.
The exposed settings allow users to experiment with model size, learning rate, training frequency, smoothing, trend horizon, and signal behavior.
---
🔷 Model Architecture
The model uses a compact temporal classification architecture:
Flattened state window : Recent feature rows are combined into one temporal input.
Temporal convolution stack : Conv1D-style layers extract short-term structure from the recent market sequence.
Global average pooling : The temporal output is compressed into a compact state representation.
Dense classifier head : One or two dense layers process the pooled state.
Three output logits : The model produces Bear, Neutral, and Bull logits, which are converted into display probabilities.
This keeps the model small enough for Pine Script while still giving it a true sequence-learning structure rather than a simple crossover or rule-based signal engine.
---
🔷 Reading The Signals
The oscillator is intentionally inverted for intuitive market reading:
Low values : Oversold or bullish pressure.
Mid values : Balanced or neutral pressure.
High values : Overbought or bearish pressure.
Triangles can be configured through the Triangle trigger setting:
Crossing into : Prints when the oscillator crosses into an overbought or oversold zone.
Going out of : Prints when the oscillator exits an overbought or oversold zone.
Rotation inside zone : Prints when the signal forms a confirmed turn while still inside the zone.
In rotation mode, Rotation confirmation controls how many bars must pass without breaking the candidate peak or trough before the marker is accepted. Rotation triangles print on the confirmation bar, not on the older pivot bar.
The adaptive MA cloud is visual only. The model is not trained on the shifted cloud edge. The cloud simply applies model pressure around the adaptive MA baseline.
---
⚠️ Repainting And Signal Timing
The training and signal system is designed around confirmed bars:
Training rows are pushed on confirmed bars.
Triangle signals are gated with barstate.isconfirmed .
Rotation markers print on the confirmation bar.
No negative plot offsets are used to move markers into the past.
The smoothing path uses current and past values only.
Because this model does not train on the full price history, but instead learns from the most recent N bars, repainting may occur when the script is reloaded at a later date. This happens because the model may begin training from a different market environment.
To help preserve the original model state, adjust the Historical Train Window setting to account for any new bars that have been added since the original run.
---
⚠️ Limitations
Machine Learning inside Pine Script is powerful, but it is still bounded by PulseWire's execution model.
The model is compact by design.
Training history is bounded for performance.
Changing hyperparameters rebuilds the model.
Signals depend on the chosen horizon, threshold, smoothing, and triangle mode.
The model estimates directional pressure. It does not know your entries, exits, risk, fees, or position sizing.
This indicator is best treated as a model-based market pressure tool, not as a complete trading system by itself.
This indicator is powered by the NeuraLib Deep Learning Runtime
Disclaimer: This indicator is an analytical and educational tool. It does not guarantee future results, signal accuracy, or financial gain. Past behavior does not ensure future behavior. Use it as one component in a broader trading process, under your own responsibility. Conceptual architecture and quantitative development by Alien_Algorithms.
Indicator

Liquidity Sweep Probability [JOAT]Liquidity Sweep Probability is an open-source Pine Script v6 overlay that maps equal highs and equal lows, tracks sweeps through those levels, detects reclaim behavior, and records simple continuation samples after reclaim events. It is designed for traders who want a clean way to observe where price has built nearby liquidity and how price behaves after that liquidity is tested.
The script does not claim that a sweep must reverse price. Instead, it separates equal-level creation, sweep, reclaim, break, and continuation outcomes. The dashboard shows the most recent event, the side involved, sample counts, and an adaptive probability-style reading derived from the script's own observed samples.
Core Concepts
1. Equal High and Equal Low Detection
Confirmed pivots are compared against the previous pivot on the same side. If two pivot highs or lows are within an ATR-based tolerance, a liquidity zone is created.
pivotHigh = ta.pivothigh(high, pivotLength, pivotLength)
if not na(lastHighPivot) and math.abs(pivotHigh - lastHighPivot) <= equalTolerance
zoneTop = math.max(pivotHigh, lastHighPivot) + zonePadding
zoneBottom = math.min(pivotHigh, lastHighPivot) - zonePadding
2. Sweep State
A high-side sweep occurs when price trades beyond the equal high zone but closes back below the zone top. A low-side sweep occurs when price trades below the equal low zone but closes back above the zone bottom.
3. Reclaim State
After a sweep, the script watches a configurable reclaim window. A high-side reclaim requires price to close back below the lower boundary of the swept high zone. A low-side reclaim requires price to close back above the upper boundary of the swept low zone.
4. Continuation Sampling
After reclaim, the script stores a target distance based on ATR and tracks whether price reaches it within the outcome window. These counts are displayed as samples. They are descriptive statistics from the chart, not a prediction.
5. Probability Panel
The probability-style score blends observed sample rate, sweep distance, zone age, and reclaim status. It gives a compact read of the current event context.
sampleRate = total > 0 ? (wins * 100.0) / total : 50.0
score = clamp(sampleRate * 0.62 + 19.0 + distanceBoost + ageBoost + reclaimBoost, 5.0, 95.0)
Features
Equal high and equal low zones: ATR tolerance avoids exact-price-only matching
Sweep detection: Tracks confirmed high-side and low-side liquidity sweeps
Reclaim detection: Separates immediate breaks from reclaim behavior
Continuation samples: Counts historical reclaim outcomes within the active chart sample
Dashed midlines: Each zone includes a center reference line
Stateful labels: Zones update from Equal High/Low to Sweep, Reclaimed, or Broken
Probability panel: Shows side, status, chance value, samples, and age
Alerts: Sweep, reclaim, and zone break conditions
Input Parameters
Swings:
Swing Pivot Length: Pivot sensitivity for equal-level detection
Equal-Level Tolerance: ATR fraction used to compare pivots
Zone Padding: ATR fraction added around the equal level
ATR Length: Volatility length for tolerance and padding
Behavior:
Reclaim Window: Bars allowed for reclaim after sweep
Continuation Window: Bars allowed for measuring post-reclaim continuation
Continuation Distance: ATR target used for sample tracking
Maximum Zones Per Side: Object cap for high and low zones
Visual:
Palette: Selects bull and bear colors
Zone Extension Bars: Forward extension for boxes and midlines
Probability Panel: Shows or hides the dashboard
How to Use This Indicator
Step 1: Identify Equal-Level Zones
Equal highs can act as high-side liquidity references. Equal lows can act as low-side liquidity references.
Step 2: Watch for Sweep and Reclaim
A sweep alone is not enough. Reclaim behavior shows that price tested outside the zone and then closed back through the zone boundary.
Step 3: Read the Sample Count
The sample row shows how many observed reclaim events reached their ATR target on the current chart sample. A small sample should be treated carefully.
Step 4: Use Zones as Context
Use the zones to frame liquidity behavior, then combine the context with your own entry trigger and risk plan.
Indicator Limitations
Equal-level zones are based on confirmed pivots, so they appear after the pivot confirmation window
The probability value is descriptive and chart-dependent
A small number of samples should not be treated as statistically strong
Fast markets may sweep, reclaim, and break multiple zones quickly
Object limits require the script to delete older zones when caps are reached
Originality Statement
Liquidity Sweep Probability is original in its state machine for equal-level zones, sweep/reclaim/break classification, and live sample tracking. It uses public Pine v6 mechanics to build a self-contained liquidity map without copying another indicator's source.
Disclaimer
This script is provided for educational and informational use only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Liquidity sweeps can continue, reverse, or fail without warning. Always use independent analysis and proper risk management.
-Made with passion by jackofalltrades
Indicator

Viprasol Naive Bayes Order FlowOverview
This indicator is based on "Institutional Order Flow Signals " by PMT, an open-source script that classifies order-flow conditions with a Naive Bayes classifier trained on Cumulative Volume Delta (CVD) features. The original produces a posterior probability that the current bar belongs to a Bull, Bear, or Diverged regime, then prints directional signals when that probability clears a threshold and price agrees with a trend EMA. This version keeps that classifier intact and layers a Viprasol signal-filter stack on top: a signal cooldown, an optional volume-surge confluence requirement, a bar-close confirmation gate, live classifier hit-rate tracking, and regime-flip detection.
It is built for traders who want a probabilistic read on whether buying or selling pressure (measured through volume delta) is currently dominating, with explicit noise controls applied before any signal fires.
How It Works
Cumulative Volume Delta (from original):
Each bar's volume is split into buying and selling pressure by where the close sits inside the bar's range. Buy volume = volume × (close − low) / range; sell volume = volume × (high − close) / range. The bar delta is buy minus sell, and these deltas are summed into a running CVD line. CVD rising means net buying pressure is accumulating; falling means net selling.
Three Classifier Features (from original):
The classifier is trained on three z-score-normalised features so they are comparable across instruments:
- F1 — CVD rate of change over the momentum period, normalised against its own rolling mean and standard deviation.
- F2 — price/flow divergence: price ROC minus CVD ROC, normalised. Large values flag price moving without matching flow (or vice versa).
- F3 — CVD slope: the first difference of a linear regression on the CVD line, normalised. Captures the acceleration of flow.
Naive Bayes Classification (from original):
Every bar is labelled into one of three classes from the prior bar's outcome — Bull (price up and CVD up), Bear (price down and CVD down), or Diverged (anything else). For each class the script maintains running sums of each feature and each feature squared, from which it derives a per-class mean and standard deviation online (no arrays of history needed). The likelihood of the current feature vector under each class is the product of three Gaussian PDFs (the "naive" independence assumption). Combined with class priors (the observed class frequencies), Bayes' rule yields the posterior probability of each class:
posterior(class) = prior(class) × likelihood(class) / evidence
A signal requires the posterior to clear the entry threshold, price to be on the correct side of the trend EMA, and CVD to be moving in the signal's direction. Signals fire only on the first bar of a new cluster to avoid consecutive repeats.
Signal Cooldown (new):
After any signal fires, a configurable number of bars must elapse before the next signal of any direction is allowed, tracked as bar_index − lastSignalBar >= cooldown. During fast moves the classifier can re-cross the threshold repeatedly; the cooldown collapses those into one actionable signal. A cooldown of 5 bars on a 15-minute chart enforces a 75-minute minimum gap between entries.
Volume-Surge Confluence (new):
When enabled, a signal is additionally gated on current volume exceeding its rolling average by a multiplier (default 1.5×). The logic is volume > sma(volume, length) × multiplier. This filters out classifier signals that occur on thin participation, where flow estimates are least reliable.
Bar-Close Confirmation (new):
When enabled, signals are only confirmed on a fully closed bar (barstate.isconfirmed). Because the posterior and CVD update intrabar, a developing bar can flip in and out of a signal state before it closes; this gate holds the signal until the bar settles.
Classifier Hit-Rate Tracking (new):
On every live bar the script takes the argmax of the three posteriors as its prediction, then on the following bar compares that prediction to the realised class label. It accumulates a running hit count and evaluation count and displays the ratio as a live "Hit Rate" in the dashboard. This is an honest in-sample diagnostic of how often the classifier's single most-likely class matched the next realised label — not a trade win rate.
Regime-Flip Detection (new):
The script tracks the active regime (+1 bull, −1 bear, 0 neutral) and fires a dedicated alert whenever it transitions into a new bull or bear regime, independent of the entry-cluster logic. Useful for traders who want to be notified of context shifts rather than individual entries.
Diverged Class Surfaced (new):
The original computes a third "Diverged" class but never displays its posterior. This version surfaces P(Diverged) in the dashboard so the trader can see when the classifier considers the tape conflicted (price and flow disagreeing) rather than directional.
What Is Original (Viprasol Additions)
1. Signal cooldown system — enforces a minimum bar gap between signals to prevent clustering during fast moves.
2. Volume-surge confluence filter — optionally requires above-average volume on the signal bar so signals occur on real participation.
3. Bar-close confirmation gate — optionally holds signals until the bar closes, removing intrabar flip-flop.
4. Classifier hit-rate tracking — online comparison of the argmax-posterior prediction to the next realised class, displayed live.
5. Regime-flip detection — separate state machine and alert for bull/bear regime transitions.
6. Diverged-class posterior surfaced in the dashboard, exposing the third class the original computed but hid.
Key Features
From the Original (PMT):
- CVD line built from close-position volume splitting
- Three z-score-normalised classifier features (CVD ROC, price/flow divergence, CVD slope)
- Online Naive Bayes classifier over Bull / Bear / Diverged classes with Gaussian likelihoods
- Posterior-probability entry threshold with trend-EMA and CVD-direction agreement
- Confidence tiers (high / mid / normal) driving signal shape and band opacity
- Confidence-scaled posterior band and regime background shading
- ATR-based SL/TP projection lines
- Warmup gate (LIVE only after the classifier has trained on enough bars)
- Zen mode for clean screenshots
Added in This Version (Viprasol):
- Signal cooldown, volume-surge confluence, and bar-close confirmation filters
- Live classifier hit-rate diagnostic
- Regime-flip detection and alert
- Diverged-class posterior in the dashboard
- Colored TP / ENTRY / SL price labels on the projection lines
- Expanded info dashboard with selectable position
- Six alert conditions with dynamic {{ticker}} / {{close}} / {{interval}} messages
How to Use
Getting Started:
1. Add to a standard candlestick chart (not Heikin Ashi).
2. Wait for the dashboard to read LIVE — the classifier needs to train on enough bars first (status shows WARMUP and an N-trained counter until then).
3. Long signals print below the bar (circle = high conviction, triangle = normal); short signals print above the bar.
Reading the Dashboard:
- Bull P / Bear P / Diverged P — the three class posteriors. The dominant one drives the regime.
- CVD Flow — whether net delta is currently rising (buy) or falling (sell).
- Vol Surge — whether the current bar cleared the volume-surge threshold.
- Hit Rate — share of bars where the most-likely class matched the next realised class.
- N Trained — how many bars the classifier has trained on; ✓ once warmed up.
Recommended Starting Points:
- Crypto/Forex (5m-15m): Lookback 100, Threshold 0.70, Cooldown 3
- Stocks (15m-1H): Lookback 120, Threshold 0.72, Cooldown 5
- Indices (1H-4H): Lookback 150, Threshold 0.75, Cooldown 8
These are starting points only. Volume data quality and tape behaviour differ by instrument — backtest and adjust before trading live.
Settings
Naive Bayes Classifier: classifier lookback (bars before signals go live), entry threshold (minimum posterior), and prior bull probability.
CVD Features: CVD momentum period, CVD slope period, and the z-score normalisation window applied to all features.
Signal Filters (Viprasol): signal cooldown in bars, bar-close confirmation toggle, volume-surge requirement with average length and multiplier.
Signal Levels: show SL/TP lines, show price labels, SL ATR multiplier, risk:reward ratio, ATR period, and trend EMA period.
Visual: posterior band toggle, regime background toggle, and bull / bear / diverged colors.
Dashboard / Display: Zen mode, dashboard toggle, and dashboard position.
Alerts
1. Long Signal — bull posterior cleared the threshold with CVD rising and all filters passed
2. Short Signal — bear posterior cleared the threshold with CVD falling and all filters passed
3. Any Signal — either direction fired
4. High-Conviction Long — long signal with P(Bull) at or above 85%
5. High-Conviction Short — short signal with P(Bear) at or above 85%
6. Regime Flip — the active regime transitioned into a new bull or bear state
All alerts include {{ticker}}, {{close}}, and {{interval}} for dynamic notification messages.
Limitations & Disclaimer
- The classifier trains in-sample on the chart's own history and updates continuously; the displayed hit rate is a diagnostic of class-label agreement, not a trade win rate, and is not predictive of future results.
- CVD here is approximated from candle range and volume, not from true bid/ask tick data. Volume quality varies by broker and instrument, so the same symbol on different feeds can produce different signals.
- The classifier needs a warmup period before signals appear; on fresh charts or low-history symbols it may stay in WARMUP for a long time.
- Posteriors and CVD update intrabar; without bar-close confirmation enabled, signals can appear and disappear before a bar closes.
- SL/TP lines and price labels are visual references only — they do not place or manage trades.
- Filters reduce noise but also reduce signal count; in fast trends the cooldown may delay otherwise valid entries.
- Past performance does not guarantee future results. This indicator is for educational and analytical purposes only and is not financial advice. Always use proper risk management and test on historical data before trading live.
Credits & Attribution
Based on "Institutional Order Flow Signals " by PMT, which provided the CVD construction, the three z-score-normalised classifier features (CVD ROC, price/flow divergence, CVD slope), the online Naive Bayes classifier over Bull/Bear/Diverged classes with Gaussian likelihoods, the posterior-threshold entry logic with trend-EMA and CVD agreement, the confidence tiers, the posterior band and regime background, and the ATR-based SL/TP projection lines. Added by Viprasol: signal cooldown, volume-surge confluence filter, bar-close confirmation gate, live classifier hit-rate tracking, regime-flip detection and alert, the surfaced Diverged-class posterior, TP/ENTRY/SL price labels, an expanded dashboard, and a six-condition dynamic alert set.
Published open-source per PulseWire House Rules.
Indicator

Market State Forecast Projection EngineThis indicator is a **forecast projection tool**. It looks at the current market environment, searches history for the most similar environments, then plots what usually happened afterward. It is not trying to predict the future with certainty. It is saying: “When the market looked like this before, what tended to happen next?”
The engine defines the current market environment using three things:
* **Trend**, based on moving averages.
* **Momentum**, based on RSI.
* **Volatility**, based on ATR.
Then it finds the closest historical matches, studies their future paths, and draws a forecast line with optional upper and lower bands.
---
## What You See on the Chart
### Forecast Midline
The main forecast line shows the **average path** of the selected historical matches.
In simple terms:
* If similar past situations usually moved higher, the line slopes up.
* If similar past situations usually moved lower, the line slopes down.
* If similar past situations were mixed, the line may be flat or choppy.
### Upper Band
The upper band shows the stronger side of historical outcomes.
It means:
* Some similar historical setups moved better than the average.
* The upper band gives you a visual idea of the upside range from those past examples.
* It is not a guaranteed target.
### Lower Band
The lower band shows the weaker side of historical outcomes.
It means:
* Some similar historical setups moved worse than the average.
* The lower band gives you a visual idea of downside risk from those past examples.
* It is not a guaranteed support level.
### Band Width
The space between the bands matters.
* Tight bands mean historical outcomes were more consistent.
* Wide bands mean historical outcomes were scattered and less reliable.
* A forecast with wide bands should be treated with more caution.
---
## Main Inputs
### Non-Repaint Mode
**Default: On**
This controls whether the forecast uses the live candle or the last completed candle.
Use **Non-Repaint Mode On** when:
* You want more stable signals.
* You want the forecast to update only after the candle closes.
* You care about cleaner historical testing.
Use **Non-Repaint Mode Off** when:
* You want the forecast to react during the current live candle.
* You accept that the forecast may change before the candle closes.
For most use cases, leave this **On**.
---
## Model Group
### Forecast Horizon
This controls how far into the future the indicator projects.
Example:
* On a daily chart, `20` means 20 trading days.
* On a 1-hour chart, `20` means 20 hours.
* On a 5-minute chart, `20` means 20 five-minute candles.
Use a lower value when:
* You are trading short-term moves.
* You want a tighter forecast window.
* You do not want the projection stretched too far.
Use a higher value when:
* You are looking for swing-trade context.
* You want to see the broader projected path.
* You are using higher timeframes.
A practical range is usually:
* `10–20` for shorter-term analysis.
* `20–50` for swing-style analysis.
---
### Search Depth
This controls how much history the engine searches.
Example:
* `1000` means the engine searches roughly 1,000 prior bars.
* `2000` means it searches more history.
* `500` means it searches less history.
Use a higher Search Depth when:
* You want a larger historical sample.
* You are on a short timeframe with lots of bars.
* You want more possible market-state comparisons.
Use a lower Search Depth when:
* You want the model to focus on more recent market behavior.
* You are on a slower chart like daily or weekly.
* You want less influence from older market regimes.
The tradeoff is simple:
* More history gives more examples.
* Less history may be more relevant to the current market regime.
---
### Pattern Matches
This controls how many of the closest historical matches are used.
This is one of the most important inputs.
If set to `30`, the engine finds the **30 closest historical market states** and builds the forecast from those.
Use fewer matches when:
* You want stricter, more specific comparisons.
* You want only the closest historical examples.
* You are okay with a forecast that may be more reactive.
Use more matches when:
* You want a smoother forecast.
* You want less noise from individual examples.
* You want a broader historical sample.
General interpretation:
* `10–20` = stricter, more selective.
* `25–40` = balanced.
* `50+` = broader, smoother, but less specific.
---
### Weight Closer Matches
This controls whether the best matches receive more influence.
When turned **On**:
* The closest historical matches matter more.
* Weaker matches still count, but less heavily.
* The forecast becomes more focused on the most similar examples.
When turned **Off**:
* Every selected match is treated equally.
* The forecast becomes more democratic.
* A very close match and a weaker match have the same influence.
For most users, leave this **On**.
---
## Advanced Model Inputs
### Forecast Model
This chooses how the engine defines the market environment.
All models use:
* EMA trend.
* RSI momentum.
* ATR volatility.
The difference is how each model emphasizes those ingredients.
---
### Conservative
Use **Conservative** when you want a slower, smoother model.
It is designed to:
* React less aggressively.
* Favor more stable market environments.
* Put more importance on trend and volatility.
* Reduce noisy forecast changes.
Best for:
* Daily charts.
* Swing trading.
* Slower-moving stocks or ETFs.
* Users who want fewer false shifts.
---
### Balanced
Use **Balanced** as the general-purpose default.
It is designed to:
* Give trend, momentum, and volatility a normal balance.
* Work across many markets.
* Avoid being too slow or too fast.
Best for:
* Most users.
* Most chart timeframes.
* General market forecasting.
* Starting point before testing other models.
---
### Aggressive
Use **Aggressive** when you want a faster model.
It is designed to:
* React more quickly to changing momentum.
* Give more influence to short-term market shifts.
* Be more sensitive to fresh moves.
Best for:
* Intraday trading.
* Fast-moving markets.
* Crypto.
* Momentum names.
* Traders who want earlier, more responsive shifts.
The downside is that it may be noisier.
---
### Trend Following
Use **Trend Following** when you want the model to emphasize persistent directional moves.
It is designed to:
* Care more about trend structure.
* Care less about short-term momentum noise.
* Favor markets that continue moving in the same direction.
Best for:
* Strong trending stocks.
* Indexes.
* Breakout environments.
* Higher-timeframe directional trading.
This model is less ideal in sideways or choppy markets.
---
### Mean Reversion
Use **Mean Reversion** when you want the model to focus on stretched conditions.
It is designed to:
* Emphasize momentum extremes.
* Look for environments where price may snap back or reverse.
* Care less about long-term trend persistence.
Best for:
* Range-bound markets.
* Overbought/oversold setups.
* Countertrend analysis.
* Shorter-term reversal ideas.
This model may fight strong trends, so use it carefully in momentum-heavy markets.
---
## Historical Lookback Inputs
### Lookback Bars
This lets you move the forecast backward in time.
Example:
* `0` means current forecast.
* `50` means show what the forecast would have looked like 50 bars ago.
* `250` means show what the forecast would have looked like 250 bars ago.
Use this for:
* Visual backtesting.
* Studying old setups.
* Checking whether the forecast was useful historically.
* Comparing forecast paths against what actually happened.
This is one of the most valuable testing features.
---
### Lock to Candle
This lets you anchor the forecast to a specific candle time instead of a simple bar offset.
Use it when:
* You want to test a specific time of day.
* You trade a regular session open.
* You want repeatable historical anchors.
Example:
* You can lock to the 13:30 UTC candle, which often corresponds to the U.S. stock market open during daylight saving time.
When this is off, the indicator uses **Lookback Bars** instead.
---
### Days Back
This works with **Lock to Candle**.
It tells the indicator how many matching anchor candles to go back.
Example:
* `0` = most recent matching candle.
* `1` = one matching session back.
* `2` = two matching sessions back.
Use this when:
* You want to test the most recent open.
* You want to test yesterday’s open.
* You want to step through past sessions one by one.
---
### Hour UTC
This is the UTC hour used for candle locking.
Use it with **Minute UTC** to identify the exact candle you want.
Example:
* `13` means 13:00 UTC.
* Combined with `30`, it means 13:30 UTC.
This is useful because PulseWire symbols and sessions can vary, but UTC gives a consistent anchor.
---
### Minute UTC
This is the UTC minute used for candle locking.
Example:
* Hour UTC = `13`
* Minute UTC = `30`
Together, that means:
* Lock to the 13:30 UTC candle.
Use this for precise historical testing.
---
### Auto Previous Session
This controls what happens if today’s target candle has not printed yet.
When turned **On**:
* The indicator automatically uses the most recent previous matching candle.
* This keeps the forecast visible even before today’s target time exists.
When turned **Off**:
* If today’s target candle has not printed, the lock may show no match and fall back.
For most users, leave this **On**.
---
## Bias Logic Inputs
### Bias Threshold %
This controls how strong the bull or bear probability must be before the indicator labels the forecast bullish or bearish.
Example:
* If Bias Threshold is `60`, Bull Probability must be at least 60% before a bullish label can appear.
* If Bear Probability is at least 60%, a bearish label can appear.
Use a lower threshold when:
* You want more frequent bias labels.
* You are okay with weaker directional evidence.
Use a higher threshold when:
* You want stricter signals.
* You only want stronger historical agreement.
Practical range:
* `60%` = balanced.
* `70%+` = more conservative.
* `50–55%` = loose and more signal-heavy.
---
### Minimum Bull/Bear Edge %
This controls how large the gap must be between Bull Probability and Bear Probability.
Example:
* Bull Probability = 65%
* Bear Probability = 35%
* Edge = 30 percentage points
If the minimum edge is `15`, this would qualify.
But:
* Bull Probability = 58%
* Bear Probability = 42%
* Edge = 16 percentage points
This may still fail if Bull Probability is below the Bias Threshold.
This input prevents weak differences from being labeled as strong directional bias.
Use a higher edge when:
* You want cleaner bias labels.
* You want the model to avoid borderline calls.
Use a lower edge when:
* You want more frequent directional bias.
* You accept more uncertainty.
---
## Display Inputs
### Show Forecast Midline
This turns the main forecast line on or off.
Turn it **On** when:
* You want to see the projected average path.
Turn it **Off** when:
* You only want the info box probabilities.
* You want a cleaner chart.
---
### Show Confidence Bands
This turns the upper and lower forecast bands on or off.
Turn it **On** when:
* You want to see the historical range of outcomes.
* You care about uncertainty.
* You want to know whether the forecast is tight or messy.
Turn it **Off** when:
* You only want the central forecast.
* The chart feels too cluttered.
---
### Band Width Multiplier
This controls how wide the bands are.
Higher values make the bands wider.
Lower values make the bands tighter.
Use lower values when:
* You want a cleaner, tighter visual range.
* You want bands closer to the average forecast.
Use higher values when:
* You want to see a broader range of historical outcomes.
* You want a more conservative uncertainty envelope.
Default `1.0` is a good starting point.
---
## Forecast Midline Style Inputs
### Forecast Midline Color
Controls the color of the main projection line.
The default aqua color makes it visually distinct from price candles.
### Forecast Midline Width
Controls how thick the midline is.
Use a thicker line when:
* You want the forecast to stand out.
* You are using a busy chart.
Use a thinner line when:
* You want a cleaner chart.
* You use many overlays.
### Forecast Midline Type
Controls whether the line is:
* Solid.
* Dashed.
* Dotted.
Solid is usually best for the main forecast line.
---
## Upper Band Style Inputs
### Upper Band Color
Controls the color of the upper forecast band.
The default green tone suggests upside range.
### Upper Band Width
Controls how thick the upper band is.
A thin dashed line usually works best because it should be secondary to the midline.
### Upper Band Type
Controls whether the upper band is solid, dashed, or dotted.
Dashed is usually best because it visually communicates “range” rather than “target.”
---
## Lower Band Style Inputs
### Lower Band Color
Controls the color of the lower forecast band.
The default red tone suggests downside range.
### Lower Band Width
Controls how thick the lower band is.
A thin line keeps it useful without dominating the chart.
### Lower Band Type
Controls whether the lower band is solid, dashed, or dotted.
Dashed is usually best for the same reason as the upper band.
---
## Info Box Inputs
### Show Info Box
This turns the dashboard on or off.
Turn it **On** when:
* You want the probabilities and diagnostics visible.
* You are actively evaluating the forecast.
Turn it **Off** when:
* You only want the chart projection.
* You want a cleaner visual layout.
---
### Info Box Position
Controls where the dashboard appears.
Options:
* Top Left.
* Top Right.
* Bottom Left.
* Bottom Right.
Use the position that interferes least with price action on your chart.
---
### Text Size
Controls the dashboard text size.
Use:
* **Tiny** for compact charts.
* **Small** for normal use.
* **Normal** if you want easier reading.
* **Large** for presentations or large monitors.
---
### Background
Controls the info box background color.
A darker background usually works best on most PulseWire chart themes.
### Border
Controls the info box border color.
This helps separate the dashboard from the chart.
### Header Text
Controls the title/header text color.
### Header Background
Controls the top header row background.
This gives the dashboard its polished look.
---
## Info Box Metrics
### Bull Prob %
This shows the weighted percentage of selected historical matches that ended bullish.
Simple meaning:
> Of the similar historical market states, how many tended to move up?
A high number means bullish outcomes dominated the selected historical matches.
---
### Bear Prob %
This shows the weighted percentage of selected historical matches that ended bearish.
Simple meaning:
> Of the similar historical market states, how many tended to move down?
A high number means bearish outcomes dominated the selected historical matches.
---
### Direction Bias
This shows the final label after applying the bias rules.
Possible outputs:
* Bullish.
* Bearish.
* None.
* Weak Data.
* No Matches.
A bullish or bearish label only appears when the probability and edge requirements are met.
---
### Bull/Bear/Flat
This shows how many selected matches ended:
* Bullish.
* Bearish.
* Flat.
Example:
* `18 / 9 / 3`
This means:
* 18 bullish historical outcomes.
* 9 bearish historical outcomes.
* 3 flat historical outcomes.
This gives you a quick look at the underlying distribution.
---
### Match Count
This shows how many historical matches were actually used.
If Pattern Matches is set to `30`, Match Count should usually show `30`.
If it shows less, there may not have been enough valid historical data.
---
### Fit Quality
This tells you how closely the selected historical matches resemble the current market state.
High Fit Quality means:
* The current market environment closely resembles the selected historical examples.
Low Fit Quality means:
* The engine found matches, but they were not very close.
Important:
* Fit Quality is not win rate.
* Fit Quality is not probability.
* Fit Quality is not accuracy.
* It only measures how good the historical comparisons are.
Best interpretation:
* High Fit Quality + strong Bull/Bear Probability = more compelling.
* High Fit Quality + split probabilities = similar markets existed, but outcomes were mixed.
* Low Fit Quality = be cautious.
---
### Model
This shows which Forecast Model is active.
Examples:
* Balanced.
* Conservative.
* Aggressive.
* Trend Following.
* Mean Reversion.
This is useful for screenshots and reviewing past setups.
---
### Anchor
This tells you where the forecast is anchored.
Examples:
* `0 bars · NR` means current forecast using Non-Repaint Mode.
* `50 bars · NR` means historical forecast from 50 bars ago.
* `Locked` means it is anchored to a specific UTC candle.
This helps you know whether you are looking at a current forecast or a historical replay.
---
### Search Depth
This shows the actual number of bars being searched.
It may be lower than your input if the chart does not have enough loaded history.
---
## Best Practical Way to Use It
A clean workflow would be:
* Start with **Balanced** model.
* Keep **Non-Repaint Mode On**.
* Use **Pattern Matches around 30**.
* Use **Search Depth around 1000**.
* Watch **Fit Quality**.
* Watch **Bull/Bear Probability**.
* Treat the forecast line as a scenario path, not a guaranteed prediction.
* Use **Lookback Bars** to test whether the forecast was historically useful.
* Avoid trusting any forecast where the bands are very wide and probabilities are split.
The strongest setup is usually when:
* Fit Quality is high.
* Bull or Bear Probability is clearly dominant.
* The forecast bands are not extremely wide.
* The projection agrees with price structure.
Indicator
