Day-Extreme Reversal SignalsReal-time detector for the bar shapes that historically printed SPY's day low and day high. When a new session extreme forms, it tells you the measured probability that THIS bar holds as the day's extreme - and how those odds differ between 5-minute scouts and hourly signals.
OVERVIEW
Every intraday trader eventually asks the same two questions: "was that the low?" and "is this the high?" This indicator answers them with measured frequencies instead of intuition.
It watches for new session extremes in real time. When one prints, it classifies the bar's shape - reversal close, spring, V-confirm at lows; rejection, high-confirm at highs - and labels it with the historical probability that this specific shape, at this event, held as the day's extreme. A decision panel keeps the session context on screen: where the current extremes sit, when they printed, the odds the day's extreme has already happened given the time of day, and the structural rules for acting on lows versus highs.
The stats were built by real-time simulation - walking bar by bar and asking "would this signal have fired here, and did the extreme hold?" - not by locating day extremes in hindsight and describing them afterward.
WHY THIS IS DIFFERENT
PulseWire has time-of-day extreme statistics: tools that count in which hour or session window daily highs and lows historically print. Those answer "WHEN does the extreme usually happen?"
This script answers a different question: "is THIS bar the extreme?" The probabilities are conditional on an event (a new session extreme printing) and on the shape of the bar that printed it - not on the clock. To my knowledge no public script does event-conditional extreme classification, and none publishes the two findings that drive this tool's usage rules:
1 - The scout/signal hierarchy. The same shapes carry very different weight by timeframe. A 5-minute reversal close at a new session low held as the day low 28% of the time (versus a 14% baseline for any new session low) - interesting, not tradeable alone. The same shape on an HOURLY bar held 64% of the time (versus a 35% hourly baseline) - nearly two-thirds of occurrences marked the day low. The 5m shapes are scouts that put you on alert; the hourly shapes are the signal.
2 - Lows and highs are structurally different animals. In the data, lows are V-shaped: 55% of day lows were never retested within 30 minutes. Highs are processes: 82% of day highs were retested within 30 minutes. The practical asymmetry is baked into the panel - at lows, waiting for a retest usually means missing the trade; at highs, patience is statistically paid for.
THE SHAPES
All shapes evaluate only at a NEW session extreme (or on the bar immediately following one). At lows:
- RevClose - the bar makes a new session low but closes green and in the top third of its range. Sellers broke the floor and were immediately overwhelmed. Strongest low shape on both timeframes (5m: 28% holds; hourly: 64%).
- Spring - new session low with a long lower wick (more than half the bar) and a close off the floor. The push below found no acceptance (5m: 17%; hourly: 55%).
- V-confirm - the bar AFTER a red new-session-low bar opens and closes green above the prior open. Confirmation that the flush reversed (5m: 27%; hourly: 54%).
At highs:
- Reject - new session high with a long upper wick and a close out of the top third. (5m: 11% vs 9% base - barely above baseline; hourly: 47% vs 28% base.)
- HighConf / Confirm - a red bar immediately after a green new-session-high bar. (5m: 12%; hourly: 33%.)
Note what the high-side numbers say: even the best hourly high shape holds less than half the time. Tops are processes, and the script tells you so rather than pretending otherwise.
THE DECISION PANEL
- Current session low and high with their print times (ET).
- Time-of-day odds that the day's extreme has ALREADY printed, interpolated from the measured distribution (37% of lows are in by 10:00 ET, 60% by 11:30; highs run later - 18% by 10:00, with a heavy skew into the final hour).
- A provisional read of what the current, still-forming hourly bar is shaping into.
- The two structural rules, always on screen: lows are V-shaped, do not wait for the retest; highs retest 82% of the time, exits and fades can be patient.
HOW TO USE IT
Work on a 5-minute chart (any intraday timeframe runs; daily charts are rejected with an error).
- A 5m scout triangle at a new session low means: stop, context check. Alone it is a minority bet.
- The teal background band - an hourly low shape confirming - is the signal. Odds the day low is in jump to roughly fifty-fifty or better. Because lows are V-shaped, the statistically supported action is to act on the signal bar rather than wait for a pullback that usually never comes.
- The orange band at highs is a warning, not a green light to fade aggressively: expect a retest attempt, and use it - the second look at a high is where shorts and exits get their fill.
- The time-of-day odds frame everything: a new low printing at 14:30 ET is a rarer, more reliable event than one at 09:45, simply because most days have already made their low by then.
Alerts are provided for the hourly low signal, the hourly high signal, and the strongest 5m scout.
THE DATA, STATED PLAINLY
- Instrument: SPY. Samples: 60 days of 5-minute bars and 730 days of hourly bars.
- Method: real-time simulation. The detector walked forward bar by bar; every firing was recorded with whether that extreme survived as the day's extreme. No hindsight selection.
- Every probability is shown next to its baseline (the hold rate of ANY new session extreme on that timeframe), so you can see the edge, not just the number.
- The percentages are fixed numbers derived from that study, embedded in the script. They are descriptive statistics of a specific instrument over a specific period - not guarantees, and they will drift as market character changes.
- On symbols other than SPY (and index products that track it closely), the shape logic still runs, but the printed percentages do not apply. Treat them as unknown there.
LIMITATIONS
- Hourly signals use confirmed hourly bars (the standard non-repainting idiom - no future data is accessed), so they appear at the close of the hour, not at its low. The "forming" panel row is explicitly provisional and changes until the hour closes.
- 5m labels print on bar confirmation.
- The session-extreme state resets each calendar session; extended-hours settings on your chart change what counts as the session.
- The 60-day 5-minute sample is modest; the hourly sample (roughly two years) is the sturdier one, which is one more reason the hourly shapes are the signal tier.
- This is a probability tool, not an entry system. It quantifies "was that the extreme?" - stops, targets, and sizing are yours.
NOTES
The time-of-day asymmetry the data surfaced - lows early, highs late, lows violent, highs sticky - echoes the old observation running from George Douglass Taylor through Linda Raschke's day-structure work: down moves complete in the morning and buying builds through the day more often than the reverse. This script did not assume that; the simulation found it independently in modern SPY data.
Educational tool, not financial advice. Indicator

Adaptive Trend Ensemble [BackQuant]Adaptive Trend Ensemble
Overview
Adaptive Trend Ensemble is an online-learning trend filter that combines eight different moving-average methods into one continuously weighted trend estimate.
Instead of selecting one moving average permanently, the indicator treats each method as an independent forecasting expert. Every bar, each expert is evaluated according to whether its previous slope correctly anticipated the direction of the latest price move.
Experts that were directionally correct retain more influence. Experts that were wrong lose influence through a multiplicative penalty. The weights are then normalised and used to blend all eight moving-average values into one adaptive ensemble line.
The indicator therefore attempts to answer two separate questions:
Which smoothing method has recently aligned best with price direction?*
How strongly do the weighted methods currently agree on the direction of trend?
The final output includes:
A dynamically weighted ensemble trend line.
Bullish and bearish trend-state colouring.
A gradient between price and the ensemble.
A consensus-driven glow.
Trend-coloured candles.
A live label showing the leading expert and its current weight.
Alerts when the ensemble trend changes direction.
This is not a fixed moving average and it is not a simple average of several indicators. The contribution of each expert changes over time according to its recent directional performance.
Core idea
Moving averages respond differently to the same market.
A Hull Moving Average may respond quickly during a sharp transition, while an RMA may remain stable through temporary noise. A linear-regression estimate may follow a smooth directional move well, while a conventional EMA may perform better during a more ordinary trend.
No individual smoothing method is consistently superior across every environment.
Markets alternate between:
Persistent trends.
Fast breakouts.
Slow directional drift.
Volatile reversals.
Compressed ranges.
Noisy transitions.
A fixed indicator cannot change its mathematical personality when the environment changes. It continues using the same weighting structure regardless of whether that structure currently suits the market.
Adaptive Trend Ensemble addresses this by maintaining a bank of different smoothing methods and changing their influence through time.
The model does not attempt to decide in advance which method is best. It allows recent realised price action to determine which experts should currently receive more weight.
Prediction with expert advice
The indicator is based on a class of online-learning methods commonly described as:
Prediction with Expert Advice
In this framework:
Several experts produce predictions.
The actual outcome is observed.
Each expert receives a loss based on its prediction.
Expert weights are updated.
The combined model places more influence on better-performing experts.
The term “expert” does not imply that each method is intelligent by itself. An expert is simply an individual forecasting rule.
In this indicator, the eight experts are eight moving-average methods.
The model uses a multiplicative-weights process closely related to the Hedge and Weighted Majority families of online-learning algorithms.
The central principle is:
Do not commit permanently to one model.
Track several models simultaneously.
Reduce the weight of models that make mistakes.
Allow the combined forecast to adapt as relative performance changes.
Online learning
The model learns sequentially, one bar at a time.
It does not train on a separate historical dataset and then freeze its parameters.
At each new bar:
The previous slope of each moving average is treated as that expert's prediction.
The realised close-to-close direction is observed.
Each expert receives a loss.
Weights are updated multiplicatively.
Weights are normalised.
The current expert values are blended using the new weights.
This makes the process online and adaptive.
The weight state is carried forward from bar to bar, meaning the current ensemble reflects the accumulated results of earlier expert decisions.
The expert bank
The ensemble contains eight moving-average experts:
Simple Moving Average - SMA*
Exponential Moving Average - EMA
Weighted Moving Average - WMA*
Hull Moving Average - HMA
Double Exponential Moving Average - DEMA*
Running Moving Average - RMA
Arnaud Legoux Moving Average - ALMA*
Least-Squares Moving Average - LSMA
All experts use the same Base Length.
This is important because it keeps their nominal observation horizon comparable. The ensemble is comparing different mathematical treatments of approximately the same lookback rather than comparing completely unrelated time horizons.
Even with an identical length, the experts behave differently because they assign weight to historical observations in different ways.
Simple Moving Average - SMA
The SMA applies equal weight to every observation inside the selected window.
Its general form is:
SMA = Sum of observations / Number of observations
The SMA is stable and easy to interpret, but every included observation has the same importance.
This can make it slower to react when a new trend begins because older prices continue to influence the average until they leave the window.
Within the ensemble, the SMA acts as a neutral equal-weight baseline.
Exponential Moving Average - EMA
The EMA assigns progressively greater weight to recent observations.
Its recursive form is based on:
EMA = α × Current Price + (1 - α) × Previous EMA
where α is determined by the selected length.
Compared with an SMA of the same length, an EMA generally responds more quickly to recent movement.
Its recursive weighting makes it useful during ordinary directional markets, although it can still turn repeatedly when price oscillates in a range.
Weighted Moving Average - WMA
The WMA assigns linearly increasing weight to more recent observations.
For example, in a simplified four-period WMA, the newest value receives four units of weight, while the oldest receives one.
This makes the WMA more responsive than an equal-weight SMA while retaining a finite lookback window.
Within the ensemble, it provides a direct recency-weighted alternative to the exponential behaviour of the EMA.
Hull Moving Average - HMA
The Hull Moving Average was designed to reduce lag while preserving a relatively smooth output.
Its construction combines weighted moving averages over different horizons, applies a lag-compensation step, and then smooths the result over approximately the square root of the original length.
Conceptually:
Calculate a faster WMA.
Calculate a slower WMA.
Use their difference to compensate for lag.
Smooth the compensated result.
The HMA often reacts quickly to changes in trend direction.
That responsiveness can make it valuable during strong transitions, but it may also make it more sensitive to short-term oscillation.
Double Exponential Moving Average - DEMA
Despite its name, DEMA is not simply an EMA calculated twice.
Its general construction is:
DEMA = 2 × EMA - EMA of EMA
The second EMA estimates some of the lag in the first EMA. Subtracting it attempts to create a smoother with less delay.
DEMA can respond quickly to directional changes, although reduced lag may also increase sensitivity during unstable conditions.
Running Moving Average - RMA
RMA is commonly associated with Wilder-style smoothing.
It uses a slower recursive update than a typical EMA of the same nominal length.
Its general form places substantial influence on the previous RMA value, producing a persistent and stable estimate.
The RMA expert often changes direction less aggressively than the faster methods.
Within the ensemble, it acts as one of the more conservative smoothing models.
Arnaud Legoux Moving Average - ALMA
ALMA applies a Gaussian-style weighting curve across the observation window.
The weighting distribution can be shifted toward more recent observations while maintaining a smooth bell-shaped profile.
The script uses a recent-weighted offset and a fixed Gaussian width.
ALMA attempts to balance:
Smoothness.
Reduced lag.
Controlled weighting of the observation window.
It provides a different weighting structure from the linear, exponential and lag-compensated experts.
Least-Squares Moving Average - LSMA
The LSMA is based on linear regression.
Instead of averaging historical prices directly, it fits a straight line through the selected window and evaluates the regression estimate at the current bar.
The method attempts to represent the local directional path of price.
LSMA can follow smooth trends closely because it models slope explicitly. However, it may respond strongly when the local regression direction changes abruptly.
Within the indicator, the LSMA is produced using the rolling linear-regression output.
Base Length
The Base Length is shared by all eight experts.
Lower values:
Make every expert more responsive.
Increase sensitivity to short-term changes.
Produce faster weight and trend changes.
Increase the possibility of whipsaws.
Higher values:
Create smoother expert outputs.
Focus the ensemble on broader trend structure.
Reduce short-term changes.
Increase lag during sudden reversals.
Because all experts share the same length, changing this setting adjusts the entire ensemble horizon.
It does not change the number of experts or their relative starting weights.
Expert predictions
The model evaluates each expert using the direction of its slope.
For each moving average:
Rising slope is represented as +1.
Falling or non-rising slope is represented as -1.
To evaluate the latest completed move, the script uses the expert's slope from the previous bar.
For example:
If the expert was rising from two bars ago to the previous bar, it predicted a positive current move.
If the expert was falling, it predicted a negative current move.
The realised outcome is determined from the current close relative to the previous close:
Close above previous close = positive realised direction.
Close below previous close = negative realised direction.
Unchanged close = zero realised direction.
The model therefore scores directional slope prediction, not the numerical distance between each moving average and price.
An expert is rewarded for getting direction right, even if its plotted value is relatively far from the market.
Likewise, an expert is penalised for getting direction wrong even if its line remains visually close to price.
Loss functions
The indicator provides two loss functions:
Directional 0/1*
Magnitude-weighted
The selected loss determines how strongly incorrect experts are penalised.
Correct experts receive zero loss under both modes.
Directional 0/1 loss
Directional mode treats every incorrect prediction equally.
The loss is:
0 when the expert predicted the realised direction correctly.
1 when the expert predicted incorrectly.
This means that an incorrect prediction on a very small move receives the same loss as an incorrect prediction on a large move.
Directional mode answers a simple question:
Was the expert right or wrong?
It does not consider how important the move was.
This mode can produce consistent learning because every directional observation is treated equally, but it may respond to small and insignificant price changes as strongly as major moves.
Magnitude-weighted loss
Magnitude-weighted mode scales the penalty according to the size of the realised move.
The move is normalised using ATR:
Move = Absolute close-to-close change / ATR
The ATR uses the shared Base Length.
The incorrect expert's loss becomes:
Loss = Normalised Move
with the magnitude capped at 3.
The cap prevents a single extreme bar from creating an unlimited penalty.
This mode gives greater importance to mistakes during large movements.
For example:
An incorrect expert during a 0.10 ATR move receives a small penalty.
An incorrect expert during a 1.00 ATR move receives a larger penalty.
An incorrect expert during a move above 3 ATR receives the capped penalty of 3.
Magnitude-weighted mode answers:
How costly was the directional mistake relative to current volatility?
This can make the ensemble adapt more strongly after significant movements while paying less attention to small fluctuations.
Flat price bars
If the current close is unchanged from the previous close, the realised direction is zero.
Because expert directions are encoded as either positive or negative, no expert can exactly match a zero realised direction.
Under Directional mode, all experts receive the same incorrect classification.
Because every weight is multiplied by the same penalty factor, their relative weight distribution remains effectively unchanged after normalisation.
Under Magnitude-weighted mode, the realised move is zero, so the resulting penalty is also zero.
In both cases, a completely flat close-to-close bar does not materially change the relative ranking of the experts.
Multiplicative weight update
Each expert begins with an equal weight:
Initial Weight = 1 / 8
After the loss is calculated, the weight is updated using:
New Unnormalised Weight = Old Weight × exp(-η × Loss)
where η is the Learning Rate.
This is the central Hedge or multiplicative-weights update.
Correct experts have zero loss:
exp(-η × 0) = 1
Their unnormalised weight is unchanged.
Incorrect experts have a positive loss, so their weight is multiplied by a value below one.
For example, in Directional mode with a Learning Rate of 2:
Incorrect Weight Multiplier = exp(-2) ≈ 0.135
An incorrect expert retains only about 13.5% of its previous unnormalised weight before the weight set is normalised again.
This does not mean its final displayed weight will necessarily fall by exactly 86.5%, because all expert weights are subsequently rescaled so they sum to one.
Why multiplicative updates are used
An additive system might subtract a fixed quantity from each incorrect expert.
That can create problems:
Weights can become negative.
The same penalty has a different effect on large and small weights.
The model may not adapt proportionally.
A multiplicative update preserves non-negative weights and penalises experts proportionally to their current influence.
It also allows the distribution to become concentrated around consistently successful methods.
Learning Rate - η
The Learning Rate controls how aggressively the ensemble shifts weight after mistakes.
Higher values:
Penalise incorrect experts more strongly.
Move influence rapidly toward recent winners.
Can produce winner-take-all behaviour.
Can make the leader change abruptly after a few important bars.
Lower values:
Produce gradual weight changes.
Keep the expert distribution more diversified.
Reduce sensitivity to short-term performance.
Make the model slower to adapt.
The Learning Rate does not change the moving averages themselves. It changes only how quickly their relative influence evolves.
High Learning Rate behaviour
At high settings, a wrong expert may lose most of its weight after one or two mistakes.
This can be beneficial when one smoothing method is clearly better suited to the current regime.
It can also create instability:
A recent winner can dominate the ensemble.
A temporary performance streak can cause excessive concentration.
The model can switch leaders quickly when conditions reverse.
Low Learning Rate behaviour
At low settings, the ensemble behaves more like a slowly adapting average of the expert bank.
No single observation dramatically changes the distribution.
This produces smoother adaptation, but a poorly suited expert may retain substantial influence for longer.
Weight normalisation
After all expert weights are updated, they are normalised:
Normalised Weight = Expert Weight / Sum of All Expert Weights
This ensures that the complete weight set sums to one.
The weights can then be interpreted as each expert's share of the ensemble.
For example:
A 25% weight means that expert contributes one quarter of the weighted output.
A 5% weight means its current influence is relatively small.
The weights are not probabilities that the experts will be correct on the next bar.
They are adaptive influence coefficients based on accumulated relative loss.
Weight Floor
The optional Weight Floor preserves a minimum allocation for every expert.
After normalisation, the adjusted weight is calculated so that:
Every expert receives at least the selected floor.
The remaining weight is distributed according to the normalised Hedge weights.
The full set continues to sum to one.
For eight experts, a floor of 0.01 reserves at least 1% for each expert.
This assigns:
A minimum combined mass of 8%.
The remaining 92% according to relative performance.
A floor of 0.05 reserves at least 5% for each of the eight experts, using 40% of the total distribution as minimum allocations.
The remaining 60% is distributed according to current performance.
Why use a floor?
Without a floor, repeatedly incorrect experts can approach a weight extremely close to zero.
Because the update only reduces weights after losses, an expert with almost no weight may require a long period of relative outperformance before it becomes influential again.
A positive floor keeps all methods alive.
This allows an expert that performed poorly in the previous regime to recover more quickly when the market environment changes.
Weight Floor set to zero
With a zero floor:
The model is free to concentrate almost entirely in one expert.
Recent winners can dominate strongly.
The ensemble can become highly specialised.
This produces the purest multiplicative-weights behaviour but increases the risk of weight collapse.
Positive Weight Floor
With a positive floor:
The expert bank remains diversified.
Cold experts retain some influence.
The model can recover more easily after regime changes.
The leading expert's maximum possible weight is reduced.
The floor therefore controls the balance between specialisation and diversity.
Ensemble output
After the weight update, the current values of the eight experts are blended:
Ensemble = Sum of Expert Weight × Expert Value
This is a weighted average in which the weights are determined by online directional performance.
If the HMA currently has the greatest weight, the ensemble will behave more like the HMA.
If the RMA and SMA dominate, the output will become smoother and more conservative.
If the weights are distributed evenly, the line represents a broad blend of all eight methods.
The output can therefore change its effective smoothing behaviour without changing the user-selected Base Length.
Line Smoothing
The weighted ensemble may be passed through an optional EMA for visual smoothing.
A setting of 1 effectively disables this additional stage.
Higher settings:
Create a smoother displayed line.
Reduce small slope changes.
Delay bullish and bearish flips.
This smoothing is cosmetic in the sense that it occurs after the online expert weighting.
It does not affect:
Expert predictions.
Expert losses.
Weight updates.
Consensus.
Leader selection.
It does affect the final plotted line and the trend state derived from that line.
Trend state
Trend direction is determined from the slope of the smoothed ensemble line.
If the line is above its previous value, trend becomes bullish.
If the line is below its previous value, trend becomes bearish.
If the line is unchanged, the previous trend persists.
This creates a persistent two-state regime.
A bullish flip occurs when the trend changes from bearish to bullish.
A bearish flip occurs when it changes from bullish to bearish.
The trend state is based on the ensemble's slope, not on price crossing the ensemble.
Price may be above or below the line without immediately changing its direction.
Consensus calculation
The indicator calculates a separate weighted directional vote.
Each expert's current slope direction is multiplied by its current weight:
Weighted Vote = Sum of Weight × Direction
Because each direction is either +1 or -1 and the weights sum to one, the vote lies between -1 and +1.
Examples:
+1 means all meaningful weight is assigned to rising experts.
-1 means all meaningful weight is assigned to falling experts.
0 means bullish and bearish weighted influence is evenly balanced.
The displayed consensus strength is:
Consensus Strength = Absolute Value of Weighted Vote
This converts the result to a range from zero to one.
0% means the weighted expert bank is evenly divided.
100% means the weighted influence is entirely aligned in one direction.
Weighted consensus versus expert count
Consensus is not calculated by simply counting how many of the eight experts are rising.
An expert with a 40% weight contributes more than one with a 2% weight.
For example:
Five low-weight experts may be bullish.
Three high-weight experts may be bearish.
The final weighted vote can still be bearish.
This means consensus measures the agreement of the current weighted model, not the raw number of methods on each side.
With a zero Weight Floor, consensus may become very high when one expert dominates, even if several near-zero-weight experts disagree.
With a positive floor, disagreement from the remaining experts has more influence on the consensus value.
Consensus is not confidence
The consensus percentage should not be interpreted as a probability that the trend will continue.
It measures only the current alignment of weighted expert slopes.
High consensus means:
The influential experts point in the same direction.
It does not guarantee:
Future price continuation.
A profitable entry.
Low reversal risk.
Strong agreement can occur late in a mature trend as well as early in a new one.
Leading method
The live information label identifies the expert with the highest current weight.
It displays:
The expert name.
Its current percentage weight.
The weighted consensus strength.
The current ensemble direction.
For example:
Leading: HMA (34.5%)*
Consensus: 78% ▲
This means the HMA currently has the largest share of the ensemble and the weighted expert bank is strongly aligned upward.
The leader percentage is not a win probability.
It is only the experts share of the current normalised weight distribution.
Leader changes
The leading method can change when:
The current leader makes directional mistakes.
Another expert remains correct while competitors are penalised.
A large magnitude-weighted move strongly changes relative weights.
The market transitions into a regime better suited to another smoother.
Leader changes can help reveal how the ensemble is adapting.
For example:
A shift toward HMA or DEMA may reflect stronger preference for responsive methods.
A shift toward SMA or RMA may reflect better recent performance from slower methods.
A shift toward LSMA may occur during a smooth local directional path.
These interpretations are contextual and should not be treated as fixed rules.
Gradient fill
The indicator fills the area between price and the ensemble line.
When price is above the line:
A bullish gradient is displayed.
When price is below the line:
A bearish gradient is displayed.
The gradient visually separates price from the adaptive trend estimate.
The fill reflects price location, while the line colour reflects the slope-derived ensemble trend.
These can temporarily disagree.
For example:
Price may fall below a still-rising ensemble during a pullback.
Price may rise above a still-falling ensemble during a counter-trend rally.
This disagreement can provide useful context.
Consensus glow
A glow is drawn around the ensemble line.
Its brightness changes according to weighted consensus.
When consensus is high:
The glow becomes brighter and more visible.
When the experts are divided:
The glow becomes more transparent.
The glow width is scaled using ATR based on the Base Length, helping the effect remain proportional across instruments and volatility environments.
The glow is a visual representation of model agreement. It does not modify the line or trend calculation.
Candle colouring
Candles can be coloured according to the current ensemble trend:
Bullish trend uses the selected bullish colour.
Bearish trend uses the selected bearish colour.
Candle colouring is based on the direction of the ensemble line, not the direction of each individual candle.
A bearish candle can therefore remain green during a bullish ensemble regime, and a bullish candle can remain red during a bearish regime.
How to interpret the indicator
Bullish ensemble trend
A bullish state means the final ensemble line is rising.
This indicates that the current weighted combination of experts is moving upward.
It does not require all individual experts to be bullish.
Bearish ensemble trend
A bearish state means the final ensemble line is falling.
The weighted combination is moving downward, even if one or more individual experts remain bullish.
High bullish consensus
A strongly positive vote means most influential expert weight is assigned to rising methods.
This can indicate broad directional alignment.
High bearish consensus
A strongly negative vote means the influential experts are predominantly falling.
Low consensus
A consensus near zero means weighted expert directions are divided.
This can occur during:
Trend transitions.
Sideways ranges.
Pullbacks.
Disagreement between faster and slower methods.
Low consensus does not automatically mean price will remain sideways. It means the ensemble's components are not currently aligned.
High leader weight and high consensus
This indicates that:
One method currently dominates.
The broader weighted bank is aligned with it.
The model is highly concentrated and directionally unified.
This can produce a responsive and decisive ensemble, but it also means the output depends heavily on the current leader.
Distributed weights and high consensus
This means several experts maintain meaningful weights while pointing in the same direction.
The trend is supported by a more diversified group of methods.
Leader weight high but consensus low
This can occur when the dominant expert points one way while several remaining experts point the other way.
The ensemble may still follow the leader, but internal disagreement is present.
How to use the indicator
1. Trend regime filter
Use the ensemble slope as directional context:
Prioritise long setups during bullish regimes.
Prioritise short setups during bearish regimes.
The indicator does not define entry price, stop placement or profit targets.
2. Consensus filter
A user may require stronger consensus before acting on the trend state.
For example:
A bullish flip with low consensus may represent an early or uncertain transition.
A bullish regime with high consensus indicates broader weighted alignment.
No universal consensus threshold is appropriate for every market.
3. Pullback analysis
During a bullish ensemble regime:
Price moving toward or below the line may represent a pullback.
The ensemble remaining bullish suggests its trend estimate has not yet reversed.
During a bearish regime:
Price moving toward or above the line may represent a counter-trend rally.
Price interaction with the line should be combined with structure and risk management.
4. Regime adaptation observation
The Leading Method label can be used to study how different smoothers perform through changing environments.
Rather than assuming one moving average is always best, the user can observe:
Which expert gains weight during trends.
Which expert takes over during transitions.
How concentrated the model becomes.
How quickly weights change under different Learning Rates.
5. Bullish and bearish flips
Trend flips can be used as:
Regime-change alerts.
Confirmation for another setup.
Potential exit conditions.
A directional filter for discretionary trades.
Because flips are based on line slope, responsive settings can generate repeated changes during ranges.
Suggested configurations
Balanced adaptive configuration
Moderate Base Length.
Moderate Learning Rate.
Directional loss.
Small positive Weight Floor.
Minimal Line Smoothing.
This keeps the model adaptive while preserving some expert diversity.
Fast adaptation configuration
Shorter Base Length.
Higher Learning Rate.
Magnitude-weighted loss.
Zero or very small Weight Floor.
Line Smoothing of 1 or 2.
This allows rapid concentration around recent winners but can create unstable leader changes.
Conservative diversified configuration
Longer Base Length.
Lower Learning Rate.
Directional loss.
Positive Weight Floor.
Additional Line Smoothing.
This creates slower and more diversified adaptation.
Large-move-focused configuration
Magnitude-weighted loss can be used when mistakes during large ATR-normalised moves should matter more than errors during minor fluctuations.
This may reduce the influence of small alternating bars on the weight distribution.
Pure directional configuration
Directional loss is useful when every close-to-close directional observation should be treated equally.
It creates a straightforward right-or-wrong scoring process.
How this differs from averaging moving averages
A normal moving-average ribbon or composite may calculate:
Average of SMA, EMA, HMA and other methods.
If every method receives equal weight permanently, its influence never changes.
Adaptive Trend Ensemble instead calculates:
Performance-dependent weights.
Sequential loss updates.
A dynamically changing weighted output.
Two bars with the same expert values can produce different ensemble values if the weight distributions differ.
How this differs from selecting the current fastest average
The indicator does not select whichever moving average is currently closest to price or whichever has moved the most.
Weights are based on whether previous expert slopes correctly anticipated realised price direction.
An expert can therefore lead even if it is not the fastest or closest line.
How this differs from an optimisation
The model does not search historical data for one set of parameters with the best backtest result.
It does not change the shared length of each expert.
Instead, it performs continuous online adaptation of the expert weights.
This avoids permanently selecting one historical winner, but it also means recent performance can strongly influence the current model.
How this differs from a machine-learning forecast
The indicator uses a genuine online-learning algorithm, but it is not a neural network or a price-target forecasting model.
It does not estimate the size of the next move.
The experts make binary directional predictions derived from their slopes.
The learning system then adjusts how much influence each moving-average value receives.
It is therefore best understood as an adaptive model-selection and blending process.
Causality and real-time behaviour
The learning update uses:
The prior-bar slope of each expert.
The current close-to-close realised direction.
It does not use future bars.
On historical completed candles, the update is fully causal.
On the current live candle:
The close can continue changing.
The realised direction can change.
Expert values can change.
Weights and consensus can update intrabar.
A bullish or bearish flip may appear before the candle closes.
Users requiring confirmed signals should evaluate the indicator at bar close.
Strengths
Combines eight distinct smoothing methods.
Adapts expert influence through online learning.
Supports directional and magnitude-sensitive losses.
Uses multiplicative updates rather than fixed weighting.
Provides optional protection against permanent weight collapse.
Separates ensemble direction from expert consensus.
Displays the currently leading method.
Uses one shared horizon for a fairer expert comparison.
Requires no offline training process.
Provides transparent open-source calculations.
Summary
Adaptive Trend Ensemble combines eight moving-average experts using a multiplicative online-learning model.
Each expert uses the same Base Length but applies a different smoothing method. The previous slope of each expert acts as its directional prediction for the latest close-to-close move.
After the realised direction is observed, incorrect experts receive either a fixed directional loss or an ATR-normalised magnitude-weighted loss. Their weights are reduced using an exponential Hedge update, then normalised and optionally adjusted using a minimum Weight Floor.
The current expert values are blended according to these adaptive weights, producing one ensemble line whose effective behaviour changes as different methods gain or lose influence.
A separate weighted vote measures current directional agreement. This consensus controls the visual glow and is displayed beside the current leading expert.
The result is a transparent adaptive trend model that does not assume one moving average will remain optimal. Instead, it continuously redistributes influence toward the methods that have recently aligned better with realised price direction while retaining configurable control over responsiveness, diversity and visual smoothing.
Indicator

APEX v14 CLEAN - MNQ/MESNITRO V15 amazing bot just try it out is an advanced AI-powered trading assistant built for precision, discipline, and consistency. Designed around smart money concepts, liquidity analysis, and market structure, it identifies high-probability trading opportunities while filtering out low-quality setups. By combining multiple layers of confluence—including liquidity sweeps, order blocks, fair value gaps (FVGs), optimal trade entries (OTE), trend strength, volatility, and higher-timeframe confirmation—BRABUZ helps traders make confident, data-driven decisions with a strong focus on risk management and capital preservation.
Rather than generating constant signals, BRABUZ is engineered to prioritize quality over quantity, waiting patiently for A+ setups with the highest statistical edge. It continuously adapts to changing market conditions, providing clear trade entries, stop-loss placement, profit targets, and real-time market bias in a clean, easy-to-read interface. Whether you're a prop firm trader, futures trader, or experienced retail trader, BRABUZ is designed to eliminate emotional decision-making, improve consistency, and give you a professional-grade trading edge. is an advanced AI-powered trading assistant built for precision, discipline, and consistency. Designed around smart money concepts, liquidity analysis, and market structure, it identifies high-probability trading opportunities while filtering out low-quality setups. By combining multiple layers of confluence—including liquidity sweeps, order blocks, fair value gaps (FVGs), optimal trade entries (OTE), trend strength, volatility, and higher-timeframe confirmation—BRABUZ helps traders make confident, data-driven decisions with a strong focus on risk management and capital preservation.
Rather than generating constant signals, BRABUZ is engineered to prioritize quality over quantity, waiting patiently for A+ setups with the highest statistical edge. It continuously adapts to changing market conditions, providing clear trade entries, stop-loss placement, profit targets, and real-time market bias in a clean, easy-to-read interface. Whether you're a prop firm trader, futures trader, or experienced retail trader, BRABUZ is designed to eliminate emotional decision-making, improve consistency, and give you a professional-grade trading edge. Indicator

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

Indicator

Risk Reward Scenario Analyzer - Entry Stop Target VisualizerOverview
Risk Reward Scenario Analyzer is an interactive trade-planning and scenario-research indicator for manually defined Entry, Stop and Target levels.
The script does not generate a market-direction signal, select an entry, recommend a stop, or predict a target. The user defines the trade geometry. The indicator then measures the planned reward-to-risk multiple, stress-tests that multiple against entry-price drift, and audits whether the Stop or Target was reached first under explicit confirmed-OHLC rules.
The implementation is centered on three connected research tasks:
1. Entry execution drift testing
2. Confirmed-OHLC first-touch auditing
3. Consecutive testing of multiple hypothetical scenarios
This combination is the main reason the script exists as a separate publication rather than as a basic risk/reward box.
Interactive trade plan
The user places four interactive values directly on the chart:
- Entry
- Anchor time
- Stop loss
- Take-profit target
The Entry and Anchor form one interactive chart point. Stop and Target can be repositioned independently.
Direction can be selected manually or derived from the geometry:
Long:
Stop < Entry < Target
Short:
Target < Entry < Stop
Invalid geometry remains visible for correction and is not processed as a valid scenario.
Two activation methods are available:
Assume filled at anchor:
The research scenario begins from the selected anchor.
Wait for entry touch:
The scenario activates only after a confirmed chart bar trades through the selected Entry. Exit evaluation begins on the following confirmed bar because chart OHLC cannot prove whether the Entry, Stop or Target occurred first inside the activation bar.
Planned R multiple
The basic calculations are:
Planned risk distance =
Absolute value of Entry - Stop
Planned reward distance =
Absolute value of Target - Entry
Gross R multiple =
Planned reward distance / Planned risk distance
The displayed gross break-even win rate is:
100 / (1 + Gross R)
This is a mathematical break-even threshold derived from the selected reward-to-risk relationship. It is not a prediction of the strategy's actual win rate.
Entry execution stress test
A planned R multiple can deteriorate when the actual entry is less favorable than the intended entry.
The Entry execution tolerance model keeps the selected Stop and Target fixed, then shifts the Entry in both directions.
The tolerance distance can be defined as:
- A percentage of the planned risk distance
- A number of minimum ticks
- A fraction of ATR captured at the anchor
For a Long scenario, the adverse entry is above the planned Entry and the favorable entry is below it.
For a Short scenario, the adverse entry is below the planned Entry and the favorable entry is above it.
The script calculates:
- Adverse entry R
- Favorable entry R
- Retained R percentage
- Low, Moderate or High R erosion
Retained R is calculated as:
Adverse entry R / Planned R x 100
This section is a sensitivity test. It does not predict spread, slippage or the price at which an order will actually be filled.
Confirmed-OHLC first-touch audit
After activation, the script audits whether the Stop or Target was reached first.
Terminal outcomes are evaluated from confirmed chart bars. The activation bar is excluded from exit evaluation because its intrabar sequence is unavailable from OHLC data alone.
The outcome states are:
- Target
- Stop
- Ambiguous
- Expired
- Active
- Waiting for entry
- Invalid
Gap opens are evaluated at the opening price before the normal high-low touch logic is applied.
If a confirmed bar touches both Stop and Target and the opening price did not already resolve the sequence, chart OHLC cannot reveal which level occurred first.
The default same-bar policy is:
Mark ambiguous
Two optional research assumptions are also available:
- Assume stop first
- Assume target first
These alternatives are explicit user-selected assumptions. They are not presented as reconstructed intrabar facts.
The scenario becomes Expired when the selected research horizon ends before Stop or Target is resolved.
Standard candlestick charts are recommended. Heikin Ashi, Renko, Kagi, Line Break, Point and Figure and other non-standard chart types can contain synthetic OHLC values. The panel identifies non-standard chart data as synthetic.
MFE, MAE and live progress
After activation, the script tracks:
- Maximum favorable excursion in R
- Maximum adverse excursion in R
- Current or terminal R
- Elapsed bars
- Research horizon
The activation bar is excluded from MFE and MAE for the same intrabar-order reason used by the first-touch audit.
Current R can change while the realtime bar is open. Target, Stop, Ambiguous and Expired outcomes are finalized from confirmed bars.
Risk budget, quantity and execution costs
The risk budget can be entered as:
- A percentage of account size
- A fixed cash amount
Cash conversion can use the symbol's point value or a manually entered point value.
Optional execution-cost assumptions include:
- Round-trip cash cost per unit
- Slippage in minimum ticks per side
Modeled loss per unit is:
Price risk per unit + Modeled execution costs
Modeled win per unit is:
Price reward per unit - Modeled execution costs
Raw quantity is:
Risk budget / Modeled loss per unit
The result is rounded down to the selected quantity step.
When costs are enabled, the script also calculates:
- Cost-adjusted R
- Cost-adjusted break-even win rate
- Modeled cash loss at Stop
- Modeled cash result at Target
The modeled quantity is an arithmetic research result. It is not a recommended, optimal or safe order size.
Point values, contract multipliers, lot conventions, commissions and margin requirements can differ by broker, exchange and instrument. Users must verify the applicable contract specifications independently.
Visual workflow
The main chart display includes:
- Reward area
- Risk area
- Entry execution tolerance band
- Entry, Stop and Target references
- Live or terminal R marker
- Compact scenario readout
The readout is intentionally limited to the information most relevant to reviewing the current scenario:
- Direction and state
- Planned or cost-adjusted R
- Mathematical break-even threshold
- Adverse entry R and retained R
- Risk budget and modeled quantity
- Modeled Stop and Target cash outcomes
- Current or terminal R
- Elapsed bars and research horizon
After a scenario resolves, the visual workflow can:
- Keep the full scenario
- Compact the result
- Clear completed visuals
Moving Entry, Anchor, Stop or Target causes Pine to recalculate the scenario from the selected inputs. A completely new placement can be started with PulseWire's Reset points command.
This behavior is intended for rapid comparison of several user-defined trade hypotheses. Previous scenarios are not stored as a permanent trade journal.
Alerts
The script provides factual alert conditions for:
- Scenario activation
- Target reached first
- Stop reached first
- Ambiguous same-bar outcome
- Research horizon expiry
Users must create the desired alerts separately through PulseWire's alert dialog.
Calculation behavior
The script does not use future data, lookahead or higher-timeframe data requests.
Changing an interactive point or any other input causes the available chart history to be recalculated using the new settings. This is normal input-driven Pine behavior and should not be interpreted as a persistent record of an earlier scenario.
Limitations
- Entry, Stop, Target, account values and cost assumptions are entered manually.
- The script does not identify or recommend a trade setup.
- It does not predict market direction.
- It does not read brokerage positions or Trading Panel account data.
- It does not place, modify or close orders.
- It does not reconstruct tick-by-tick movement inside historical bars.
- Same-bar Stop and Target order is unknowable from OHLC alone.
- Gap handling at the bar open is a research model, not a guaranteed fill model.
- Actual fees, spread, slippage and execution prices can differ from the entered assumptions.
- Point value can differ by broker, exchange and contract specification.
- Currency conversion, taxes, funding changes and margin requirements are not calculated automatically.
- Non-standard chart prices may not represent executable market prices.
- Results depend on the accuracy of the user's inputs.
- The script is a scenario visualization and research tool, not financial advice or a trade recommendation. Indicator

Indicator

Triple Confluence Meter - Trend, Momentum and Volume AgreementThree indicators agreeing feels like three reasons. Usually it is one reason counted three times — trend, momentum and volume all read the same price series, so of course they tend to point the same way.
This builds the ordinary confluence indicator and then does the thing confluence indicators never do: it grades itself.
THE THREE VOTES
Trend close above or below an EMA
Momentum RSI above or below 50
Volume the bar's direction, but only on bars where volume beats its average
Sum them for a score from −3 to +3. At the extremes all three agree, the bar is coloured, and a small triangle marks the first bar of each new alignment. On symbols with no volume feed the third vote abstains and the scale becomes −2 to +2 rather than quietly voting zero forever.
THE PART THAT MATTERS
Over the lookback, the script finds every alignment that happened at least one full horizon ago — so its outcome is already settled — and counts how often price actually went the signalled way. Then it does the subtraction almost nobody does:
Edge = hit rate after alignment − base rate over all bars
The base rate is the catch. A bullish signal firing during an uptrend will show a glorious 60% hit rate while price rose 60% of the time regardless, and an edge near zero tells you the signal contributed nothing. Only the difference is information.
READING THE SCORECARD
Trend / Momentum / Volume — each vote's current direction, with the RSI value shown so you can see how close the momentum vote is to flipping.
Score — the sum and whether it counts as aligned.
Base rate up — how often price rose over the horizon on all bars in the window. This is the number to beat.
After bull align / After bear align — the hit rate following each kind of alignment, with n= the number of events behind it. Read the n before the percentage. Alignment is rare by construction and thirty events is an anecdote.
Edge — the two subtractions, in percentage points. Positive means the alignment knew something the drift did not.
Sample — bar count and the roughly independent sample size. Overlapping horizons mean 500 bars at a 10-bar horizon is nearer 50 independent observations.
WHAT IT SHOWS RIGHT NOW
On BTCUSD 1h at the time of writing, with a 50% base rate: after bullish alignment price rose just 31.0% of the time across 58 events, an edge of −19.0 pp. Bearish alignment fared better but still negative at −7.9 pp.
Read that again, because it is the whole argument. Buying when trend, momentum and volume all agreed was substantially worse than a coin flip over this window. In a mean-reverting market that is exactly what a momentum confluence should do — it arrives late, at the point where the move it is confirming is closest to exhaustion. The indicator is not broken. The premise is.
Run it on your own symbol and timeframe before drawing any conclusion from mine. The answer changes, and being able to see it change is the point of shipping this rather than another confluence indicator that just glows green.
HONEST LIMITS
A hit rate is not a P&L. It ignores position size, cost, slippage, and the size of the moves it counts. Being right on small moves and wrong on large ones loses money at any hit rate.
Overlapping horizons correlate the observations, so the effective sample is much smaller than the event count implies. Treat differences of a few percentage points as noise.
Three votes drawn from one price series are not three independent opinions. That is a feature of the design being examined here, not a bug in the measurement.
Changing the EMA, RSI or volume lengths changes the answer. If you tune them until the edge looks good, you have fitted the window rather than found something.
NO REPAINT
There is no request.security call anywhere in this script, so the higher-timeframe lookahead problem does not arise. Every graded alignment sat at least one full horizon in the past and its outcome is already history. The current bar is scored but never graded.
Open source under MPL 2.0. Read it, fork it, tell me where I am wrong. Indicator

Indicator

Indicator

Indicator

NeuPortal - Base Rate SignalsFive standard entry rules running simultaneously on the price chart: moving average crossover, RSI reversal, MACD cross, Bollinger re-entry and Stochastic cross. Each marks its own small triangle under or over the candle, tagged with the rule that fired it. When several agree on the same bar, a consensus label is drawn.
That part is ordinary. Thousands of scripts do it.
THE NUMBER EVERY SIGNAL SCRIPT LEAVES OUT
Each rule is scored live against the base rate on your chart. The table prints three things per rule:
hit - how often that rule was followed by a move in its own direction
base - how often ANY bar was followed by that same move over the same window
edge - the difference
That difference is the only thing an entry rule can honestly claim.
A rule that hits 54% sounds like an edge until you ask what a bar picked at random scores. In a market that drifted upward over the sample, "price is higher 20 bars later" might be true 53% of the time whatever you do. A rule at 54% against a 53% baseline has found almost nothing. Every signal indicator in existence reports the 54 and omits the 53.
The edge will often be small and sometimes negative. That is the expected result, not a fault in the script. On ETHUSDT 4h at the time of writing, a WMA 21/65 crossover long scores 44.7% against a base rate of 51.1% - an edge of minus 6.4 across 123 signals and 10,026 scored bars. Buying a random bar would have been better than buying that signal.
THE CONSENSUS ROW IS AN EXPERIMENT, NOT A FEATURE
"Three indicators confirm the entry" rests on an assumption nobody checks: that three indicators are three pieces of evidence.
They are not. Measured over 19,580 four-hour bars of full Binance history, the rank correlation between these families runs around 0.80. Stochastic against Williams %R reaches 0.92; RSI against CCI 0.90. For n readings correlated at r, the effective number of independent readings is about n / (1 + (n - 1) * r). Five rules at 0.80 come to roughly 1.4.
So set how many rules must agree, and watch what happens. If agreement were evidence, the edge would rise as the threshold rises. Usually only the signal count falls. Trading less often for the same expectation is not an improvement, and this is the first indicator I know of that lets you see that rather than assume it.
TIMING
Three modes. Confirmed waits for the bar to close and never changes afterwards. Anticipate fires one bar earlier by projecting each rule's spread across zero, so some of those crosses never happen. Live fires on the unfinished bar and repaints.
Switch between them and watch the edge column. Earlier is only better if the edge improves, and usually it does not. Note that in Live mode the historical percentages were not earned under those conditions - history contains no unfinished bars, so every past signal was scored as confirmed. Live mode flatters itself, and the table marks it.
HOW THE SCORING WORKS
A signal counts as correct if price closed higher (long) or lower (short) a fixed number of bars later. Every count uses only bars that had already completed when the label was drawn, so nothing repaints and no percentage knows anything the chart did not. Early in a chart the sample is tiny and the table says "too few" rather than printing a flattering number from six observations.
WHAT THIS IS NOT
Not a strategy and not advice. Hit rate says nothing about the size of wins against losses: a rule right 60% of the time can lose money steadily. This measures direction only, over one fixed horizon, with no costs, no slippage and no position sizing.
It is a tool for finding out whether a familiar rule does anything at all on your instrument. The usual answer is very little, and knowing that is worth more than another arrow.
Indicator

NeuPortal - Confluence MeterThe standard oscillator set on one shared 0-100 scale: RSI, Stochastic, Williams %R, CCI, MFI, MACD histogram and Momentum. Toggle any of them, read them against each other, and get a consensus line.
That part is ordinary. Here is the part that is not.
WHY CONFLUENCE IS USUALLY WORTH LESS THAN IT LOOKS
"Five indicators confirm the signal" is the oldest line in technical analysis, and it is mostly a restatement of one thing said five times. These oscillators are near-transformations of each other.
Measured over 19,580 four-hour bars of full Binance history on BTCUSDT, the rank correlations are: Stochastic to Williams %R 0.92, RSI to CCI 0.90, Stochastic to CCI 0.89, Williams %R to CCI 0.87. The median pairwise correlation across all 21 combinations is 0.80. ETHUSDT over the same span reproduces the table to two decimal places.
For n readings with average correlation r, the effective number of INDEPENDENT readings is about n / (1 + (n - 1) * r). Seven oscillators at 0.80 come to roughly 1.2.
Seven agreeing indicators is one indicator, counted seven times.
The weakest pair in the set is RSI against the MACD histogram at 0.51. If you want two oscillators rather than seven, those two carry the most different information.
WHAT THE SCRIPT DOES ABOUT IT
It does not take the numbers above on trust. It measures the correlation live, on your symbol, your timeframe and your chosen lengths, then prints two things side by side in the table:
- agreement, the count of enabled oscillators on the same side of 50
- effective independent readings, derived from the measured correlation
The first is what people want to see. The second tells them what it is worth. When the second reads 1.3, a unanimous seven-to-nothing agreement is not seven pieces of evidence.
HOW THE SHARED SCALE WORKS
RSI, Stochastic and MFI are natively 0-100. Williams %R is shifted from its -100..0 range. CCI, the MACD histogram and Momentum have no fixed bounds, so they are converted with a percentile rank against their own recent history: the reading becomes where this value sits relative to how this instrument has behaved lately.
That is a real transformation and it is disclosed rather than buried. A percentile-ranked MACD histogram is not the MACD histogram, so the raw value is printed in the table alongside the scaled one. Nothing is hidden behind the normalisation.
SETTINGS WORTH KNOWING
Percentile lookback controls how much history the unbounded oscillators are ranked against. Shorter reacts faster and is noisier. Longer is steadier and slower to acknowledge a change in regime.
Correlation window controls how much history is used to measure independence. Longer is more stable but averages across regimes, and correlation between oscillators is not constant.
WHAT THIS IS NOT
Not a strategy, not a signal, not a recommendation. An oscillator crossing 50 is not an entry. The two alerts are deliberately descriptive rather than directional, because an alert that said "buy" would contradict everything the script exists to point out.
Free and open source. Read the code, change the lengths, run it on your own instruments and see whether the correlation on your market matches ours.
Indicator

Indicator

Indicator

Strategy

Regression_ToolkitThis is toolkit/library bridges advanced regression approaches not natively supported in Pinescript, to Pinescript. Advanced regression frameworks that can be critical to ticker data, such as Ridge, Lasso, ElasticNET, and Logistic (normalized) regression, colinarity measuring and quantile regression. As well as approaches to linear based feature selection and importance assessments.
I hope you find it helpful!
Library "Regression_Toolkit"
multipleRegression(y, x1, x2, length)
Parameters:
y (float)
x1 (float)
x2 (float)
length (simple int)
ridgeRegression(y, x1, x2, x3, x4, nVars, length, lambda)
Parameters:
y (float)
x1 (float)
x2 (float)
x3 (float)
x4 (float)
nVars (simple int)
length (simple int)
lambda (simple float)
lassoRegression(y, x1, x2, x3, x4, nVars, length, lambda, iterations)
Parameters:
y (float)
x1 (float)
x2 (float)
x3 (float)
x4 (float)
nVars (simple int)
length (simple int)
lambda (simple float)
iterations (simple int)
logisticRegression(y, x1, x2, x3, x4, nVars, length, learningRate, iterations)
Parameters:
y (float)
x1 (float)
x2 (float)
x3 (float)
x4 (float)
nVars (simple int)
length (simple int)
learningRate (simple float)
iterations (simple int)
featureSelection(y, x1, x2, x3, x4, nVars, length)
Parameters:
y (float)
x1 (float)
x2 (float)
x3 (float)
x4 (float)
nVars (simple int)
length (simple int)
regressionStats(y, x1, x2, x3, x4, nVars, length, b0, b1, b2, b3, b4)
Parameters:
y (float)
x1 (float)
x2 (float)
x3 (float)
x4 (float)
nVars (simple int)
length (simple int)
b0 (float)
b1 (float)
b2 (float)
b3 (float)
b4 (float)
elasticNetRegression(y, x1, x2, x3, x4, nVars, length, lambda, alpha, iterations)
Parameters:
y (float)
x1 (float)
x2 (float)
x3 (float)
x4 (float)
nVars (simple int)
length (simple int)
lambda (simple float)
alpha (simple float)
iterations (simple int)
huberRegression(y, x1, x2, x3, x4, nVars, length, huberK, iterations)
Parameters:
y (float)
x1 (float)
x2 (float)
x3 (float)
x4 (float)
nVars (simple int)
length (simple int)
huberK (simple float)
iterations (simple int)
quantileRegression(y, x1, x2, x3, x4, nVars, length, tau, learningRate, iterations)
Parameters:
y (float)
x1 (float)
x2 (float)
x3 (float)
x4 (float)
nVars (simple int)
length (simple int)
tau (simple float)
learningRate (simple float)
iterations (simple int) Library

Indicator

Parameter Plateau Map - Moving Average Crossover RobustnessEvery backtest has a best setting. The question almost nobody asks is whether the settings next to it were any good — and that question is the whole difference between an edge and a coincidence.
WHAT IT DOES
It sweeps a grid of fast/slow moving average pairs, scores all thirty valid combinations on the same data, and draws the result as a heatmap. What you are looking for is not the brightest cell. It is the shape around it.
A broad, coherent region → the result survives changing the parameters.
A single bright cell → you found noise and gave it a name.
THE PLATEAU SCORE
The heatmap makes the shape visible; this puts a number on it. It compares the best cell to its four immediate neighbours, both measured against the grid's own mean:
Plateau = (mean of neighbours − grid mean) ÷ (best − grid mean)
Near 1.00, the neighbourhood is nearly as good as the peak, so the peak is a ridge you can actually stand on. Near 0.00, the peak stands alone above an otherwise ordinary grid, and selecting it is curve fitting.
Measuring against the grid's own mean rather than a fixed 50% is deliberate. In a strongly directional window every cell shifts together, and a peak-versus-50% ratio would either explode or collapse on that shift alone. The shape of the surface is the question here, not its height. Height gets its own row.
HOW EACH CELL IS SCORED
Directional hit rate. On every bar in the window a cell votes long when its fast mean is above its slow mean, and the vote counts as correct if price moved that way over the next N bars. 50% is a coin flip.
Means come from a running cumulative sum, so a 233-length mean costs exactly what a 5-length mean costs. That is what keeps a thirty-cell sweep cheap enough to recompute live rather than making you wait.
READING THE VERDICT PANEL
Best pair — the winning fast/slow combination and its hit rate.
Best vs chance — how far that winner sits above or below 50%. This is the level question, kept deliberately separate from the shape question, because they have different answers surprisingly often.
Plateau — the shape. This is the headline.
Grid mean — where the whole surface sits. If this is far from 50%, the window had a strong directional character and every cell inherited it.
Best to worst — the spread across the grid, in percentage points.
Reading — PLATEAU, RIDGE, or SPIKE, so the number does not need interpreting mid-session.
Sample — bar count and, next to it, the roughly independent sample size. Overlapping forward windows mean 250 bars at a 10-bar horizon is closer to 25 independent observations than 250. That second number is the one that should govern how much you trust any of this.
WHAT IT SHOWS RIGHT NOW
On BTCUSD 1h at the time of writing: Plateau 0.86 — a smooth, well-behaved surface with no isolated spike — while Best vs chance reads −3.2 pp and the grid mean sits at 38%. Every one of the thirty settings scored below a coin flip, and they did so coherently rather than randomly. ETHUSD 1h looks much the same, best pair 49.2%, grid mean 40.4%.
That combination is worth sitting with. The parameter surface is not noisy at all. It is simply, consistently, unprofitable over this window — which is a far more useful thing to learn than which of thirty losing settings lost least.
HONEST LIMITS
A hit rate is not a P&L. It ignores position size, cost, slippage, and the size of the moves it is counting. A 55% hit rate that is right on small moves and wrong on large ones loses money.
The effective sample is small. Overlapping windows are correlated, so treat the independent figure in the Sample row as the real one, and treat a few percentage points of difference between cells as noise.
This measures one specific and rather crude strategy family. A flat or losing surface says moving average crossovers did not work here over this window. It does not say nothing works.
Widening the step ladder until the peak looks impressive will collapse the Plateau score, which is precisely what it is there for.
NO REPAINT
There is no request.security call anywhere in this script, so the higher-timeframe lookahead problem does not arise. Every cell is scored on bars that had already closed, the forward return grading a vote is always taken from bars after that vote and before the present, and only confirmed bars enter the sample.
Open source under MPL 2.0. Read it, fork it, tell me where I am wrong. Indicator

Machine Learning Support & Resistance [FEELS]Support and resistance levels found by an unsupervised machine learning model (k-means clustering) instead of hand-written rules. The model decides how many levels a chart actually has, which swings are structure and which are noise, and reports how cleanly this market separates into levels at all.
FEATURES
- Levels built by k-means clustering of confirmed swing highs and lows, in log price space
- The number of levels is chosen by the model, not by you
- Swings too scattered to form a level are labelled noise and drawn grey
- Zone width is the real extent of its group, so tightly agreed levels are thin and loose ones are wide
- Fit score: how cleanly the swings separate into levels on this symbol and timeframe
- Hold rate per level: how often price entered the zone and left from the side it came from
- Optional density profile of the swing distribution the model works on
- Two alerts, adjustable colours, sizes and every model parameter
HOW IT WORKS
Every confirmed swing high and low becomes a data point. The model works on the logarithm of price, so it behaves the same at 60 dollars and at 60 thousand, and only on swings inside the price band that still matters, so a long history does not drag levels into an irrelevant price range.
It then runs k-means clustering for every level count in the chosen range. Each result is scored with a simplified silhouette score, which measures how much closer each swing sits to its own group centre than to the next nearest one. The count with the cleanest separation wins, and that score is shown as the fit percentage in the header.
Each surviving group becomes a level: the mean of its members is the centre, the spread of its members is the zone, and the number of members is its weight. Groups whose swings are too scattered compared with the average group are rejected, and their swings are drawn grey as noise. The levels nearest to price are kept on the chart.
HOW TO READ IT
1. Thin zones are levels the market agreed on precisely, wide zones are areas where it turned around loosely. The swing count next to each level says how many times it was involved.
2. The fit percentage is a read on the market itself, not on the levels. A high value means price is respecting distinct levels; a low value means the structure is smeared and levels deserve less weight.
3. The hold rate column counts how often price entered a zone and left from the same side rather than closing through it, over the lookback window. It describes the past behaviour of that zone.
ORIGINALITY
Most level tools merge nearby swings with a fixed tolerance and a fixed level count. This one treats level detection as a clustering problem: the level count is selected by a simplified silhouette score rather than set by hand, zone width comes from the measured spread of each group rather than a preset band, sparse groups are rejected as noise instead of being forced into a level, and the quality of the whole separation is reported openly. The clustering, the model selection, the noise rejection and the hold-rate accounting are written from scratch for this script.
HONESTY
- The level set is recomputed as new swings confirm, so zones shift over time. This is a snapshot of current structure, not a fixed historical record, and it is inherent to any clustering or level tool.
- A swing pivot confirms only after the Swing size number of bars, so the newest swing is always that many bars old.
- The fit percentage and the hold rate describe past behaviour on the current symbol and timeframe. They do not predict anything, they are not performance claims, and small samples move them a lot.
- The model is deterministic: seeding is quantile based, so the same chart and the same settings always give the same levels.
- Clustering works best where there are enough clean swings. On very short histories or extremely thin symbols the model has too little to separate, and the fit percentage will show it.
ALERTS
Price entered a level · Price closed through a level.
SETTINGS
Every input has a tooltip. The main ones: "Swing size" sets how many bars on each side define a swing, "Model picks the level count" toggles automatic selection and the range it searches, "Min swings per level" and "Selectivity" control how strict the model is before calling a group a level, "Max distance from price" and "Max levels shown" keep the chart readable, and both zone width caps let you match the look to your timeframe.
This is a descriptive tool for reading price structure. It is not financial advice and does not predict price.
Indicator

TVA_MathLibraryLibrary "TVA_MathLibrary"
f_htfBundle(tf)
Parameters:
tf (simple string)
f_htfBias(c, e20, e50, e200, r, atrv, adxv)
Parameters:
c (float)
e20 (float)
e50 (float)
e200 (float)
r (float)
atrv (float)
adxv (float)
f_stdTrendScore(c, e20, e50, e200, r, adxv)
Parameters:
c (float)
e20 (float)
e50 (float)
e200 (float)
r (float)
adxv (float)
f_confirmationScore(setupDir, biasW, biasD, bias4H, bias1H)
Parameters:
setupDir (int)
biasW (float)
biasD (float)
bias4H (float)
bias1H (float)
f_confluenceScore(alignmentPct, momentumConverge, adxv, volatilityCtx, volumeConfirm)
Parameters:
alignmentPct (float)
momentumConverge (float)
adxv (float)
volatilityCtx (float)
volumeConfirm (float)
f_buyProbability(baseBullPct, c, e20, e50, e200, r, macdHist, macdHistPrev, vol, volEma20, distToSupportATR, adxv, adxRising)
Parameters:
baseBullPct (float)
c (float)
e20 (float)
e50 (float)
e200 (float)
r (float)
macdHist (float)
macdHistPrev (float)
vol (float)
volEma20 (float)
distToSupportATR (float)
adxv (float)
adxRising (bool)
f_sellProbability(baseBearPct, c, e20, e50, e200, r, macdHist, macdHistPrev, vol, volEma20, distToResistATR, adxv, adxFallingDown)
Parameters:
baseBearPct (float)
c (float)
e20 (float)
e50 (float)
e200 (float)
r (float)
macdHist (float)
macdHistPrev (float)
vol (float)
volEma20 (float)
distToResistATR (float)
adxv (float)
adxFallingDown (bool)
f_marketRegime(adxv, efficiencyRatio, atr20, atr50, bbWidth, bbWidthEma20)
Parameters:
adxv (float)
efficiencyRatio (float)
atr20 (float)
atr50 (float)
bbWidth (float)
bbWidthEma20 (float)
f_chopIndex(adxv, diPlus, diMinus, efficiencyRatio, bbWidth, bbWidthEma20)
Parameters:
adxv (float)
diPlus (float)
diMinus (float)
efficiencyRatio (float)
bbWidth (float)
bbWidthEma20 (float)
f_volatilityClass(atrPercentile, histVolPercentile, trExpansionRatio, bbWidthPercentile)
Parameters:
atrPercentile (float)
histVolPercentile (float)
trExpansionRatio (float)
bbWidthPercentile (float)
f_emaSmooth2(src)
Parameters:
src (float)
f_scoreColor(score, highIsGood)
Parameters:
score (float)
highIsGood (bool)
f_gaugeText(score, label)
Parameters:
score (float)
label (string)
f_alignmentBar(pct)
Parameters:
pct (float) Library

Matao Love Mood - Market SessionSMC Session Indicator — Overview
This is a Smart Money Concepts (SMC) session-tracking indicator for PulseWire, built to highlight trading sessions, key time windows, and price-action patterns on the chart.
🕐 Session Boxes
It draws colored boxes that track the high/low price range of five time windows (all based on the timezone you set, default Asia/Bangkok):
Session Time Color
Market 07:00–23:00 Silver
Asia 07:00–13:00 Green
London 14:00–17:00 Yellow
New York 19:00–22:00 Blue
Focus (4 sub-windows) 07:45–08:30 / 09:45–10:30 / 11:45–12:30 / 19:45–20:30 Red
Each box grows in real time to hug the developing high/low of that session, and a small time-stamped label sits above it. Updates only apply on confirmed (closed) bars, so the boxes stay stable instead of jittering as live price ticks.
🔔 Alerts
You can enable/disable alerts for the start and end of each session (Market, Asia, London, NY, Focus) — useful for getting notified when a key session opens or closes.
📊 Fair Value Gap (FVG)
Detects 3-candle imbalance patterns (bullish/bearish gaps) and marks them as small colored boxes positioned exactly on the middle candle of the pattern. You can choose to display:
All FVGs (shows how far price traveled before filling the gap)
Only unmitigated (still-open gaps)
Only mitigated (already filled gaps)
📦 Inside Bar
Colors candles that are fully contained within the previous candle's high/low range (a common SMC consolidation/compression signal).
📋 Dashboard Table
A small table (position and text size configurable) shows the live status of each session — OPEN/CLOSE for Market, colored dots for Asia/London/NY, and a countdown (e.g. 🎯 12m) for the active Focus window.
🎨 Customization
Nearly everything is adjustable in the settings: which sessions/boxes/labels/alerts to show, box colors and transparency, label text size/color, FVG colors and display mode, table position/size, and the timezone. Indicator

Round Number Gravity Map - Level Attraction StatisticsRound numbers are supposed to attract price. This script measures whether they actually do on the chart in front of you, rather than assuming it.
WHAT IT DOES
It lays a grid of evenly spaced round levels over the chart, and for every bar measures how far the close sat from its nearest level — expressed as a fraction of the grid spacing. That normalised distance runs from 0.0 (right on a level) to 0.5 (exactly halfway between two).
If price ignored round numbers entirely, that distance would be spread evenly across its range. A band of ±10% of the step covers 20% of the possible range, so 20% of closes would land inside it by chance alone. That 20% is the baseline, and it is what every reading here is measured against:
Gravity = observed pinned rate ÷ expected pinned rate
Above 1.00, closes cluster on the levels more than chance allows — attraction. Below 1.00, price is straddling the grid rather than respecting it, which is just as worth knowing: it means the levels you are drawing are not the ones this market is trading around.
WHAT IT ACTUALLY SHOWS
At the time of writing, on 1-hour charts: ETHUSD reads 1.24 on its 20-dollar grid, and still 1.16 on the finer 10-dollar grid across twice the sample. BTCUSD reads 1.01 on its 500-dollar grid — no effect at all. XRPUSD reads 0.97.
So the folklore is not universal. That is the entire reason to measure it rather than assume it, and it is why the script reports a plain NEUTRAL when there is nothing there instead of dressing the chart up.
HOW TO READ THE TABLE
Step — the grid spacing. On Auto it snaps to the nearest 1 / 2 / 2.5 / 5 × 10^n value near your target percentage of price, so on ETH near 1,900 a 1% target resolves to 20, and on BTC near 100k it resolves to 1000. The comparison is done in log space so it is not biased toward the larger candidate.
Pinned ±10% — the share of closes inside the shaded bands, next to the share you would expect from chance.
Gravity — the ratio of those two numbers. This is the headline.
Mean distance — the average normalised distance as a percentage of the step. A market that ignores round numbers averages 25.0%. Lower means pulled in, higher means pushed away.
On level → halfway — a five-bucket histogram of that distance, left bucket = sitting on a level, right bucket = halfway between two. Real attraction shows up as a left-heavy shape. A flat row of blocks means the grid is doing nothing.
Reading — the plain-language verdict, so the number does not need interpreting mid-session.
Sample — how many bars the statistic is built from, and how many grid levels those bars actually walked across. That second number is the guard, and it matters more than it looks: a high Gravity measured over a range that only spans two or three levels is noise, not attraction, because the baseline has barely been sampled. Ten levels or more is a reading worth taking seriously. If you widen the step until Gravity looks impressive, watch that number collapse — the script is showing you the catch rather than hiding it.
ON THE CHART
Each level is drawn with its shaded band. The level nearest to price is highlighted, since it is the one currently in play. Every level is labelled with its price and the number of bars in the lookback that traded through it — a level tested fifty times is a different object from one tested twice, even though they look identical.
SETTINGS WORTH TOUCHING
Auto target (% of price) — raise it for a coarser grid of bigger levels, lower it for a finer one. This is the setting that changes the answer most, and that is the point: it tells you which scale of round number this market respects. Try 0.5%, then 1%, then 2.5%, and read the Gravity and the levels-spanned figure together rather than either one alone.
Band half-width — widen it and more closes qualify, but the expectation widens with it, so Gravity stays honest.
Lookback — 500 bars is a reasonable sample. Below ~150 the reading gets noisy.
NOTES
The statistic is a description of the sample in front of you, not a forecast. A Gravity of 1.24 says closes clustered near round levels over those bars; it does not say the next one will. Closes are also autocorrelated, so the effective sample is smaller than the bar count suggests — treat a single elevated reading as a hint to look closer, not as a result.
The grid is a market-structure prior, not a signal. Treat a high reading as a reason to expect hesitation near a level, not as an entry.
No repainting. Every value is computed from the chart's own bars. There is no request.security call anywhere in the script, so the higher-timeframe lookahead problem that quietly breaks so many indicators does not exist here — there is nothing to get wrong. Historical bars are computed from their own closes, which is exactly what the realtime bar converges to when it closes.
Open source under MPL 2.0. Read it, fork it, tell me where I am wrong. Indicator
