אינדיקטור

Wyckoff Architectural Range - erdensedatThe "Wyckoff Architectural Probability Range" is an advanced, non-overlapping consolidation detector and liquidity sweep identification system. Designed to keep charts clean, it dynamically adapts to market volatility and focuses solely on the current active trading range.
Key Features:
- Dynamic ATR-Based Range Width: The indicator automatically adjusts its maximum allowed range width based on the asset's current volatility, ensuring it works seamlessly across both major assets (BTC, ETH) and highly volatile altcoins.
- Non-Overlapping Architecture: Historical ranges are completely removed upon a confirmed breakout, leaving only the active, actionable consolidation zone on your chart.
- Premium & Discount Zones: The range is mathematically divided into Premium (Top 25%), Equilibrium (Middle 50%), and Discount (Bottom 25%) zones. Internal EQ levels (0.4 and 0.6) are also projected.
- Advanced Retest Signals:
> Buy Signal: Prints when price crosses below the Discount EQ and subsequently retests and closes above it.
> Sell Signal: Prints when price crosses above the Premium EQ and subsequently retests and closes below it.
- Smart Liquidity Detection (Spring & UTAD): Automatically identifies and labels wick-based liquidity sweeps outside the range.
- Mean Reversion Probability: A dynamic stats panel calculates the mean reversion probability based on the current deviation from the main Equilibrium level.
- Built-in Alert System: Provides any() alert conditions for Buy/Sell signals, Spring/UTAD sweeps, and Range Breakouts.
- Optional VWAP: Toggle a standard VWAP line on or off directly from the settings for additional confluence.
How to Use:
Use the statistical panel and structural boxes to identify institutional accumulation (Discount Zone) and distribution (Premium Zone). Wait for confirmed retest signals (Triangles) or liquidity sweeps (Spring/UTAD) for high-probability mean-reversion entries.
Disclaimer:
The information and scripts provided in this indicator are for educational and informational purposes only and do not constitute financial advice. Trading cryptocurrencies, forex, and other financial markets involves a high degree of risk and may not be suitable for all investors. Past performance is not indicative of future results. Always conduct your own research and consult with a certified financial advisor before making any trading decisions.
אינדיקטור

Anchored VWAP Engine [Quantum Algo]Anchored VWAP Engine
====================================================
🔶 OVERVIEW
Anchored VWAP Engine is a multi-stream anchored Volume Weighted Average Price indicator that removes the hardest part of trading with anchored VWAP: choosing the anchor. The engine runs up to seven independently anchored VWAP streams that place and reset their own anchors automatically — the week open (the default stream), session open, month open, confirmed swing highs and swing lows, the highest-volume bar in a lookback, and a liquidity-sweep anchor that re-anchors from the exact bar where a stop run occurred. On top of the streams it adds volume-weighted deviation bands, automatic confluence cluster zones where multiple streams converge, band-rejection signals, and a stability metric that names which VWAP the market is currently respecting most.
Out of the box the chart shows a single clean line: the week-anchored Volume Weighted Average Price with its deviation bands. Every additional stream is one checkbox away.
🔶 WHAT IS AN ANCHORED VWAP?
The Volume Weighted Average Price is the average price of an instrument weighted by traded volume — the closest public approximation of the average position price of everyone who transacted since a chosen starting point. An anchored VWAP starts that calculation from a meaningful event rather than an arbitrary date: a weekly open, a swing low, a high-volume climax bar. Price above an anchored VWAP means the average participant since that event is in profit; price returning to it often behaves as a decision level, because it is where the average position breaks even. The power of the tool depends entirely on where it is anchored — which is exactly what this engine automates.
🔶 WHY THIS SCRIPT IS ORIGINAL
1. Automatic multi-anchor engine. Seven streams anchor and re-anchor themselves from objectively defined events — no manual anchor placement, no stale anchors, no guessing.
2. The liquidity-sweep anchor. When a swing level is wicked through and rejected — a stop run — the sweep stream re-anchors from that exact bar and colors itself by implication: the accumulation tone after a sell-side sweep, the distribution tone after a buy-side raid. Averaging from the stop-run bar tracks the entry basis of the participants who engineered it. To our knowledge this anchor type has not been published before.
3. Exact swing anchoring. Swing-anchored streams rebuild their sums retroactively from the true pivot bar once the pivot confirms, so the calculation is mathematically identical to a VWAP hand-anchored on the swing itself — not started late at the confirmation bar.
4. Confluence clusters. When two or more active streams converge within an Average True Range tolerance, the engine draws a cluster zone and labels its strength. Multiple independent volume-weighted averages agreeing on one price is the strongest form of VWAP confluence, detected automatically.
5. The In Control metric. An exponentially decayed crossing-rate measures how cleanly price is respecting each stream; the dashboard names the stream currently in control. Users learn which anchor matters today instead of watching all of them equally.
6. True volume-weighted deviation bands. The bands are built from the volume-weighted variance of the primary stream — not a simple price standard deviation — at two configurable widths, with band-rejection signals printed as a single σ character whose full context lives in the hover tooltip, protected by a signal cooldown.
7. Quiet by default. One stream, one set of bands, capped signals, and a compact dashboard. The engine detects everything; the chart shows only what is asked of it.
🔶 HOW IT WORKS
Streams: Each stream maintains volume-weighted price and variance sums that reset on its anchor event — new week, new session, new month, a confirmed swing, a lookback volume record, or a qualified liquidity sweep. Between events the sums accumulate bar by bar, producing the stream's live anchored VWAP.
Sweep detection: A sweep qualifies when price wicks through the last confirmed swing level but closes back inside it, with per-level memory so the same level cannot re-trigger. The sweep stream then re-anchors from that bar.
Deviation bands: The primary stream (selectable; week open by default) carries inner and outer bands at configurable sigma multiples computed from its own volume-weighted variance, with softly tinted zones between them.
Signals: A wick beyond the outer band with a close back inside, on the correct side of the VWAP, prints the σ rejection signal — reversion bias toward the average — evaluated on closed bars only and rate-limited by the cooldown.
Clusters: On the live bar the engine groups all active stream values within the tolerance and draws a labeled zone for each group of two or more.
Dashboard: A fully themeable panel lists every stream with its live distance from price in Average True Range units and side, plus the In Control stream, active cluster count, and the current band width.
Non-repainting: Anchors use confirmed events, sweeps and signals are evaluated at bar close, and swing streams rebuild exactly rather than approximately.
🔶 HOW TO USE IT
1. Works on any market with reliable volume — cryptocurrency, stocks, indices, futures. On the default settings, read the week-anchored VWAP as the institutional benchmark: above it with rising distance means the average weekly participant is in profit.
2. Treat the VWAP itself as the decision level and the outer bands as stretch: σ rejections at the outer band carry a reversion bias back toward the average.
3. Enable the swing and sweep anchors to study reactions: price returning to a sweep-anchored VWAP is returning to the average entry of the stop-run — a level worth watching.
4. Cluster zones are the highest-value levels the engine produces: several independent volume-weighted averages agreeing on one price. Watch how price behaves on first touch.
5. Use the In Control row to pick which stream deserves your attention today, and the distance column to see what is nearby before it is hit.
6. Intraday traders can switch the primary stream to Session Open; swing traders can promote Month Open.
🔶 SETTINGS
- Anchors: independent toggles for all seven streams, swing pivot length, highest-volume lookback. Default: Week Open only.
- Primary stream selection with inner and outer band multiples.
- Cluster detection with Average True Range tolerance.
- Signals: toggle, cooldown, and signals to keep.
- Individual colors for every stream plus accent and neutral colors.
- Themeable dashboard: position, four text sizes, title band, background, frame, grid, and three text colors.
🔶 ALERTS
- Bullish / Bearish Band Rejection — price rejected the outer deviation band of the primary stream.
- Price Crossed Above / Below Primary VWAP.
- VWAP Cluster Formed — two or more streams converged into a confluence zone.
- Sweep Anchor Reset — a liquidity sweep occurred and the sweep stream re-anchored from the stop-run bar.
🔶 FREQUENTLY ASKED QUESTIONS
Does the indicator repaint? No. Anchor events are confirmed before they act, swing streams rebuild exactly from the confirmed pivot bar, and signals are evaluated on closed bars. Swing confirmation carries its standard pivot lag by design.
Why do I only see one line? By default only the week-anchored stream is enabled for a clean first chart. Every other anchor is a checkbox in settings.
What makes the sweep anchor special? It averages price and volume from the exact bar where stops were run — the basis of the participants who engineered the move — rather than from a calendar date or swing alone.
Why is there no cluster or In Control reading? Both features compare multiple streams; enable two or more anchors and they activate.
Which markets should avoid it? Any Volume Weighted Average Price tool is only as good as the volume feed. On symbols with unreliable or synthetic volume reporting, treat every stream with caution.
🔶 CREDITS
The Volume Weighted Average Price was introduced by Stephen Berkowitz, Dennis Logue and Eugene Noser (1988), and the anchored application was popularized by Brian Shannon, whose work established anchoring from meaningful events as a discipline. This script gratefully acknowledges both. The multi-stream auto-anchoring engine, the liquidity-sweep anchor, the exact retroactive swing rebuild, confluence clustering, the In Control stability metric, and all code in this script are original work — no third-party or open-source script code was reused.
🔶 LIMITATIONS
Volume quality determines VWAP quality; symbols with unreliable volume produce unreliable averages. Deviation bands need bars to mature after each re-anchor. Cluster detection reports convergence, not a guarantee of reaction. The In Control metric measures recent respect, not future behavior. No indicator replaces independent analysis.
🔶 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 behavior of any average, band, or cluster does not guarantee future results. Trading involves substantial risk. Always do your own research and manage risk independently. אינדיקטור

Market Regime Engine [NQ Labs] WHAT THIS ANSWERS
Almost every indicator tells you WHAT the market is doing. Very few tell you
whether the current market has enough exploitable structure to be worth
risking money on at all. The Market Regime Engine is built for that second
question: should I be trading this right now, and if so, what style of
approach do current conditions actually favour?
It is not a signal generator. It produces no entries. It is a filter you run
underneath whatever you already trade.
WHY IT IS BUILT THIS WAY
Two design decisions separate this from a conventional regime or trend filter.
1. EVERY AXIS IS PERCENTILE-RANKED AGAINST ITS OWN HISTORY.
Most regime tools use fixed thresholds - an ADX of 25, an ATR multiplier of 3.
Those numbers are calibrated to whatever the author tested on. They are the
reason a tool behaves sensibly on one instrument and nonsensically on the
next. Here, each axis is ranked against its own recent distribution on the
current symbol and timeframe, so a 65th-percentile reading carries the same
meaning on a crypto pair as it does on an FX major. Nothing needs retuning
per market.
2. THE THREE AXES ARE ORTHOGONAL BY DESIGN.
Many "confluence" tools stack three views of momentum and present the
agreement as confirmation. Correlated inputs agreeing is not evidence. These
three measure genuinely different properties:
DIRECTIONAL EFFICIENCY - net distance travelled divided by the total path
walked to get there. A value near 1 is a straight line. A value near 0 means
price ended where it started after a great deal of work. This is the most
direct available answer to "is there a trend here", and it is independent of
direction.
VOLATILITY STATE - ATR ranked against its own history. Not "is volatility
high" in absolute terms, but "is volatility high for this instrument".
RETURN PERSISTENCE - lag-1 autocorrelation of log returns. Positive means an
up bar tends to be followed by an up bar, so momentum approaches have
something to work with. Negative means the market reverts. Near zero means
returns carry no usable memory.
THE SCORING LOGIC
The Tradeability Score (0-100) rests on one idea:
Efficiency is the signal. Volatility is the cost of being wrong.
Volatility only hurts you when there is no direction to exploit.
So the noise penalty is the product of how little direction exists and how
violent the market is. It approaches zero inside a strong trend no matter how
wild conditions get - because volatility inside a trend is opportunity, not
noise - and it peaks precisely where traders are most reliably ground down:
low efficiency combined with high volatility. That specific combination is
what the engine exists to flag.
THE FIVE REGIMES
TREND Efficiency high. Directional. Follow it.
VOLATILE CHOP Efficiency low, volatility high. No direction, maximum cost
of being wrong. The state that does the damage.
COIL Efficiency low, volatility low. Compression. Wait.
RANGE Efficiency low, volatility middling. Edges are tradeable.
TRANSITION Efficiency mid-range. No clean read. Reduce size.
A raw regime read must hold for a configurable number of consecutive bars
before it is confirmed. Without that filter, readings that straddle a
threshold flip back and forth for single bars.
REGIME MATURITY - THE PART I HAVE NOT SEEN ELSEWHERE
The engine records the length of every completed regime run on the current
chart and reports the current run against that learned baseline, together with
the sample size behind it.
A trend at 0.3x its typical duration and a trend at 2.4x are not the same
trade, even though every conventional indicator prints the identical reading
for both. A compression that has lasted three times longer than compressions
normally last on this instrument is a different proposition to one that
started six bars ago.
The sample size (n=) is shown deliberately. Below the configured threshold the
cell dims, because a baseline built from two observations is not evidence and
should not be dressed up as though it were.
HOW TO USE IT
The engine is a gate, not a trigger. The intended workflow:
1. Read the Verdict first. STAND DOWN means your edge, whatever it is, is
probably not present. The most valuable output of this tool is the trades
it talks you out of.
2. Read the Regime and Favoured Style. Trend-following systems belong in
TREND. Mean-reversion belongs in RANGE, and only when Persistence confirms
the market is actually reverting rather than merely quiet. COIL means the
setup has not arrived yet. VOLATILE CHOP means nothing you own works here.
3. Read Persistence before choosing an approach. If it reads Random, the
market has no memory to exploit in either direction, and both momentum and
mean-reversion are coin flips.
4. Use vs Typical for position management, not entry. An extended regime is
not a reversal signal. It is a reason to stop adding and to tighten what
you already hold.
5. Let the ribbon and score do the work on the price chart. The dashboard can
be forced onto the main pane so the engine occupies a pane without costing
you chart real estate.
SETTINGS THAT ACTUALLY MATTER
RANKING LOOKBACK is the important one. It must span several complete regime
cycles on your timeframe or every axis will rank near the middle and
everything will read TRANSITION. 250 bars on a daily chart is roughly a year -
a real baseline. 250 bars on a 5-minute chart is under a day, and is not.
On intraday timeframes, raise it substantially.
MINIMUM REGIME RUN trades responsiveness for stability. Higher values give a
calmer read and a cleaner duration baseline at the cost of confirming changes
later. Set it to 1 to see the unfiltered classification.
CHOP PENALTY controls how hard low-efficiency volatility is punished. Set it
to 0 and the score becomes pure efficiency rank.
EFFICIENCY and VOLATILITY thresholds are percentiles, not raw values. They do
not need adjusting per instrument. That is the point.
LIMITATIONS - STATED PLAINLY
- This is a lagging, descriptive tool. It classifies conditions that have
already formed. It does not forecast, and it cannot tell you a regime is
about to end.
- Confirmation costs lag. A genuine regime change registers a few bars late by
design. That is the price of not flickering.
- The maturity baseline is learned from visible chart history and rebuilds
whenever settings, symbol, or timeframe change. It is not persistent memory.
Early in a chart, or for a rarely-occurring regime, the sample is thin. The
n= value tells you when to discount it.
- On intraday equity charts, overnight gaps inflate ATR and distort the
persistence reading. Daily and above, or extended hours, handle this better.
- Autocorrelation is a weak statistic on short samples. Persistence readings
close to zero should be read as "no information", not as a subtle signal.
- Efficiency is directionless. TREND tells you a trend exists, not which way
it points. Pair it with something that reads direction.
- No regime classification is correct at the moment it matters most, which is
the turn. Nothing here changes that.
This script is open-source. Read the code, disagree with it, improve it.
This is an analytical tool for studying market conditions. It is not financial
advice, and it does not generate trade recommendations. Trading involves risk
of loss. אינדיקטור

VWAP Suite I EonMetricsVWAP Suite
VWAP Suite plots three independently anchored Volume-Weighted Average Price lines — Session, Weekly and Monthly — with volume-weighted deviation bands and the previous period's VWAP close kept on the chart as a reference level. Everything is computed from first principles at each anchor, so every line resets exactly where its period starts.
🔶 WHAT VWAP IS
VWAP is the average price of the period weighted by how much volume traded at each price. It answers one question: "what is the fair average price actually paid since the anchor?" That is why institutional execution desks benchmark fills against it, and why price so often reacts when it returns there — it is the level where the average participant in the period is at break-even. Above the VWAP the average buyer of the period is in profit; below it, under water.
🔶 WHAT IT DOES
Three anchors — Session (resets each trading day), Weekly and Monthly VWAP, each with its own toggle and color. Intraday traders typically work with Session, swing traders add Weekly, and Monthly serves as the higher-timeframe fair-value reference. Anchors that make no sense on the current chart timeframe (e.g. a Session VWAP on a daily chart) hide themselves automatically.
Deviation bands — ±1σ, ±2σ and optional ±3σ around ONE chosen anchor. The deviation is volume-weighted and anchored to the same period as the VWAP it wraps — not a rolling standard deviation — which is the statistically consistent way to band a VWAP (the same math TradingView's built-in VWAP bands use). ±2σ is the classic stretched-price reference; the optional gradient fill keeps the zones readable without clutter.
Previous VWAP Close — the exact level where the Session (or Weekly) VWAP finished its previous period, drawn flat through the current one. The same idea as previous day high/low, but volume-based: yesterday's fair price is a natural magnet and reaction level for today. Few VWAP tools carry this level forward — it is the reason this suite exists.
🔶 HOW IT IS CALCULATED
From each anchor the script accumulates three sums bar by bar: volume × price, volume, and volume × price². VWAP = Σ(volume × price) / Σ(volume). The band deviation comes from the volume-weighted variance Σ(volume × price²)/Σ(volume) − VWAP². At every period rollover the previous VWAP value is captured first, then the sums reset to zero. Values only update on confirmed data — there is no repainting logic anywhere in the script.
🔶 ALERTS
Seven alert conditions: price crossing each of the three VWAPs, price touching the +2σ or −2σ band, and price crossing the previous Session or previous Week VWAP close.
🔶 HOW TO USE
1. Pick your anchors — Session for intraday, add Weekly for swing context.
2. Choose which anchor carries the deviation bands (Bands Around).
3. Keep Previous Session VWAP on — reactions at yesterday's fair price are the cleanest thing this tool shows.
4. Set alerts on the crossings you actually trade around.
🔶 SETTINGS
Source (price input, hlc3 default) · Anchors (Session / Weekly / Monthly, each with color) · Deviation Bands (anchor selector, ±1σ/±2σ/±3σ toggles, gradient fill) · Previous VWAP Close (Session / Weekly levels).
🔶 HONEST LIMITATIONS
On CFDs and spot forex the data feed reports TICK volume (number of price updates), not true traded volume. VWAP built on tick volume is still the standard practice on those markets and tracks the real one closely on liquid symbols, but you should know what feeds the math. On symbols with no volume data at all the script deliberately shows nothing rather than fake a line. VWAP is a descriptive average, not a prediction — this tool draws levels, it does not generate signals.
Part of the EonMetrics toolset.
אינדיקטור

Auto Trend Channel & Breakout Expectancy in ROVERVIEW
An auto-drawn trend channel is easy. Knowing whether breaking it has ever paid on YOUR symbol is not — and it is the only thing that matters.
This tool draws the channel objectively and then does the part nobody else does: it forward-resolves every historical break through a real target and stop, and reports, in R, what breaks like the current one have actually returned. Not a prediction. A track record.
Expectancy exp +1.24R · need 15% @ RR 6.0
HV win/loss 38/59% n400 ✓
MV win/loss 32/65% n150 ✓
LV win/loss 17/83% n55
Null / net net 1.29R t=3.1 ✓
It is a research and framing tool. NOT a strategy, NOT a signal service, NOT a validated edge.
HOW THE CHANNEL IS BUILT — objectively, no hand-placed anchors
The support and resistance lines come from a CONVEX HULL over confirmed pivots, not from two points a human chose. The opposite boundary is drawn parallel, and the channel WIDTH becomes the measured-move target. Because the construction is mechanical, the same rule produces the same channel on every symbol and every timeframe — there is nothing to curve-fit.
HOW A BREAK IS GRADED — and why volume is split three ways
A break is a confirmed CLOSE beyond the boundary. Every break is then sorted by its break-bar volume percentile into HV / MV / LV (high / medium / low), and each tier is calibrated SEPARATELY.
That split is the point. "Breakouts need volume" is repeated everywhere and tested almost nowhere. Here you can read straight off the panel whether heavy breaks on your instrument actually pay more than thin ones — and often they do not, which is worth knowing before you wait for a volume confirmation that costs you the entry.
THE FORWARD TEST — expectancy in R, on identical geometry
Every break is resolved through a triple barrier: a target at the channel-width move, a stop at a fixed ATR distance, and a horizon. Win, loss, or chop. The expectancy is the exact realized R per trade — a win contributes +RR, a loss contributes −1, chop contributes 0 — so the win rate and the R:R are on the SAME footing, computed from the same resolved trades. There is no mixing of a win rate from one calculation with an R:R from another.
The R:R shown is the target-to-stop RATIO, and it is deliberately not the headline. A 6:1 target sounds wonderful and is reached maybe a third of the time; quoting it alone flatters a low-hit-rate system. So the panel leads with the realized EXPECTANCY, then states the breakeven win rate the geometry requires, then shows the win rate actually achieved. Expectancy first, because expectancy is the thing that is actually true.
Nothing is rated until a tier has at least 30 resolved trades. Below that, no checkmark, no verdict, no meta call — a Wilson floor on a dozen trials is too wide to certify anything, and pretending otherwise is how bad tiers get a green tick.
THE RANDOM-DIRECTION NULL — the honesty check
Here is the trap this defends against. A 6:1 target with a nearby stop is an asymmetric payoff, and on a drifting instrument an asymmetric payoff makes money in a RANDOM direction — the geometry earns, not the signal. So for every real break the script ALSO runs a coin-flip-direction trade with the identical target and stop, and reports its expectancy alongside.
If the null earns as much as the signal, the "edge" is just the geometry capturing drift, and you should believe the null. And it is now TESTED, not just displayed: a Welch t between the signal's realized-R distribution and the null's turns "net 1.29R" into "net 1.29R, t = 3.1, real" — or into "ns", not significant, which is the more common and more honest outcome.
THE OPTIONAL META-LABEL — a learned second opinion
An online logistic model trains on this script's own resolved outcomes and outputs a calibrated probability of follow-through for the current break. No hand-tuned weights; it self-corrects as more breaks resolve, and it reports its own reliability (the realized win rate inside each probability bin) so you can see whether its confidence is earned. It is off by default and it never overrides the forward test — it is a second opinion, not the verdict.
THE ANTI-BIAS GUARDS
ENTRY IS THE CLOSE (or, in retest mode, the line touch) — a break is a signal, not a fill, and entering at a better price than the trade actually offered would manufacture an edge.
Both barriers on one bar: the STOP is assumed first — conservative, and the only assumption that cannot flatter the result. Unresolved trades at the horizon are scored as chop (zero), not as wins.
THE NULL is direction-randomised on the same geometry, which is what isolates signal from payoff structure. Every rating is gated by a minimum sample and a Wilson lower bound, and the null gap is significance-tested. Nothing here is asserted that has not cleared a test.
NON-REPAINT
Confirmed pivots, confirmed-close breaks, and forward-resolved calibration that never looks ahead. The channel can extend and re-fit as new pivots confirm, but a resolved trade is never re-scored, and no barrier is evaluated on a bar that has not closed.
DATA AND SCOPE
Any symbol, any timeframe. ATR-normalised throughout. Volume is used for the tier split; without it the tiers collapse to one and everything else still works.
EXPORTS (Data Window — consume from other scripts via input.source())
Channel high, channel low, break direction, volume tier, entry, stop, target, per-tier expectancy, null expectancy, meta probability — see the Exports group.
CONCEPT CREDIT
The convex-hull approach to objective trendlines, the triple-barrier forward-labelling method and the meta-labelling idea are from Marcos Lopez de Prado ("Advances in Financial Machine Learning"). The trading-range break as a formal, testable rule was first studied at scale by Brock, Lakonishok and LeBaron (Journal of Finance, 1992); its vulnerability to data-snooping was shown by Sullivan, Timmermann and White (1999) — which is exactly why this tool measures the rule on your instrument instead of asserting it. Wilson score interval — E. B. Wilson (1927). Welch's t-test — B. L. Welch. ATR — J. Welles Wilder.
The convex-hull channel implementation, the volume-tier calibration, the random-direction null with its significance test, and the online meta-label are the author's own. Clean-room implementation; no third-party Pine code is reused. Not affiliated with, nor endorsed by, any of the above.
HONESTY AND LIMITATIONS
Calibration is IN-SAMPLE, fixed-barrier, and assumes idealised fills — no commission, no slippage, no partial fills. It describes the past; it does not predict the future. Real costs will reduce every number, and they reduce the low-hit-rate high-RR tiers most.
Overlapping windows mean the samples are not fully independent, so treat the t-stats as directional evidence, not exact p-values. A tier that is proven in-sample is not guaranteed out-of-sample.
The null being beaten is the single most important line on the panel, and on many instruments it will read "ns". That is a real result. A tool that cannot report "no edge here" is selling you something.
Nothing in this script predicts price.
DISCLAIMER
Research and educational tool only. NOT financial advice, NOT a recommendation, and NO guarantee of results. Entry, stop and target output is arithmetic, not advice. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability for any use. אינדיקטור

אסטרטגייה

אינדיקטור

Machine Learning Price Bands Kernel Regression SignalsOVERVIEW
Every "AI band" on this platform draws two lines and asserts them. None of them can tell you how often price actually stays inside.
This one can — because it is built on a method that comes with a MATHEMATICAL COVERAGE GUARANTEE, and then it CHECKS WHETHER IT KEPT THE PROMISE, live, on your chart:
Coverage (empirical vs nominal) 89.1% vs 90% n = 20,266
Is the miss REAL? -0.9 pp z = -4.3 (real)
Verdict undercovering — real, but small
That is not a band. That is a prediction interval that has been audited, and it is the whole reason this tool exists.
It is a research and framing tool. NOT a strategy, NOT a signal service, NOT a validated edge.
THE MACHINE LEARNING, SPELLED OUT — no buzzwords, here is the actual model
1. NADARAYA-WATSON KERNEL REGRESSION. Non-parametric: no functional form is assumed, the data chooses the shape. Each past bar votes on the current estimate with a Gaussian weight that decays with distance. This is the same estimator Lo, Mamaysky and Wang used in the Journal of Finance to make chart-pattern recognition objective. It is real machine learning, and it is sixty years old.
The kernel here is CAUSAL. It only ever looks backwards. A centred kernel — the kind most "Nadaraya-Watson envelope" scripts use — peeks at bars that have not happened yet, and that is why their historical fit looks so much better than their live one.
2. BANDWIDTH BY PREDICTIVE MODEL SELECTION. The bandwidth h is the only real parameter, and it is not a magic number: several candidates are run in parallel and scored on their ROLLING ONE-STEP-AHEAD SQUARED ERROR. The winner is used. That is honest model selection — the criterion you would use to choose any forecaster — rather than a knob you turn until the chart looks nice.
3. CONFORMAL PREDICTION INTERVALS. The half-width is the (1-alpha) empirical quantile of the recent ABSOLUTE one-step-ahead errors. Under exchangeability this carries a FINITE-SAMPLE coverage guarantee, with NO distributional assumption at all: no normality, no GARCH, no volatility model. The model's own recent mistakes size the band — which is why it widens when the model starts being WRONG, not merely when price starts moving.
4. ADAPTIVE CONFORMAL INFERENCE — Gibbs and Candes, NeurIPS 2021.
Here is the problem with plain conformal prediction on markets, stated plainly: its guarantee holds under EXCHANGEABILITY, and financial returns are the textbook counterexample. Volatility CLUSTERS. So a residual quantile computed over a trailing window is always a step behind, the band is too narrow exactly when it matters, and the misses bunch together. Coverage lands quietly under nominal. Measured live on NIFTY futures before this was added: 89.1% against a nominal 90%, on the 1m, the 3m and the 1h, every one of them roughly four standard errors below target. Not a bug. The assumption breaking.
ACI makes the miscoverage level a LEARNED parameter:
alpha(t+1) = alpha(t) + gamma * (alpha - err(t))
Miss the interval and alpha falls, so the quantile rises and the band WIDENS. Cover it and alpha creeps back, so the band TIGHTENS. Long-run coverage provably converges to the target IRRESPECTIVE OF THE DATA GENERATING PROCESS — no exchangeability assumption anywhere.
A band that notices it is undercovering and fixes itself. Watch the alpha row: where it settles BELOW nominal is a direct measurement of how badly exchangeability fails on your instrument.
MEASURED, ON THE SAME INSTRUMENT, BEFORE AND AFTER:
timeframe plain conformal with ACI
1m 89.1% 90.1%
3m 89.1% 90.1%
5m 89.1% 90.1%
15m 90.1% 90.1%
1h 89.1% 90.1%
(nominal 90%)
Five timeframes, a four-standard-error undercoverage on four of them, closed. The binomial test now returns "calibrated — within sampling noise" and means it. That is not a backtest of a trading rule. That is a mathematical promise being kept, and being checked.
5. NORMALISED NONCONFORMITY — Papadopoulos et al. (2008), Lei et al. (2018).
The plain score |price - fit| is a SCALAR, which means the band is THE SAME WIDTH in a dead tape and in a crash. It therefore OVERCOVERS in calm and UNDERCOVERS in chaos — and the single marginal coverage figure is the average of those two errors, looking correct while being wrong in both directions.
Normalising divides each residual by a local scale estimate before taking the quantile, and multiplies it back when drawing:
score = |price - fit| / sigma band = fit +/- q * sigma
The band now scales with LOCAL DIFFICULTY — and note it is the MODEL'S difficulty, not the market's volatility. Related, but not the same thing, and the first one is what a prediction interval is actually about.
6. THE COVERAGE AUDIT. A guarantee you do not verify is just a claim.
TWO QUESTIONS ABOUT THE COVERAGE, AND THE PANEL ANSWERS BOTH
IS THE MISS REAL? That is a binomial z-test and it needs no tolerance at all. Each bar is a Bernoulli trial with p = nominal, so the standard error of the observed coverage is sqrt(p(1-p)/n).
IS THE MISS BIG ENOUGH TO CARE ABOUT? That is a judgement, and you set it.
These are NOT the same question, and conflating them is how a band gets waved through as "calibrated". Measured live on NIFTY futures: at n = 20,266 the standard error is 0.21 pp, so an empirical coverage of 89.1% against a nominal 90% is a 0.9 pp miss — FOUR STANDARD ERRORS. Unmistakably real. Arguably too small to trade differently. A 5 pp tolerance called that "calibrated", which was the headline row of the script asserting the one thing the script exists to verify, and asserting it wrongly.
The panel now reports the size of the miss, its significance, and a verdict that distinguishes "within sampling noise" from "real, but small" from "MISCALIBRATED — do not trust the band". You get to decide which of those matters to you, and you get the numbers to decide with.
AND THEN THE ROW NOBODY HAS: CONDITIONAL COVERAGE
Coverage 90.0% vs 90% n = 20,178
calm / normal / turbulent 96.4% · 90.1% · 83.2%
A single marginal number can read a perfect 90% while the interval covers 96% of quiet bars and 83% of violent ones. Ninety per cent is then the AVERAGE OF TWO ERRORS — it looks right while being wrong in both directions, and it is wrong in the direction that costs you money exactly when it costs you money.
Exact conditional coverage is provably impossible without strong assumptions. But you can always MEASURE it, and almost nobody does. Bars are split into calm, normal and turbulent thirds by the percentile rank of ATR, and coverage is scored inside each. If the three numbers fan apart, the band is not breathing — and the normalised score is what closes the gap.
Turn the normalised score off and watch those three fan out. That is the demonstration.
FADE OR FOLLOW? THE TOOL DOES NOT PRETEND TO KNOW
Price leaving a 90% interval is statistically unusual. Whether to FADE it (an outlier, so bet on reversion) or FOLLOW it (the model has broken, so bet on the new regime) is an EMPIRICAL question, and the honest answer is often neither.
So both are logged, both are graded, and BOTH ARE TESTED AGAINST EACH OTHER.
That last part matters more than it sounds. Knowing that fading beats an unconditional control, and that following also beats an unconditional control, does not answer the question a trader is actually asking at a band break — which of the two should I do? They are mutually exclusive responses to the SAME event. So they are run head to head with a Welch t-test, and the answer is allowed to be:
FADE or FOLLOW? NEITHER — the break does not tell you which
If the difference does not clear the noise, then on this instrument the break carries no directional information, and saying so IS the finding. A tool that cannot report its own failure is an advertisement, not a measurement.
And the chart agrees with the panel. An unproven direction is still drawn — it is arithmetic, and you may want it — but it is drawn MUTED and labelled "(not proven)". It used to print "Follow the break" in full colour while the panel directly beneath it said "neither proven". The paint has to agree with the code.
THE ANTI-BIAS GUARDS
ENTRY IS THE CLOSE, for the event and for the control alike. A band break is a SIGNAL, not a fill. Entering at the band — a better price — while the control enters at the close hands every signal a free head start and manufactures an edge out of nothing.
THE CONTROL IS DIRECTION-MATCHED. In a downtrend there are more break-downs than break-ups, so FOLLOW skews short and FADE skews long. A direction-skewed event set measured against a 50/50 control inherits the index drift for free and calls it an edge. Longs are compared only with control longs, shorts only with control shorts, and the control is blended back using the events' OWN direction mix.
IDENTICAL GEOMETRY. Every event and every control trade uses the same stop and the same R multiple, so the comparison is apples to apples.
Both barriers on one bar: the STOP is assumed first — conservative, and the only assumption that cannot flatter the result. Unresolved trades at the horizon are marked to market, not booked as losses. Nothing is marked proven below t = 1.96.
NON-REPAINT
The kernel is causal, the bandwidth is chosen on past error only, the interval is built from past residuals, and coverage is scored by asking whether the actual close landed inside the interval that was published BEFORE it. Everything is computed on confirmed bars. Nothing is drawn and then moved.
WHY THESE PARTS ARE ONE TOOL
The regression gives the trend. Without the interval, a band is a guess. Without model selection, the bandwidth is a knob you turn until you like the picture. Without the coverage audit, a conformal interval is an unverified promise. And without the signal calibration, "price left the band" is folklore. Each piece is worthless alone — which is exactly why they ship together.
DATA AND SCOPE
Any symbol, any timeframe. ATR-normalised throughout. No volume required.
EXPORTS (Data Window — consume from other scripts via input.source())
EXP_Fit, EXP_Upper, EXP_Lower, EXP_Bandwidth, EXP_Coverage, EXP_Miscal, EXP_Signal, EXP_Entry, EXP_Stop, EXP_Target
CONCEPT CREDIT
Nadaraya-Watson kernel regression — E. A. Nadaraya and G. S. Watson (1964). Its use for technical pattern recognition in finance — Andrew W. Lo, Harry Mamaysky and Jiang Wang, "Foundations of Technical Analysis", Journal of Finance 55(4), 2000. Conformal prediction — Vladimir Vovk, Alexander Gammerman and Glenn Shafer; the split/inductive form used here follows Papadopoulos et al. and Lei et al. Triple-barrier forward labelling — Marcos Lopez de Prado. Welch's t-test — B. L. Welch. ATR — J. Welles Wilder.
The causal-kernel implementation, the parallel bandwidth selection, the live coverage audit, the binomial calibration test and the fade-versus-follow head-to-head are the author's own. Clean-room implementation; no third-party Pine code is reused. Not affiliated with, nor endorsed by, any of the above.
HONESTY AND LIMITATIONS
Conformal coverage is guaranteed under EXCHANGEABILITY. Financial returns are NOT exchangeable — volatility clusters, regimes shift — so the guarantee is approximate in practice. THAT IS PRECISELY WHY THE COVERAGE IS AUDITED LIVE INSTEAD OF ASSUMED. When empirical coverage drifts from nominal you are watching the assumption break, in real time, and you should believe what you see rather than the label.
A prediction interval says where price is LIKELY TO BE. It says nothing about DIRECTION, and it is not a forecast. Coverage being correct does not make band breaks tradeable — those are two different claims, and the tool tests them separately for exactly that reason.
Calibration figures are IN-SAMPLE, with no costs or slippage, and use overlapping windows. A proven in-sample edge is NOT a guarantee out-of-sample. Nothing here predicts price.
DISCLAIMER
Research and educational tool only. NOT financial advice, NOT a recommendation, and NO guarantee of results. Entry, stop and target output is arithmetic, not advice. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability for any use. אינדיקטור

True RSITrue RSI | MisinkoMaster
The True RSI is a sophisticated reimagining of classical momentum. While the standard Relative Strength Index has served as a cornerstone of technical analysis for decades, it possesses a fundamental limitation: it treats all price movements equally, regardless of the time elapsed since the market made its last major peak or trough. The True RSI solves this structural blind spot by merging price magnitude with temporal trend strength, weighting gains and losses according to their cyclical maturity.
By dynamically scaling price changes against the time-distance of local extremes, this indicator filters out lateral market noise, reduces false overbought and oversold readings during strong trends, and delivers highly responsive execution signals.
How It Works (The Core Architecture)
Instead of relying solely on arithmetic averages of upward and downward price closes, True RSI filters raw market data through a multi-dimensional momentum matrix:
Temporal Trend Weighting: The algorithm continuously tracks how recently the market has formed local highs and lows. Gains are mathematically weighted against the strength of the upward cycle, while losses are weighted against the strength of the downward cycle.
Cycle-Weighted Ratio: The accumulated, time-weighted gains and losses are calculated over your lookback period to establish a true relative strength ratio. If gains occur during an actively surging upward cycle, they are heavily amplified; if they occur during a dying trend, they are heavily discounted.
Smoothing and Normalization: This ratio is translated into a normalized scale bounded between 0 and 100, providing an incredibly smooth yet responsive oscillator curve alongside a secondary momentum velocity histogram.
Key Features
Time-Weighted Velocity: True RSI prevents premature exhaustion signals during strong, healthy trends because it understands the cyclical age of the current market move.
On-Chart Candle Morphing: The system automatically tracks the oscillator state and alters the colors of your main price bars to keep you visually aligned with the macro trend.
Overlay Execution Labels: Prints pristine Long and Short labels directly on your price pane the moment the underlying structural momentum shifts past your designated thresholds.
Internal Divergence Histogram: Built directly behind the main oscillator is a custom acceleration histogram that monitors the rate of change of the index, pinpointing hidden momentum shifts before they reflect in the price.
Input Parameters & Optimization Guide
Lookback Period: Controls the baseline window for both the cycle-strength calculations and the price change evaluations. A default of 21 bars balances macro trend stability with immediate short-term utility.
Long / Short Thresholds: The structural boundaries that dictate trend shifts. By default, crossing above 50 signals a bullish regime, while dropping below 50 initiates a bearish regime.
Overbought / Oversold Thresholds: Tailored extremes designed to isolate true premium and discount zones. The default 80 and 20 boundaries act as high-probability mean-reversion targets.
Trading Strategies & Execution
Trend Regime Shift
When momentum builds structural backing, the indicator updates its trend state:
A crossing of the True RSI above the Long Threshold triggers a green Long label on the chart, changing candle colors to vibrant green.
A crossing of the True RSI below the Short Threshold triggers a pink Short label, shifting candle colors to pink.
Exhaustion Reversals
Because price movement is weighted against cycle time, entering the overbought (80) or oversold (20) zones represents a market that is genuinely overstretched both in terms of price velocity and time. Reversals from these zones carry high statistical significance for counter-trend scalps or trailing-stop targets.
Acceleration Divergences
Watch the central histogram centered around the 50 line. When the price is grinding flat but the histogram starts to rise or fall aggressively, it shows that the internal speed of the True RSI is accelerating. This hidden momentum often foreshadows explosive breakout expansions.
Disclaimer: Trading financial markets involves high risk. This technical script is designed as an informational analytical tool to support your rule-based mechanical execution system and does not constitute financial advice. אינדיקטור

Institutional VWAP Bands [JOAT]Institutional VWAP Bands
An anchored VWAP with standard-deviation bands that classifies price as cheap, fair or expensive and offers two complementary playbooks: mean reversion and trend pullback.
What it is
VWAP is the benchmark institutions measure their own fills against — the market's running notion of fair value. Standard-deviation bands around it map where price is stretched relative to that benchmark. This indicator runs an anchored VWAP with three band pairs and turns them into a structured, non-repainting decision tool rather than a plain VWAP line.
How it works
• Anchored VWAP — volume-weighted average price accumulated from a chosen anchor (session, week or month) with a controlled reset, so the reference restarts cleanly each period.
• Sigma bands — three pairs of bands at one, two and three standard deviations of price around VWAP, computed from the same volume-weighted variance. These define the stretch zones.
• Value state — every bar is classified with a z-score into cheap, fair or expensive relative to VWAP. This drives the colour system and the dashboard.
• Mean-reversion fades — when price is stretched to the outer bands against the higher-timeframe trend and then reclaims back inside, a fade toward VWAP is signalled. The reclaim requirement is deliberate, so you are not blindly catching a falling knife.
• Trend-pullback entries — in a trend, a retracement to VWAP or the first band that holds is a discount entry in the trend direction. Both playbooks are labelled by type, and Buy/Sell are mutually exclusive with a minimum-gap control.
Trade levels
Each signal draws a red risk box to the ATR stop and a green reward box to the third target, with inner dividers and right-edge labels for entry, stop and each take-profit. For reversion signals the first target is clamped toward VWAP so it always sits on the profit side of entry.
The dashboard
An adjustable value-ladder panel shows the value state, the z-score, the trend bias, the active playbook and signal, a conviction estimate, and a live first-target-before-stop tally from closed bars only.
How to use it
• Choose the anchor that matches your style: session for intraday, week or month for swing context.
• Fade the outer bands only against the trend and with a reclaim; take pullbacks to VWAP with the trend.
• Works across assets and timeframes, though the anchor should suit the timeframe you trade.
Settings
Anchor period, VWAP source, three band multipliers, trend filter length, reversion trigger, ATR risk multiple and target R multiples, plus visual and dashboard controls.
Originality and usefulness
VWAP and deviation bands are standard building blocks; the contribution here is the explicit two-playbook logic (reclaim-based reversion versus trend pullback), the value-state classification that ties colour, dashboard and signals together, and the reversion target clamp — combined into one coherent, non-repainting framework and fully explained.
Notes and limitations
• VWAP is most meaningful on instruments with reliable volume; on symbols without real volume the bands lose accuracy, which is stated here honestly.
• Reversion trades against a strong trend carry inherent risk even with the reclaim filter.
• The tally reflects only past bars on the current chart and is not a forecast.
• Educational and analytical tool, not financial advice.
— made with passion by officialjackofalltrades
אינדיקטור

אינדיקטור

YES RSI + BB SniperYES RSI + BB Sniper — Mean-Reversion Setup Tool with Auto Entry/SL/Targets
What it does:
This indicator combines RSI and Bollinger Bands to identify mean-reversion setups, then automatically plots a complete trade plan — Entry, Stop Loss, and three Targets — with a live dashboard tracking every level.
Signal Logic:
LONG: Price tags the lower Bollinger Band AND RSI crosses back above the oversold level (default 30) — exhaustion + momentum shift confirmation
SHORT: Price tags the upper band AND RSI crosses back below overbought (default 70)
Optional EMA-200 trend filter to trade only with the larger trend
Auto Trade Levels:
Entry: Signal candle close
Stop Loss: Beyond the band/swing extreme with an ATR-based buffer (adjustable)
Target 1: BB Basis (the mean — natural magnet in mean-reversion), minimum 1R
Target 2: Opposite band, minimum 2R
Target 3: Configurable Risk:Reward runner (default 1:3)
Dashboard shows: Signal status with bar count, RSI value, %B, Bandwidth (squeeze detection below 4%), trend direction, all trade levels with real-time hit-tracking (✔/✖), and Risk:Reward ratios.
Alerts: Built-in alert conditions for both LONG and SHORT setups.
How to use: Works best on Daily and 1H timeframes for swing trades. Wait for the signal candle to close, verify the R:R on the dashboard suits your plan, and always size positions according to your risk management.
This is an educational tool, not financial advice. Always do your own analysis before trading.
אינדיקטור

Apex Turn v4APEX TURN v4: Kalman Snapback with Fee Gate, Trend Guard and Fair Value Take Profit
Apex Turn is a mean reversion tool that hunts exhausted moves and trades the snap back to fair value. It was designed for crypto perpetual futures but works on any liquid market.
HOW IT WORKS
The script runs an adaptive Kalman filter on log price to estimate fair value, drawn as the orange line. The gap between price and fair value is normalized into a z score over a rolling window. When the z score stretches beyond the entry threshold (2.8 by default) and then hooks back toward the mean while still deeply stretched, the engine looks to trade against the extreme. Longs trigger at washed out lows and shorts trigger at blow off highs.
THREE GATES PROTECT EVERY SIGNAL
Gate one is the chop filter. The Kaufman Efficiency Ratio must confirm a ranging market before any mean reversion entry is allowed.
Gate two is the fee gate. The script projects the reward from current price to fair value, converts your maker and taker fees into R units based on the stop distance, and blocks any signal that would not cover all fees plus a minimum net gain of 0.35R. Blocked signals print as small gray crosses so you can see exactly what fees would have eaten.
Gate three is the strong trend guard. Fair value drift is measured in ATR per bar. When drift is strong, counter trend signals are suppressed until the market prints a release event: a momentum divergence on the z score, volume absorption at the extreme, or both together depending on the mode you select. Trend blocked signals print as orange squares and release events print as aqua diamonds.
EXITS
On entry the script freezes the current fair value as the take profit target, plotted in green, and places the stop in red at 1.5 ATR from entry. The default exit mode assumes you rest a reduce only limit order at the target so your winning exit pays the lower maker fee. Mean touch and overshoot exit modes are also included in the settings. A time stop closes stale positions after 45 bars.
ADAPTIVE ATR
The ATR length is anchored to real time rather than a fixed bar count. It always measures roughly 112 minutes of volatility, so stops, targets and fee math stay consistent whether you chart 30 seconds or 4 hours.
ALERTS
Four webhook ready alerts are included. Entry alerts carry the close price, the stop, the frozen take profit and the projected net R, so an automated system can place the full bracket the moment a position is born. Exit alerts fire for stop, target and time stop events.
SUGGESTED USE
Developed and tested for the 8 minute chart on liquid perpetual pairs. The 30 minute and 1 hour charts also suit the logic well. Timeframes under 5 minutes are not recommended because trading fees consume most of the edge there. Set the maker and taker fee inputs to match your own exchange tier before trusting the fee gate.
Signals are evaluated at bar close and do not repaint. Nothing in this script is financial advice and past behavior in testing does not guarantee future results. Always size positions responsibly and manage your own risk. אינדיקטור

Two Sigma Factor Composite [JOAT]TWO SIGMA FACTOR COMPOSITE
A tribute to the multi-factor approach pioneered by Two Sigma — long-only, long/short, and risk-premia funds that decompose returns into orthogonal factor exposures, normalise each factor onto the same statistical scale, and combine them into a single signed score. Two Sigma Factor Composite builds five canonical factors (Momentum, Quality, Value, Volatility, Mean-Reversion), Z-normalises each against a rolling baseline, sum-normalises the user-controllable weights, and outputs a composite score with signal labels, factor sparklines on the chart, and a rolling hit-rate backtest.
The five factors
Each factor is computed independently and Z-normalised over a configurable window (default 100 bars) with optional outlier clipping (default ±4σ):
Momentum — return / volatility over the configurable momentum window (default 50 bars). The classic "trend" factor.
Quality — inverse of recent realised volatility (default 50-bar window). Lower volatility = higher quality; an asset that has been calmer is treated as higher quality, consistent with academic factor research.
Value — deviation from a long mean (default 200-bar SMA). Negative deviation = "cheap" (positive value factor exposure); positive deviation = "expensive". The classical cross-sectional value definition, adapted to time series.
Volatility — percentile rank of recent realised volatility (default 20-bar stdev percentile-ranked over 252 bars). High vol = negative factor; low vol = positive factor.
Mean-Reversion — signed deviation from a 20-bar mean (default). Captures short-term reversion bias.
Each factor's window is independently configurable. All five outputs are Z-scores capped at ±4σ to prevent any single outlier from dominating the composite.
Sum-normalised weights
Five weight sliders (default 1.0 each) are normalised internally so any positive combination is valid. Default equal weight is the most defensible baseline; tune individual weights to bias the composite. Want a pure momentum + quality read? Set the others to 0.1 and Momentum/Quality to 2.0. The composite reshapes itself live.
Signal engine — bounded composite with three tiers
The composite is bounded by the clipping cap. The signal engine layers three thresholds:
Buy — composite crosses above the buy threshold (default +1.0σ).
Sell — composite crosses below the sell threshold (default −1.0σ).
Extreme Bull / Extreme Bear — |composite| crosses ±2.0σ. The script's strongest read.
A configurable signal cooldown (default 10 bars) prevents clustering.
Factor sparklines (the signature visual)
The script renders inline sparklines on the chart for all five factors — small line plots that visually show each factor's recent Z trajectory. Configurable base offset (vertical position below zero), row spacing, amplitude, and per-row transparency mapping. At a glance you see which factors are driving the composite and which are flat.
When all five sparklines lean the same way, the composite is high-confidence. When they disagree, the composite is a weighted compromise — the sparklines tell you the truth that a single number cannot.
Visual system
Composite line (configurable width, default 3px) with sign-coloured fill toward zero (configurable transparency).
Threshold lines at ±buyTH and ±extremeTH (configurable transparency).
Buy / Sell labels on chart on threshold crosses.
Factor sparklines — five inline Z-trajectory plots in the pane.
Optional chart-background override to follow chart.bg_color.
A locked Emerald Night palette: vivid green bull / vivid red bear / sage mid on a deep emerald background — strict 2-hue discipline with bg. No third colour invented anywhere; all variations are transparency-only.
Dashboard
Monospaced table positionable to any of eight corners. Surfaces:
Composite Z value and sign.
Per-factor Z rows (Momentum / Quality / Value / Volatility / Mean-Reversion).
Factor agreement percentage (how many factors agree with composite sign).
Last signal direction with bars-ago.
Weight configuration in use.
Backtest stats row — rolling forward-N-bar hit rate (configurable lookahead, default 10 bars). The script's own performance audit.
Alerts
Five alert conditions, each independently controllable:
BUY Cross (composite crosses above buy threshold)
SELL Cross
Extreme Bull (composite > +2.0σ)
Extreme Bear (composite < −2.0σ)
Low Factor Agreement (% of factors agreeing falls below the configurable threshold, default 40%) — the script's "no edge" warning.
How to read it
Three reads, in order of conviction:
Extreme score with high factor agreement (e.g. composite > +2.0σ AND agreement > 80%) — the highest-conviction read the script produces. Four or five factors are pointing decisively one way, and the composite is at a statistical extreme.
Buy / Sell with sparkline confirmation — visual confirmation that the directional read is being driven by multiple factors, not just one. If the composite is bullish but only the Momentum sparkline is leaning, the read is fragile; if Momentum + Quality + Value + Mean-Reversion all lean, the read is robust.
Low Agreement alert — stand-aside signal. The factors disagree internally; the composite is a wash. Wait for re-alignment.
Suggested settings
Defaults (momentum 50 / quality vol 50 / value 200 / vol 20/252 / MR 20, Z window 100, ±4σ clip, ±1.0 buy/sell, ±2.0 extreme, 10-bar cooldown) are tuned for daily charts on broad indices — the timeframes where factor approaches are statistically meaningful. For lower timeframes drop all windows proportionally. For weekly+ keep defaults; factor reads on weekly are the canonical institutional horizons.
Originality / what's reused
The factor-investing framework is published academic finance — Fama-French 1992, Carhart 1997, AQR 2013, and many others. The five factors used here (Momentum, Quality, Value, Volatility, Mean-Reversion) are the canonical institutional factor set. The implementation here — the five-factor pipeline with each factor's window independently configurable, the rolling Z-normalisation with outlier clipping, the sum-normalised five-weight composition, the bounded-composite signal engine with three-tier thresholds, the inline factor sparklines render in the same pane, the rolling forward-bar hit-rate backtest, and the strict 2-hue alpha-only palette — is JOAT-original. No third-party code reused. The script is a tribute to Two Sigma-style factor-composite portfolio construction, not a direct replication of any proprietary Two Sigma model.
Limitations
The five factors are computed from chart data only — they are time-series proxies of the cross-sectional factors used in true multi-asset portfolios. The Z-normalisation needs the window populated; early bars give a warm-up read. The forward-N-bar hit-rate backtest is descriptive of recent signal behaviour under the current settings; it is not a predictive metric. Factor exposures historically underperform for extended periods — the dashboard's agreement row and the low-agreement alert exist specifically to warn you when the model is breaking down.
—
-made with passion by jackofalltrades
אינדיקטור

Adaptive Predictability Engine Entropy Gate, Regime RouterAdaptive Predictability Engine — Entropy Gate, Regime Router & Expert Committee
What it is
The Adaptive Predictability Engine is a governed decision framework, not another confluence average. It refuses to treat all market conditions as tradable. It applies a strict hierarchy: first it asks whether price is forecastable at all right now; if it is, it decides whether trend-style or reversion-style logic is appropriate; and only then does a small committee of transparent experts vote — with the committee continuously re-weighting itself toward whichever experts have been correct recently. When the market is unpredictable, the whole engine stands aside and shows nothing to trade.
It plots directly on price: long/short signals, the live entry/target/stop of the active trade, a plain-language dashboard, and an optional self-calibration panel that scores past signals in R-multiple expectancy (not just win rate).
Why these components are combined (mashup justification)
This is a deliberate, dependent stack — each layer conditions the next, so removing any one changes the layer below it. That is the difference between a governed engine and a bag of averaged indicators.
Predictability gate (permutation entropy + structure). Permutation entropy (Bandt–Pompe) measures the ordinal randomness of recent price across three time scales; this is blended with |Hurst − 0.5|, the distance of the market from a random walk, which is high for strong trends and strong mean-reversion. The blended predictability is percentile-ranked so the gate self-tunes per symbol and timeframe. If the tape is unpredictable, nothing downstream may fire. This is the master switch, and it is why the engine spends much of its time deliberately doing nothing.
Regime router (Hurst exponent). When structure exists, the Hurst exponent (generalized, via a structure-function slope) decides whether it is persistent (trend) or anti-persistent (mean-revert), and routes weight toward the appropriate family of experts rather than averaging trend and reversion logic together.
Expert committee (Hedge / multiplicative weights). Six deliberately diverse experts — price trend, volume-weighted price, order-flow delta, momentum exhaustion, volatility extreme, and range extreme — each cast a directional vote. Their weights update every bar by exponential regret (right experts gain influence, wrong ones lose it), with fixed-share regularization so no single expert can dominate and make the vote fragile.
Distribution-shift guard. If the recent return distribution moves materially versus a reference window, the engine freezes learning and cuts conviction until conditions settle, so stale weights don't drive trades through a regime change.
The output is a single decision = the regret-weighted vote of only the currently-appropriate experts, gated to zero whenever the tape is unpredictable.
How to use it
Add it to any liquid symbol and timeframe. Defaults are tuned for index futures (e.g. NIFTY) but every input is adjustable, and the Data source group lets you repoint price and volume for any market.
Watch the dashboard headline: LONG / SHORT / WAIT / STAND ASIDE. When a signal fires, the engine draws the entry, ATR target, and ATR stop so the action is concrete.
Treat the shaded background as a hard "do not trade" — the engine has judged the tape unpredictable.
Open the Edge calibration (advanced) panel to see, per market memory, the past R-expectancy of the engine's own signals versus a direction-matched baseline. Positive expectancy means the sample was profitable before costs; this is descriptive of the past, not a forward guarantee.
Use the Ablation (research) toggles to switch each layer off and see, on your own data, whether it earns its place.
What makes it original
Most published tools average indicators and hope. This one inverts the approach by asking whether to act at all before what to do, using information-theoretic predictability (permutation entropy) as a master gate, a memory estimate (Hurst) as a router, and online regret-minimization (Hedge) to arbitrate a diverse expert set — with built-in R-expectancy self-calibration so users can judge it honestly rather than on a cherry-picked screenshot. The order-flow expert reads finest-available lower-timeframe signed volume with automatic fallback. The coupling and governance order are the contribution; the individual estimators are classical and credited below.
Concept credits
Permutation entropy — Bandt & Pompe. Hurst exponent / long-range dependence — H. E. Hurst; Mandelbrot. Hedge / multiplicative-weights online learning — Freund & Schapire; Littlestone & Warmuth; Vovk. Efficiency/structure framing — Kaufman. Triple-barrier labelling and R-multiple expectancy — M. López de Prado. Wilson score interval — E. B. Wilson. Synthesis, governance design, and implementation are the author's own.
Important disclaimer
Research and education only. Not financial advice, not a signal service, not a guarantee of future results. No indicator has an inherent edge. The calibration panel is a descriptive summary of past behaviour on the current chart — not a backtest and not a forward prediction. Always validate independently, apply realistic costs and slippage, and manage risk. You are solely responsible for your trading decisions. אינדיקטור

Multi-Indicator Confluence Strategy Automator [MarkitTick]💡 A comprehensive, multi-dimensional technical analysis suite engineered to evaluate market conditions through a rigorous synthesis of trend, momentum, volatility, and cross-asset correlation metrics. Designed for traders who require a systematic approach to market entry and risk management, this script aggregates signals from multiple proven indicators and applies advanced statistical filters to minimize false positives. By unifying foundational technical analysis with advanced mathematical concepts like the Hurst exponent and momentum inflation, this tool provides a highly objective, data-driven environment for evaluating market structure and defining structured trade parameters.
✨ Originality and Utility
Standard trading methodologies often rely on isolated indicators, which can lead to high failure rates in dynamic market environments. The originality of this script lies in its robust confluence engine, which demands simultaneous alignment across multiple independent market dimensions before generating a signal.
Instead of merely stacking moving averages, this suite integrates a strict Boolean gating system that evaluates:
A primary directional baseline derived from a Hull Moving Average combined with an Average True Range volatility buffer.
A directional movement and momentum confirmation matrix utilizing the Average Directional Index and Commodity Channel Index.
Dynamic volume filtering to ensure market participation supports the price action.
Advanced statistical gating mechanisms, including confluence decay, regime detection, and cross-asset correlation analysis.
This utility is exceptionally valuable for systematic traders, as it translates complex, multidimensional market data into a highly legible, unified dashboard while automatically projecting risk-adjusted stop-loss and take-profit levels dynamically based on current market volatility.
🔬 Methodology and Concepts
● The Confluence Engine
The core of this strategy revolves around a scoring system that evaluates bullish or bearish alignment. A valid signal requires a minimum confluence score, calculated by assessing the following core components:
• Baseline Trend
The script utilizes a Hull Moving Average to determine the primary market bias. To eliminate noise, a volatility buffer equivalent to a fraction of the Average True Range is applied, ensuring that only definitive breakouts beyond the baseline are considered valid directional shifts.
• Directional Movement (ADX/DMI)
The first confirmation layer relies on the Average Directional Index alongside the Directional Movement Indicators. A trend is only considered active if the ADX exceeds a user-defined threshold, and the relationship between the positive and negative directional indicators defines the bias.
• Momentum Oscillators (CCI)
The second confirmation layer employs the Commodity Channel Index to measure the current price level relative to an average price level over a given period. Bullish or bearish confirmation requires the CCI to pierce specific upper or lower thresholds.
• Volume Validation
A volume filter ensures that signals are backed by significant market interest. The current period's volume must exceed a rolling exponential moving average of historical volume, multiplied by a strict sensitivity factor.
• Advanced Gating Filters
Confluence Decay: A time-based penalty system that degrades the value of a signal if the confluence state persists for too long without triggering an entry, preventing late entries into exhausted trends.
Hurst Regime Detector: Classifies the market as trending or mean-reverting, gating signals that conflict with the overarching statistical regime.
Momentum Inflation Ratio: Normalizes current price velocity against historical volatility to detect and filter out exhaustion spikes.
Cross-Asset Lead-Lag: Computes the Pearson correlation against a secondary asset to confirm macroeconomic or sector-wide alignment before entry.
🎨 Visual Guide
The script employs a highly intuitive visual hierarchy designed to keep the chart clean while providing maximum data density.
● Chart Elements
• Heatmap Candles
The standard price candles are color-coded based on the baseline trend state. Bullish bars are colored a vibrant teal, bearish bars are marked in a distinct red, and neutral states default to a muted slate blue. This visual heuristic allows traders to instantly recognize the dominant market regime without processing raw numerical data.
• Signal Markers
When all confluence conditions and advanced gates are met, the script plots distinct entry markers: small upward-pointing triangles below the bar for long signals, and downward-pointing triangles above the bar for short signals.
• Risk Management Levels
Upon a confirmed signal, the script dynamically draws horizontal lines representing the trade parameters:
Entry Line: A dashed, neutral-colored line projecting the exact trigger price.
Stop Loss (SL): A dashed, red line projected against the trend based on a multiple of the Average True Range.
Take Profit (TP1, TP2, TP3): Three dotted, green lines representing scaled exit targets, dynamically calculated using expanding volatility multiples.
Each line is accompanied by a precise price label anchored to the right side of the chart.
● The Information Dashboard
A comprehensive table is anchored to the top right of the screen. It displays the real-time status of the Baseline, Confirm 1, Confirm 2, Volume, Exit status, and the aggregate Score. Furthermore, it outputs the exact values for ADX, ATR, Decay Age, Hurst Exponent, Momentum Inflation, Baseline Distance-Integral, and Lead-Lag Correlation, using a color-coded text system (Green for bullish/favorable, Red for bearish/unfavorable, Yellow for warnings).
📌 Note : the best way to resolve visual overlap is to navigate to the Object Tree and drag the indicator above the main chart layer, or simply hide the native candles in your chart settings.
📖 How to Use
● Interpreting Signals
Traders should monitor the chart for the appearance of the signal triangles. Because the script utilizes a strict minimum gap requirement between signals, traders will not be overwhelmed by repetitive alerts during a sustained trend.
● Executing Trades
Once a signal appears, the script automatically projects the optimal Entry, Stop Loss, and three Take Profit levels on the chart. Traders can use these exact price labels to populate their exchange order tickets or algorithmic routing software.
● Managing Positions
The built-in Exit Indicator, driven by a faster CCI calculation, will trigger an alert when counter-trend momentum builds, providing an objective reason to manually close or trail stops on an active position before the hard stop loss is hit.
● Dashboard Monitoring
Use the dashboard table to gauge the overall health of the trend. If the Confluence Score drops or the Confluence Decay percentage reaches high levels, it is highly advisable to tighten stops on existing positions, as the mathematical probability of trend continuation has diminished.
⚙️ Inputs and Settings
● Core Indicator Tuning
Baseline HMA Length: Adjusts the sensitivity of the primary trend filter.
ADX/DMI Length & Threshold: Defines how strong a trend must be to pass the first confirmation gate.
CCI Length & Threshold: Sets the momentum required for the second confirmation gate.
Volume RMA Length & Multiplier: Configures the strictness of the volume participation filter.
● Risk Parameters
ATR Length: The lookback period for volatility measurement.
SL ATR Mult: The multiplier applied to the ATR to define the stop-loss distance.
TP1, TP2, TP3 ATR Mult: The multipliers defining the three scale-out profit targets.
● Advanced Filter Settings
Confluence Decay: Toggles the time penalty system and defines the maximum bars before full decay.
Hurst Regime Detector: Toggles regime filtering and sets the threshold for trending vs. mean-reverting environments.
Momentum Inflation Ratio: Toggles velocity normalization and sets the threshold ratio for exhaustion alerts.
Cross-Asset Lead-Lag: Defines the correlation ticker, correlation lookback window, and minimum Pearson threshold.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Rescaled Range Analysis and the Hurst Exponent
This script integrates a specialized implementation of the Hurst Exponent, a statistical measure originally developed in hydrology, to classify financial time series data. It calculates the cumulative deviation of the asset's price from its Simple Moving Average over a defined rolling window. By identifying the maximum and minimum cumulative deviations, the script establishes the range, which is then normalized against the standard deviation of the price series to compute the rescaled range ratio. The final Hurst value is derived logarithmically. A value significantly greater than 0.5 mathematically confirms a persistent, trending regime, while a value below 0.5 indicates an anti-persistent, mean-reverting environment.
● Momentum Inflation via Volatility Normalization
The script tackles the academic problem of momentum illusion, where sheer point movement is mistaken for structural momentum, by normalizing absolute price speed against the Average True Range. It then compares this normalized current velocity against a rolling historical average of normalized velocity. If the resulting ratio exceeds the user-defined threshold, the script identifies the movement as mathematically over-extended, gating further entries to prevent buying the top or selling the bottom of a volatility spike.
● Cross-Asset Correlation Dynamics
To account for macroeconomic interconnectedness, the script employs a rolling Pearson correlation coefficient between the primary asset and a defined leading indicator. By analyzing the covariance of the two assets relative to the product of their standard deviations over a specific window, it mathematically verifies if the broader sector or macroeconomic environment supports the localized signal.
● Distance-Integral Calculations
The Baseline Distance-Integral utilizes a rolling mathematical sum of the spatial delta between the closing price and the moving average. This integral provides a quantifiable area-under-the-curve measurement, offering deeper insight into the cumulative kinetic energy of a trend rather than relying solely on point-in-time cross signals.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. אינדיקטור

אינדיקטור

Mean-Deviation Divergence OscillatorMean-Deviation Divergence Oscillator
A bounded oscillator that measures how far the typical price has stretched from its own recent mean, scaled by how much it normally deviates — so a reading tells you "how unusual is this move," not just "how big." That normalization makes its swings comparable across calm and volatile regimes and well suited to divergence. It adds higher-timeframe confirmation and a plain-language forward-calibration layer, so you can see at a glance whether a divergence is corroborated and whether it has actually paid on this symbol.
Why this construction (not a mashup for show). Each part fixes a flaw in naive divergence. Raw distance-from-mean isn't comparable across regimes — dividing by the average absolute deviation (with the conventional 0.015 scaling, chosen so that roughly 70–80% of readings fall within ±100) makes the oscillator regime-comparable, which is the whole reason it's a good divergence base. Higher-timeframe confirmation removes single-timeframe noise. Forward calibration removes blind faith: instead of assuming a divergence "should" reverse price, it measures whether it actually has, with realistic profit/stop outcomes. The normalized oscillator, the divergence engine, the MTF check and the calibration form one coherent tool.
How it works. Oscillator = (typical price − its moving average) ÷ (0.015 × mean absolute deviation), soft-bounded to a clean ±100 pane that auto-fits its own recent magnitude. Divergence is detected from confirmed price pivots versus the oscillator (regular and optional hidden). With MTF confirmation on, a divergence counts only if a same-direction divergence is also present on the chosen higher timeframe. Each signal is then labelled by a triple barrier — a profit target and equal stop in ATR units plus a time limit — split into in-sample and recent out-of-sample, with a confidence interval and a multiple-testing check.
How to use. Read the Verdict row (Bull/Bear divergence confirmed, "unconfirmed," or Wait) and the Conviction row, which reads "High" only when that divergence type shows a positive edge that survives the test on this symbol. A divergence is a reversal warning, not a trend signal — pair it with your own entry trigger and risk plan.
What's original. Higher-timeframe divergence confirmation on a mean-deviation normalized oscillator, the forward triple-barrier calibration with an out-of-sample split, and a conviction read that openly admits when there's no proven edge.
Inputs. Price/High/Low sources (change them for any market), reading mode (Simple/Pro), engine length and deviation scale, divergence and HTF-confirm controls, full calibration settings, and an auto-adapting dashboard legible on dark or light charts. Defaults are tuned for NSE:NIFTY1! intraday.
Honesty & limitations. Edge figures are computed on this chart's own history with overlapping windows and no costs — context, not a guaranteed backtest; past behaviour doesn't predict the future. Divergence is inherently early and can persist before price turns.
Disclaimer: for research and education only. Not financial advice. Trading carries risk of loss; manage your own positions. אינדיקטור

Intermarket Divergence with Reliability ScoringIntermarket Divergence with Reliability Scoring
Related markets tend to move together. When your chart pushes to a new high but a market that usually tracks it does not confirm, that non-confirmation can precede a turn. This script measures divergence between your chart and a chosen leader market — but only when the leader is actually correlated to price, because a decoupled market's "divergence" is meaningless — and then scores, in real time, whether those divergences have been worth trading on your symbol.
WHAT IT PLOTS
A normalised oscillator built from a chosen leader market, its stretch bands, divergence markers and connecting pivot lines, plus a plain-language verdict panel. By default the chart stays minimal — the oscillator and the verdict panel — with optional key-info and per-class tables you can switch on in settings.
WHY THESE COMPONENTS ARE COMBINED, AND HOW THEY WORK TOGETHER
Three classical pieces are fused into one pipeline, not stacked as independent signals:
A z-scored leader series — optionally inverted, optionally lead-lag shifted — the cross-market line your price is compared against.
A live correlation gate — the leader only votes when its trailing correlation to price clears a threshold, so non-confirmations from a decoupled market are ignored.
A binomial-proportion confidence test — asks, for each divergence class, whether the expected move followed more often than a same-zone baseline would deliver.
Part 1 builds the comparison, part 2 keeps only the meaningful divergences, part 3 decides whether the survivors have actually paid on this instrument, by direction. The parts are interdependent — remove any one and the script can no longer answer its core question: is this intermarket divergence worth trading here, and which way?
HOW TO READ IT
The verdict panel translates the statistics into four states:
GREEN, edge confirmed: these divergences have beaten a same-spot baseline here. Worth acting on.
RED, no edge here: they have lost to a coin-flip. Skip them, pick a leader that genuinely leads, or change the timeframe.
AMBER, unproven: edge not statistically established yet; treat as low-confidence.
GREY, learning: still collecting completed samples.
It also shows:
Best signal — names a direction only once that direction is individually proven (its edge lower-bound clears zero). Otherwise it says "none confirmed", so you are never lured by a single noisy number.
Leader link — how tightly the leader currently tracks price (strong, moderate or weak). A weak link means the leader has decoupled and its divergences are unreliable.
Reward : risk — the average best move versus the average worst move after a signal, in ATR. Below 1:1 means signals have hurt more than they helped.
Market regime — reverting markets suit divergence; strong trends punish it.
A divergence is simply price making a higher high or lower low while the leader line does the opposite, counted only when the leader is correlated enough to matter.
CHOOSING A LEADER
Pick a market that genuinely leads — a currency, a global risk proxy, a sector index — not one that merely co-moves with your chart. The lead-lag offset lets you test whether it leads. A co-moving index will usually show no edge, which the panel will tell you plainly.
WHAT IS ORIGINAL
Standard intermarket tools just overlay two symbols. This one fuses a live correlation gate into the divergence filter, then keeps a self-updating, confidence-scored, per-class track record against a same-zone baseline — so you see not just that a non-confirmation printed, but whether and how it has paid, and you only trust a direction once it is statistically proven.
UNIVERSAL ACROSS MARKETS
Reads the chart's own price (the source is configurable in settings) plus one leader symbol. Defaults target NIFTY futures with Bank Nifty as the leader. Change the leader to USD/INR (inverse), a sector or overseas index, or any related market for other instruments, in any market.
OUTPUTS FOR OTHER SCRIPTS
Generic EXP_ values — oscillator, signal, probability, edge, edge lower-bound, sample count, regime, leader value and leader correlation — are published to the Data Window so other indicators can read them via input.source().
CONCEPT CREDITS
Average true range — J. W. Wilder. Binomial score confidence interval — E. B. Wilson. Trend-efficiency regime measure — P. Kaufman. Intermarket analysis and divergence — classical technical analysis.
DISCLAIMER
For research and education only. This is not financial advice, not a recommendation to buy or sell, and not a guarantee of future results. All performance shown is in-sample and past-only. Markets carry risk — do your own research and manage your own risk. אינדיקטור

Multi-Timeframe Momentum Divergence with Reliability ScoringMulti-Timeframe Momentum Divergence with Reliability Scoring
A momentum divergence on your chart timeframe is far more reliable when the bigger picture leans the same way. This script measures momentum divergence on your chart, only counts it when enough higher timeframes point in the signal's direction, then scores — in real time — whether those gated divergences have actually been worth trading on your symbol, and which way.
What it plots
A normalised momentum oscillator with stretch bands and divergence markers, connecting pivot-to-pivot lines, and a plain-language panel that turns the statistics into a verdict. By default the chart stays minimal — the oscillator plus the verdict panel — with optional key-info and per-class tables you can switch on in settings.
Why these components are combined, and how they work together
Three classical pieces are fused into one pipeline — not stacked as independent signals:
A z-scored momentum oscillator (chart timeframe) — locates where price and momentum disagree, i.e. the divergence.
A higher-timeframe agreement gate — checks momentum direction on three configurable higher timeframes and requires a minimum number to align before a divergence is allowed to fire. This filters out the counter-trend divergences that fail inside a strong higher-timeframe move.
A binomial-proportion confidence test — asks, for each divergence class, whether the expected move followed more often than a same-zone baseline would deliver.
Part 1 finds the divergence, part 2 keeps only those backed by the higher-timeframe trend, and part 3 decides whether the survivors have actually paid on this instrument, by direction. The parts are interdependent — remove any one and the script can no longer answer its core question: "is this momentum divergence worth trading here, and which way?"
How to read it
The verdict panel translates the statistics into four states:
GREEN — edge confirmed: these gated divergences have beaten a same-spot baseline here. Worth acting on.
RED — no edge here: they've lost to a coin-flip. Skip them, require more higher-timeframe agreement, or change the timeframe set.
AMBER — unproven: edge not statistically established yet; treat as low-confidence.
GREY — learning: still collecting completed samples.
It also shows "Best signal" (the direction carrying the strongest measured edge), "Higher TFs" (how many of your three higher timeframes currently agree), "Reward : risk" (the average best vs worst move after a signal, in ATR — below 1:1 means signals hurt more than they help), and the market regime. The optional key-info and per-class tables (off by default) show the per-timeframe breakdown and the full per-direction track record.
A divergence is simply price making a higher high / lower low while the momentum line does the opposite — counted only when enough higher timeframes lean that way.
What's original
Standard multi-timeframe tools just colour-code higher-timeframe trend, and standard divergence tools just mark the divergence. This one fuses higher-timeframe agreement into the divergence filter, then keeps a self-updating, confidence-scored, per-class track record against a same-zone baseline — so you see not just that a divergence printed, but whether and how it has paid once the higher timeframes were on board, and which direction is carrying it.
Universal across markets
Reads only the chart's own price (the source is configurable in settings) plus the same symbol on three higher timeframes, so it runs on any symbol, any timeframe, in any market with no external data. Defaults target NIFTY futures; change the source, lengths or timeframes for other instruments.
Outputs for other scripts
Generic EXP_* values — oscillator, signal, probability, edge, edge lower-bound, sample count, regime and higher-timeframe confluence — are published to the Data Window so other indicators can read them via input.source().
Concept credits
Relative-strength momentum and average true range — J. W. Wilder. Binomial score confidence interval — E. B. Wilson. Trend-efficiency regime measure — P. Kaufman. Multi-timeframe confluence and divergence — classical technical analysis.
Disclaimer
For research and education only. This is not financial advice, not a recommendation to buy or sell, and not a guarantee of future results. All performance shown is in-sample and past-only. Markets carry risk — do your own research and manage your own risk. אינדיקטור

Regression-Slope Divergence with Reliability ScoringRegression-Slope Divergence with Reliability Scoring
Most divergence tools tell you a divergence exists. This one tells you whether that divergence has historically mattered on the symbol and timeframe you're actually looking at — and states the conclusion in plain words on the chart.
What it plots
A normalised momentum oscillator with stretch bands and divergence markers, plus a verdict panel that scores those divergences in real time. By default the chart stays minimal — just the oscillator and the verdict panel — with an optional key-info table and a per-direction track-record grid you can switch on in settings.
Why these components are combined, and how they work together
Three classical pieces are fused into a single pipeline — not stacked as independent signals:
Linear-regression slope of price — the direction price is genuinely trending.
RSI-based momentum, z-score normalised — the direction momentum is trending.
A binomial-proportion confidence test — whether the disagreement between the two has preceded a favourable move often enough to beat a same-zone baseline.
Components 1 and 2 only become a signal where they disagree — that disagreement is the divergence. Component 3 is the layer that makes this original: it records every past divergence on the current instrument, measures how often the expected move actually followed within a fixed look-ahead, compares that to what a random entry from the same stretched zone would have achieved, and wraps a confidence interval around the result. The parts are interdependent — remove any one and the script can no longer answer its core question, "is this divergence worth trading here?"
How to read it
The verdict panel translates the statistics into four states:
GREEN — edge confirmed: these divergences have beaten a same-spot baseline here. Worth acting on.
RED — no edge here: they've lost to a coin-flip from the same spot. Skip them, or try a higher timeframe (counter-trend divergence often fails on fast timeframes).
AMBER — unproven: edge not statistically established yet; treat as low-confidence.
GREY — learning: still collecting completed samples.
It also shows whether a signal is live right now and a reward-vs-risk figure — the average best move vs the average worst move after a signal, in ATR. Below 1:1 means signals have hurt more than they've helped. The optional grid breaks the record down into Bullish / Bearish with hit-rate, baseline, edge and reward:risk.
A divergence itself is simply price making a higher high / lower low while the momentum line does the opposite.
What's original
Off-the-shelf divergence indicators fire and leave you to guess. This one keeps a self-updating, confidence-scored track record against a same-zone baseline and tells you, in words, whether the current setup has earned your attention on this specific market.
Universal across markets
It reads only the chart's own price (the source is configurable in settings), so it runs on any symbol, any timeframe, in any market with no external data. Defaults are tuned for NIFTY futures; change the source and lengths for other instruments.
Outputs for other scripts
Generic EXP_* values — oscillator, signal, probability, edge, edge lower-bound, sample count, regime, trend strength and verdict tier — are published to the Data Window so other indicators can read them via input.source().
Concept credits
Relative-strength momentum and average true range — J. W. Wilder. Binomial score confidence interval — E. B. Wilson. Trend-efficiency regime measure — P. Kaufman. Least-squares regression — classical statistics.
Disclaimer
For research and education only. This is not financial advice, not a recommendation to buy or sell, and not a guarantee of future results. All performance shown is in-sample and past-only. Markets carry risk — do your own research and manage your own risk. אינדיקטור

Brownian Motion Residual [JOAT]BROWNIAN MOTION RESIDUAL
A regime classifier rooted in the sqrt(T) scaling law of geometric Brownian motion. Under a true random walk, the standard deviation of T-bar returns scales as σ₁ · √T — that is the central fact of Brownian motion in continuous time. Markets violate this scaling in revealing ways: when they trend, dispersion at long horizons grows faster than √T; when they mean-revert, it grows slower. Brownian Motion Residual measures that violation across three horizons simultaneously, aggregates it, and surfaces a single Z-like residual that classifies the market into Strong MR / MR / Random / Trend / Strong Trend.
The sqrt(T) scaling law, restated
For a Brownian process with per-bar volatility σ₁:
σ(T-bar return) = σ₁ · √T
For a real market the observed σ at horizon T can be measured directly. The residual is the deviation of the observed value from the Brownian-implied value:
residual(T) = σ_observed(T) − σ₁ · √T
When the residual is positive , dispersion at T is greater than Brownian predicts — the market is trending (price travels further than a random walk in T bars). When it is negative , dispersion is less than Brownian predicts — the market is mean-reverting (price ends up closer to home than a random walk would).
Optional normalisation by σ₁ · √T turns the residual into a unit-less percentage of expected dispersion, so the same threshold values are meaningful across instruments and timeframes.
Three horizons, weighted blend
A single horizon is noisy. Brownian Motion Residual reads three horizons simultaneously (default 5 / 20 / 100 bars), each independently toggleable and weighted (default 1.0 each). The horizons are aggregated into a single residual line — the script's headline metric. Toggling off the short horizon makes the read smoother and slower; toggling off the long horizon makes it more reactive. Configurable.
A configurable EMA on top of the aggregated residual suppresses single-bar noise without lagging the regime view.
Two-tier classification
The aggregated residual is mapped to one of five regimes by two symmetric thresholds (default ±1 mild, ±2 strong):
Strong Trend — residual > +2. Aggressive momentum regime.
Trend — residual between +1 and +2. Trending.
Random — residual between −1 and +1. Brownian-like.
MR — residual between −2 and −1. Mean-reverting.
Strong MR — residual < −2. Aggressive reversion regime.
Visual system
Slope-coloured residual line with configurable width and optional area fill under it (transparency configurable).
Zero line and ±1 / ±2 threshold lines (toggleable).
Background tint by regime (subtle 88 transparency default) — teal trend, lavender MR, mint random.
Per-horizon plots (toggleable, off by default) — each horizon's residual as a faint dotted overlay; useful for seeing which horizon is driving the read.
Regime-change dots above the line at every confirmed flip.
A locked Aurora palette (teal trend / lavender MR / mint random on a deep-night ground) gives the pane a distinctive structural identity.
Dashboard
Monospaced table, positionable to any of nine corners, with vertical row-fade. Surfaces:
Aggregated residual (raw and smoothed).
Regime classification with glyph.
σ₁ value (the Brownian anchor).
Per-horizon residuals (h1 / h2 / h3) when enabled.
Bars in current regime.
Distance to nearest threshold.
Optional fancy Unicode header for the institutional aesthetic.
Alerts
Three alert conditions, each independently controllable:
Regime Change (any classification flip)
Strong threshold cross (±2)
Mild threshold cross (±1) — off by default
How to read it
Three reads, in order of conviction:
Strong Trend / Strong MR entry — the highest-conviction read. The market has decisively departed from Brownian scaling in one direction. Pair with a momentum tool in Trend regimes, a reversion tool in MR regimes.
Residual crossing zero — the regime fault line. Even before crossing a threshold, a sustained sign flip means the underlying distribution has rotated; the next threshold cross will confirm the new regime.
Per-horizon disagreement (when enabled) — when the short horizon is in trend regime but the long horizon is in MR regime, the market is in a nested state: short-term momentum inside a longer reversion. This is the textbook setup for fade-the-extreme intraday plays inside a wider range.
Suggested settings
Defaults (σ₁ window 100, observed σ window 60, horizons 5/20/100, equal weights, log returns ON, normalisation ON) are tuned for 15m–4H on liquid markets. For lower timeframes drop horizon 3 to 50. For HTF (daily+) raise horizon 3 to 200 and σ₁ window to 200. Log returns are theoretically correct and the recommended default — the script's regime classification depends on the scaling law, which assumes log returns; switch off only for research.
Originality
The √T Brownian scaling law is textbook continuous-time finance — the central piece of Bachelier's 1900 thesis and the foundation of every diffusion model in pricing. The implementation here — the per-horizon σ measurement pipeline, the σ₁-anchored Brownian baseline with optional normalisation, the three-horizon weighted aggregation, the EMA-smoothed residual classifier with two-tier thresholds, the per-horizon overlay layer, the regime-tinted background, and the dashboard — is JOAT-original. No third-party code reused. The use of residual against Brownian as a regime classifier is the original quantitative contribution.
Limitations
The √T law is exact only for Brownian motion — real markets have fat tails, autocorrelation, and discrete bars, so the measured "residual" is always non-zero even in a regime that looks random. The thresholds (±1 / ±2) are calibrated to be the regime boundaries empirically; tighten or loosen if your instrument has unusual variance behaviour. Per-horizon σ values need their respective windows populated to be meaningful — early bars give a warm-up read.
—
-made with passion by jackofalltrades
אינדיקטור
