Equalhigh - Lepage Dual-Regime DetectorEqualhigh — Lepage Dual-Regime Detector
User Manual
Overview
The Equalhigh Lepage Dual-Regime Detector is a non-parametric change-point indicator for PulseWire. It is designed to identify recent changes in either:
Location: the central level of the return distribution.
Scale: the dispersion of the return distribution.
Both simultaneously: a mixed structural break.
Unlike a conventional momentum oscillator, the indicator does not ask whether price is overbought or oversold. It asks whether recent return behavior is statistically different from earlier return behavior inside the active window.
This is a diagnostic regime detector, not an automatic buy-and-sell system.
Why use a location-scale test?
A market transition does not always begin with an obvious directional move. Sometimes the median return changes while volatility remains stable. In other cases, volatility expands or contracts before a clear directional shift becomes visible.
The Lepage framework combines two rank-based components:
The Wilcoxon rank-sum component measures a change in location.
The Ansari–Bradley component measures a change in scale.
The combined statistic can therefore detect more types of structural change than a location-only test.
Observation series
The test is applied to multi-bar logarithmic returns:
Observation = 100 × ln(Source / Source )
Using returns instead of raw prices reduces the tendency to classify the normal upward drift of an asset as a permanent structural break.
Logarithmic returns require positive source values. The indicator remains unavailable when the active window contains invalid or non-positive source observations.
Core calculation
For every active window, the script:
Stores the return observations chronologically.
Assigns average Wilcoxon ranks to equal observations.
Assigns average Ansari–Bradley center-weighted scores to equal observations.
Tests every split that leaves at least the selected Minimum segment size on both sides.
Standardizes the location and scale score sums at each split.
Calculates the Lepage statistic:
L = Z_location² + Z_scale²
Selects the split with the highest Lepage statistic.
Calculates the fixed-split asymptotic p-value:
p_fixed ≈ exp(−L / 2)
Applies a conservative Bonferroni correction for all admissible splits:
p_scan = min(1, Number of tested splits × p_fixed)
Uses medians and median absolute deviations to classify the type and practical size of the detected change.
The scan correction is important because selecting the strongest result from many candidate splits would otherwise make the displayed p-value too optimistic.
Understanding the components
Location Z
The location component is displayed with an intuitive directional sign:
Location Z > 0: the later segment shifted upward.
Location Z < 0: the later segment shifted downward.
A larger absolute value represents stronger rank-based location evidence.
Scale Z
The scale component describes the change in return dispersion:
Scale Z > 0: the later segment became more dispersed.
Scale Z < 0: the later segment became less dispersed.
A larger absolute value represents stronger rank-based scale evidence.
The combined statistic squares both components, so the p-value measures the strength of the overall break. The signs are used to interpret its direction.
Color system
Color or marker
Interpretation
Green — LEVEL +
Confirmed positive location shift without a qualifying scale shift
Red — LEVEL −
Confirmed negative location shift without a qualifying scale shift
Purple — VOL +
Confirmed scale expansion without a qualifying location shift
Blue — VOL −
Confirmed scale compression without a qualifying location shift
Orange — MIXED
Confirmed location and scale shift occurring together
Yellow — ?
Possible break with incomplete statistical confirmation
Gray
No currently actionable break
A volatility expansion is not automatically bearish, and a volatility compression is not automatically bullish. These states describe dispersion, not market direction.
The orange mixed state does not encode direction by itself. Use Median Shift and MAD Scale Shift in the dashboard to determine whether the mixed change combines an upward or downward level shift with expansion or compression.
Confidence line
The main line is calculated as:
Scan-adjusted confidence = 100 × (1 − p_scan)
The default boundaries are:
95: confirmed statistical zone when the confirmed p-value is 0.05.
85: possible statistical zone when the possible-break p-value is 0.15.
The line color reflects the currently classified regime.
Important: this confidence value is not the probability that price will rise, the probability that a trade will be profitable, a win rate, or a forecast-accuracy score.
Confirmation logic
A confirmed regime requires all of the following:
The scan-adjusted p-value is less than or equal to Confirmed scan p-value.
The estimated break is no older than Maximum actionable break age.
At least one component passes its practical-effect threshold.
The contributing component also passes Minimum component Z.
Positive or negative location shift
The robust location effect reaches Minimum location shift.
The absolute Location Z reaches Minimum component Z.
The scale component does not independently pass all its confirmation filters.
The sign of the median shift determines positive or negative classification.
Scale expansion or compression
The symmetric MAD scale-ratio change reaches Minimum scale-ratio change.
The absolute Scale Z reaches Minimum component Z.
The location component does not independently pass all its confirmation filters.
The MAD ratio determines expansion or compression.
Mixed break
Both the location and scale components pass their effect-size and component-Z filters.
Possible break
The scan-adjusted p-value is above the confirmed threshold but no higher than the possible-break threshold. At least one component must also reach half of its normal effect-size and component-Z requirements.
Dashboard
Dashboard field
Meaning
Lepage State
Current regime classification
Scan-Adj P
Bonferroni-adjusted approximate p-value for the split scan
Break Age
Estimated number of bars since the selected split
Location Z
Directional standardized Wilcoxon component
Scale Z
Directional standardized Ansari–Bradley component
Median Shift
Post-break median return minus pre-break median return, in percentage points
Location Effect
Median shift divided by a robust sigma estimate
MAD Scale Shift
Conventional percentage change from pre-break MAD to post-break MAD
Additional dashboard states include:
FILTERED BREAK: the combined statistic is significant and recent, but neither component passes all practical-effect and Z filters.
OLD BREAK: the combined statistic remains significant inside the window, but the estimated split is older than Maximum actionable break age.
STABLE REGIME: no currently actionable or possible break.
Input guide
1. Observations
Price sourceSeries used to calculate logarithmic returns. Close is the standard setting.
Log-return horizonNumber of bars covered by each return observation. Lower values react to short moves. Higher values emphasize slower market behavior but create more overlap between consecutive observations.
Lepage windowNumber of return observations in each rolling test. Short windows react faster but are noisier. Long windows are more stable but respond later.
Minimum segment sizeMinimum number of observations required before and after every candidate split. Increasing it reduces unstable edge detections but prevents the test from selecting extremely recent breaks.
2. Validation
Confirmed scan p-valueMaximum adjusted p-value for confirmation. The default is 0.05. Lower values produce fewer and more selective events.
Possible-break scan p-valueMaximum adjusted p-value for the yellow early-warning state. The default is 0.15.
Maximum actionable break ageMaximum number of bars allowed between the estimated split and the current bar.
Minimum location shiftMinimum median shift measured in robust sigma units. The robust sigma is 1.4826 × window MAD, with standard deviation used as a fallback when necessary.
Minimum scale-ratio change (%)Minimum symmetric difference between pre-break and post-break MAD. Symmetric measurement treats a doubling and a halving of scale as equally large changes for filtering purposes.
Minimum component ZPrevents a regime label from being attributed to a component that contributed too little to the combined Lepage statistic. The default is 1.00.
Confirm signals at bar closeWhen enabled, new markers and alert events are confirmed only when the current bar closes. This is the recommended setting.
3. Display
These settings independently control regime backgrounds, confirmed labels, possible-break markers, and the dashboard.
Suggested starting profiles
Use case
Return horizon
Window
Minimum segment
Maximum age
Location effect
Scale change
Component Z
General swing trading
5
60
10
10
0.25
25%
1.00
Faster monitoring
3
50
8
7
0.30
30%
1.25
Slower regime analysis
10
90
15
15
0.35
30%
1.00
These profiles are starting points, not optimized trading parameters. Test settings across different assets and unseen market periods.
Interpretation examples
Green location event
Suppose the dashboard shows:
Scan-adjusted p-value: 0.03
Break age: 6
Median shift: +0.80 pp
Location effect: +0.55 sigma
MAD scale shift: +10%
The evidence supports a recent upward change in the central return level, while the scale change remains below its filter.
Purple volatility-expansion event
Suppose the location effect is small, but post-break MAD is 60% higher, Scale Z is strongly positive, and the adjusted p-value is below 0.05. The indicator classifies a volatility expansion. Market direction must be determined separately.
Orange mixed event
If both median returns and dispersion change materially, the indicator displays MIXED. A positive Median Shift with a positive MAD Scale Shift represents improving returns accompanied by expanding volatility. A negative Median Shift with expanding volatility can represent a more hostile risk regime.
Practical workflow
Use ordinary candlesticks on a liquid instrument.
Keep Confirm signals at bar close enabled.
Treat yellow as an observation state rather than an entry instruction.
When a confirmed event appears, inspect Location Z, Scale Z, Median Shift, and MAD Scale Shift.
Confirm the interpretation with price structure, volume, liquidity, and higher-timeframe context.
Define entry, invalidation, position sizing, and exit rules independently.
The indicator is particularly useful as a regime filter. For example, a trend strategy may be treated differently during purple volatility expansion than during blue volatility compression.
Alerts
Six alert conditions are available:
Lepage — Possible break
Lepage — Positive level shift
Lepage — Negative level shift
Lepage — Volatility expansion
Lepage — Volatility compression
Lepage — Mixed regime break
A confirmed alert fires when a qualifying state first appears, when the confirmed regime type changes, or when the estimated split resets to a more recent point. A possible alert follows equivalent first-appearance and break-reset logic.
When bar-close confirmation is enabled, configure PulseWire alerts as Once Per Bar Close.
Repainting and event timing
The script does not use future data, lookahead, or a negative plot offset. It places a marker on the bar where the break is detected and never moves that marker backward to the estimated historical split.
However, the estimator is rolling. As a new bar enters the window and an old bar leaves it, the selected split, component scores, p-value, break age, and current state can change. Values can also fluctuate on an open real-time bar. Bar-close confirmation prevents provisional intrabar markers from being treated as confirmed events.
Historical events are calculated only from information available on their respective bars.
Statistical limitations
The fixed-split chi-square p-value is asymptotic rather than exact.
Bonferroni correction is conservative because the candidate splits are dependent.
The correction covers the splits inside one window, not repeated testing across every bar in the chart.
Consecutive multi-bar returns overlap and are not independent. The adjusted p-value should therefore be interpreted as comparative evidence rather than a perfectly calibrated probability.
The classical Lepage components are most naturally interpreted as location and scale tests under regular distributional conditions. Strong skew changes or complex distribution changes can affect both components.
The detector selects one dominant split per rolling window. Multiple rapid changes can interfere with one another.
A statistically significant regime change does not guarantee persistence, directional continuation, or trading profitability.
Median absolute deviation can be close to zero on discrete or insufficiently variable data. The script uses a small numerical floor, but scale percentages can still become unusually large.
Results on Heikin Ashi, Renko, Range, Kagi, Point & Figure, or other synthetic charts describe transformed data rather than ordinary traded prices.
Always evaluate the indicator on unseen data and combine it with independent risk controls.
Data Window outputs
The script exposes:
State code.
Scan-adjusted p-value.
Estimated break age.
Location Z component.
Scale Z component.
Median shift in percentage points.
Robust location effect.
MAD scale change percentage.
Lepage statistic.
State codes are:
Code
State
4
Mixed location-scale break
3
Scale expansion
2
Positive location shift
1
Possible break
0
Stable, filtered, or old break
−2
Negative location shift
−3
Scale compression
PulseWire publication metadata
Primary category: Oscillators
Secondary category: Trend Analysis
Suggested tags: Lepage Test, Change Point, Regime Detection, Statistics, Non-Parametric, Volatility, Structural Break
References
Y. Lepage, “A Combination of Wilcoxon's and Ansari-Bradley's Statistics,” Biometrika, 1971.
F. Rublík, “The Multisample Version of the Lepage Test,” Kybernetika, Vol. 41, No. 6, 2005, pp. 713–733: paper.
G. J. Ross, D. K. Tasoulis and N. M. Adams, “Nonparametric Monitoring of Data Streams for Changes in Location and Scale,” Technometrics, Vol. 53, No. 4, 2011, pp. 379–389: DOI.
H. Murakami, “A Nonparametric Location–Scale Statistic for Detecting a Change Point,” The International Journal of Advanced Manufacturing Technology, Vol. 61, 2012, pp. 449–455: DOI.
Disclaimer
This indicator is provided for research and educational purposes. It does not constitute investment advice, a recommendation, or a guarantee of future performance. Trading involves risk, including the possible loss of capital. Indicator

Market Leadership Structure 3D [NeuralMarkets]OVERVIEW
Market Leadership Structure 3D compares six assets to show who is driving the group, who is following, and whether leadership is persistent or rotating.
It separates relative rank from absolute evidence. The top-ranked asset is always shown as the relative candidate, but the script reports NO CLEAR LEADER unless that candidate has sufficient evidence, separation from the runner-up, and at least one qualified outgoing relationship.
The indicator provides three views:
• Summary
• Leadership Terrain
• Parameter Stability
HOW IT WORKS
For every asset pair, the model compares both possible lead-lag directions.
Directional evidence blends the strongest positive lagged correlation with the average positive correlation across the tested lags.
Directional advantage A → B = Evidence A → B − Evidence B → A
An edge is retained only when it passes Minimum Forward Evidence and exceeds the reverse direction by Minimum Directional Asymmetry.
Qualified edges form a directed network using NeuralMarketsNetworkToolkit:
Net influence = Outbound influence − Inbound influence
The asset with the highest smoothed net influence receives rank #1. Recognition requires separate absolute-evidence and rank-separation thresholds, so being ranked first does not automatically imply meaningful leadership.
READING THE SUMMARY
Recognized — The accepted leader or NO CLEAR LEADER.
Relative candidate — The asset currently ranked #1, even when evidence is insufficient for recognition.
Absolute evidence — Strength and coverage of the candidate’s qualified outgoing relationships. It is not min-maxed and does not force the strongest asset to score 100.
Rank separation — Normalized gap between the top two assets. A small gap means leadership is closely contested.
Leader persistence — Share of the history window occupied by the current recognized leader. No-clear-leader bars remain separate states.
Clear-state share — Percentage of the history window in which any clear leader existed.
Rotation risk — LOW, MEDIUM, HIGH, or UNDEFINED when no leader is recognized.
Concentration — Whether directional influence is concentrated or broadly distributed.
The optional ranking table shows all six assets with net influence, absolute evidence, and normalized leadership.
LEADERSHIP TERRAIN
The waterfall mesh displays all six assets through recent history:
• X-axis: ticker
• Depth: historical slices from NOW toward older bars
• Height: normalized leadership, approximately −1 to +1
Above zero indicates more outbound than inbound influence. Below zero indicates follower behavior. Each historical ridge is drawn as a colored curtain from the zero plane, while rails connect each ticker through time. Older slices fade to keep the current structure prominent.
Look for:
• A sustained elevated ridge — persistent leadership
• A ridge rising toward NOW — strengthening leadership
• A ridge falling toward zero — fading leadership
• Two similar current peaks — close competition
• Rapidly alternating peaks — unstable rotation
• A flat surface near zero — weak directional structure
A leader marker appears only when the recognition requirements are satisfied.
PARAMETER STABILITY
This view rebuilds the network across a 6 × 6 grid:
• X-axis: relationship lookback
• Depth: maximum lag from 1 to 6 bars
• Height and color: robustness
Robustness combines 50% absolute evidence, 30% rank separation, and 20% agreement with the currently recognized leader. Cells without qualified outgoing coverage score zero.
Broad elevated regions indicate that leadership survives several parameter choices. An isolated peak suggests that the result is parameter-sensitive.
HOW TO USE IT
1. Choose a coherent universe
Use a preset or select six related assets. Interpretation is clearest when the group represents one theme, such as cross-asset ETFs, US sectors, or mega-cap stocks.
2. Check the recognized state
If the script reports NO CLEAR LEADER, do not treat the relative candidate as confirmed leadership.
3. Confirm evidence and separation
Prefer cases where the candidate has both meaningful absolute evidence and adequate distance from the runner-up.
4. Check persistence and rotation
Established leadership is generally more credible than a one-bar rank change. Falling persistence, a young leader age, or HIGH rotation risk signals a less settled structure.
5. Inspect Leadership Terrain
Check whether the leader remains above zero through history and whether its ridge strengthens toward NOW. Watch for challengers rising beneath it.
6. Inspect Parameter Stability
Prefer a broad plateau over one sharp peak. If leadership disappears after a small lookback or lag change, it is fragile.
7. Use alerts to trigger review
Alerts identify structural transitions. Combine them with price action, trend, liquidity, and risk management rather than treating them as automatic entries.
UNIVERSE PRESETS
Cross-Asset — SPY, QQQ, IWM, HYG, TLT, DBC
US Sectors — XLK, XLF, XLY, XLI, XLE, XLV
Mega-Cap — NVDA, MSFT, AAPL, META, AMZN, GOOGL
Custom — Six user-selected symbols
IMPORTANT SETTINGS
Relationship Lookback — Estimation window. Shorter values react faster but are noisier.
Maximum Lead Lag — Earlier bars tested. One lag equals one chart bar.
Rank Smoothing — Reduces rank churn at the cost of slower response.
Leadership History — Window used for persistence and rotation statistics.
Minimum Forward Evidence — Minimum blended relationship required for an edge.
Minimum Directional Asymmetry — Required advantage over the reverse direction.
Minimum Absolute Evidence / Rank Separation — Requirements for recognizing a clear leader.
Terrain spacing, skew, separation, and height settings change only the drawing—not the model.
KEY DEFAULTS
Relationship Lookback: 80
Maximum Lead Lag: 5
Directional Weight Power: 1.25
Rank Smoothing: 3
Leadership History: 100
Minimum Forward Evidence: 0.18
Minimum Directional Asymmetry: 0.02
Minimum Absolute Evidence: 15
Minimum Rank Separation: 5%
Terrain History: 8 slices spaced 5 bars apart
ALERTS
Clear Leader Rotation — Fires only on a direct transition between two different recognized leaders. A transition through NO CLEAR LEADER is not counted.
High Rotation Risk — Fires when risk changes to HIGH while a clear leader exists.
Clear Leader Established — Fires when the candidate first satisfies the recognition requirements.
Clear Leader Lost — Fires when the recognized leader no longer satisfies them.
LIMITATIONS
This indicator is descriptive market-structure research, not a calibrated probability or a claim of predictive alpha.
Lagged correlation and directional asymmetry do not establish causality. The model focuses on positive lead-lag relationships and does not explicitly represent inverse edges.
Parameter Stability measures current in-sample robustness, not out-of-sample forecasting performance. The terrain is a 2D perspective projection whose appearance depends on chart zoom.
Results depend on timeframe, available history, liquidity, and alignment between trading sessions. All six symbols should have sufficient data.
Use rank to identify the relative candidate. Use evidence, separation, persistence, terrain, and parameter stability to decide how seriously that ranking should be taken.
Indicator

Equalhigh - Pettitt Structural Break DetectorEqualhigh — Pettitt Structural Break Detector
User Manual
Overview
The Equalhigh Pettitt Structural Break Detector is a statistical regime-change indicator for PulseWire. It is designed to identify a recent change in the distribution of price returns rather than a conventional overbought, oversold, or moving-average condition.
The indicator applies a rolling version of Pettitt's non-parametric change-point test to logarithmic price returns. It estimates the most likely break location inside the active window, evaluates its statistical significance, measures the direction and size of the median shift, and filters out changes that are too old or too small to be considered actionable.
This is a diagnostic indicator, not an automatic trading system. Its purpose is to answer:
Has the recent return regime changed materially, in which direction, and with what level of statistical evidence?
Core calculation
The observation tested on each bar is the multi-bar logarithmic return:
100 × ln(Source / Source )
Inside the selected Pettitt window, the indicator:
Orders the observations chronologically.
Assigns non-parametric ranks, using average ranks for equal values.
Tests every admissible split while preserving the minimum segment size on both sides.
Selects the split with the largest absolute Pettitt statistic.
Calculates the approximate two-sided p-value:
p ≈ min(1, 2 × exp(-6K² / (n³ + n²)))
Compares the median return before and after the estimated break.
Standardizes the median shift by the rolling standard deviation.
Rejects breaks that are too old or have an insufficient effect size.
The test is non-parametric: it relies on ranks and does not require returns to follow a normal distribution.
Reading the indicator
The main line is a signed statistical-confidence display ranging from approximately -100 to +100.
Display
Meaning
Green
Recent, statistically confirmed upward shift in the return distribution
Red
Recent, statistically confirmed downward shift in the return distribution
Orange
Possible break; evidence is developing but does not yet meet the confirmed threshold
Gray
No currently actionable structural break
BULL label
A new confirmed upward structural-break event
BEAR label
A new confirmed downward structural-break event
Orange ?
A new possible upward or downward break
A positive reading means that the post-break median return is higher than the pre-break median. A negative reading means it is lower.
Important: a bullish break does not necessarily mean that returns are already positive. A change from strongly negative returns to mildly negative returns is an upward structural shift and can therefore be classified as bullish. Price structure should still be checked separately.
The displayed confidence is calculated as 100 × (1 − p-value). It is not the probability that a trade will be profitable, the probability that price will rise, or a forecast accuracy score.
Confirmation rules
A confirmed break requires all of the following:
The approximate p-value is less than or equal to the Confirmed p-value setting.
The estimated break age does not exceed the Maximum actionable break age.
The absolute median-shift effect reaches the Minimum median-shift effect.
The post-break median is different from the pre-break median.
A possible break requires:
A p-value above the confirmed threshold but no higher than the Possible-break p-value.
A recent estimated break.
At least half of the selected minimum effect size.
Dashboard
The statistical dashboard provides five fields:
Field
Interpretation
Pettitt State
Current classification: stable, possible break, confirmed break, or old break
P Value Approx
Approximate probability of observing a Pettitt statistic at least this extreme under the no-change hypothesis
Break Age
Estimated number of bars since the detected split
Median Shift
Post-break median return minus pre-break median return, in percentage points
Effect Size
Median shift divided by the rolling standard deviation of the tested returns
An OLD BREAK state means that statistically significant evidence remains inside the window, but the estimated change point is older than the selected actionable-age limit.
Inputs
1. Observations
Price sourceSelects the series used in the logarithmic-return calculation. Close is the standard choice.
Log-return horizonDefines the number of bars used for each return observation. A higher value focuses on slower moves but creates more overlap between consecutive observations.
Pettitt windowDefines the number of observations included in each rolling test. Short windows react faster but are noisier. Long windows are more stable but detect changes later.
Minimum segment sizePrevents the estimated split from being placed too close to either edge of the window. Larger values reduce unstable edge detections but also delay recognition of very recent changes.
2. Validation
Confirmed p-valueMaximum approximate p-value for a confirmed break. 0.05 is the default. Lower values are more selective.
Possible-break p-valueMaximum p-value for the orange early-warning state. 0.15 is the default.
Maximum actionable break ageMaximum number of bars allowed between the estimated break and the current bar. This prevents an old statistical event from being treated as a fresh signal.
Minimum median-shift effectMinimum absolute standardized median shift required for confirmation. 0.25 means that the shift must represent at least one quarter of the rolling return standard deviation.
Confirm signals at bar closeWhen enabled, new labels and alert events are confirmed only after the current bar closes. This is the recommended setting.
3. Display
These controls independently enable the regime background, confirmed labels, possible-break markers, and statistical dashboard.
Suggested starting profiles
Use case
Return horizon
Window
Minimum segment
Maximum age
Minimum effect
General swing trading
5
60
10
10
0.25
Faster market monitoring
3
50
8
7
0.30
Slower regime analysis
10
90
15
15
0.35
These are starting points, not optimized trading parameters. Settings should be tested across different symbols and market regimes without selecting them solely from the best historical result.
Practical workflow
Use a liquid instrument and ordinary candlestick data.
Keep bar-close confirmation enabled.
Treat orange as an observation state, not an entry instruction.
When a confirmed label appears, check whether price structure, volume, volatility, and the higher-timeframe context support the same interpretation.
Use the p-value, effect size, and break age together. A small p-value alone does not guarantee a useful trade.
Define entry, invalidation, position size, and exit rules independently.
For example, a green event with p = 0.02, a break age of 6 bars, and an effect size of +0.60 sigma represents a recent and statistically meaningful upward shift. It becomes more useful if price has also reclaimed an important level or broken a declining structure.
Alerts
Four alert conditions are available:
Pettitt — Possible bullish break
Pettitt — Possible bearish break
Pettitt — Bullish structural break
Pettitt — Bearish structural break
Alerts fire when a qualifying state first appears or when the estimated break resets to a more recent point while the same directional condition remains active. With bar-close confirmation enabled, alerts should be configured Once Per Bar Close.
Repainting and timing
The script does not use future data, lookahead, or a negative plot offset. A signal is displayed on the bar where the break is detected; it is not placed retrospectively on the estimated historical change point.
However, this is a rolling estimator. As new bars enter the window, the most likely split, p-value, break age, and state can change. On a live unclosed bar, values can also move with price. Enabling Confirm signals at bar close prevents provisional intrabar labels from being treated as confirmed events.
Limitations
Pettitt's test identifies the dominant single change point inside the active window. Multiple rapid regime changes can interfere with one another.
The p-value is an approximation, not an exact posterior probability.
Consecutive multi-bar returns overlap and are therefore not independent. This makes the p-value best treated as comparative statistical evidence rather than a perfectly calibrated probability.
A statistically significant distribution shift does not guarantee trend continuation or trading profitability.
Outliers are less influential than in many mean-based tests, but they can still affect the detected split and the rolling volatility denominator.
Very short windows are noisy; very long windows can react too slowly.
Logarithmic returns require positive source values. The test remains unavailable when the selected source contains invalid or non-positive observations inside the active window.
Results on Heikin Ashi, Renko, Range, Kagi, or other synthetic chart types describe the transformed data rather than standard traded prices.
Always evaluate the indicator on unseen data and combine it with independent risk controls.
Data Window outputs
The script exposes the following values for inspection and alert integration:
State code: +2 confirmed bullish, +1 possible bullish, 0 stable, −1 possible bearish, −2 confirmed bearish.
Approximate p-value.
Estimated break age.
Median shift in percentage points.
Median-shift effect size.
Pettitt K statistic.
Reference
A. N. Pettitt, “A Non-Parametric Approach to the Change-Point Problem,” Journal of the Royal Statistical Society: Series C (Applied Statistics), Vol. 28, No. 2, 1979, pp. 126–135. DOI: 10.2307/2346729.
Disclaimer
This indicator is provided for research and educational purposes. It does not constitute investment advice, a recommendation, or a guarantee of future performance. Trading involves risk, including the possible loss of capital. Indicator

Indicator

Indicator

Indicator

Yield StrengthOANDA:NZDCHF Yield Strength — Bond Yield Spread Indicator Between Currencies
This indicator measures the relative strength of major currencies based on the yield differential (interest rates) of each country's government bonds, rather than price.
How it works:
Fetches the government bond yield (2Y, 5Y, or 10Y, selectable) for 8 economies: US, Eurozone, UK, Japan, Australia, New Zealand, Canada, and Switzerland.
Calculates the yield spread between the current chart pair (e.g., EURUSD = EUR yield − USD yield) and plots it alongside two EMAs (fast and slow) of that spread, signaling trend crossovers with a color change (green = bullish, red = bearish).
In parallel, calculates the yield spread for all 28 possible pairs among these 8 currencies and applies the same EMA-crossover logic to each.
Consolidates everything into a scoreboard in the corner of the screen: each currency gains or loses points depending on whether it's on the "strong" or "weak" side of the yield in each of the 28 pairs — producing a relative strength ranking of currencies based purely on implied monetary policy/interest rates, not price.
Why it's useful:
Yield differential is one of the main drivers of flow in forex (carry trade, rate expectations). This indicator translates that macro concept into a visual signal and an objective ranking, useful as a context/trend filter for swing trading, without relying on traditional price-based indicators.
How to use it:
Recommended timeframe: works best on higher timeframes — H1, H4, or D1. Since it's based on yield differentials (a slow-moving macro driver), it's not suited for scalping or very low timeframes, where price noise dominates and the interest-rate signal loses relevance.
Best used with the trend. Use it as a context filter, not a standalone entry trigger. When the spread and EMAs are aligned with the pair's price trend direction, it reinforces that the macro flow is "pushing" the pair in the same direction — giving more confidence to trade with that trend.
Scoreboard: use the strength ranking of the 8 currencies to spot "stretched" pairs (strong currency vs. weak currency) — usually the best candidates for trend-following entries backed by this macro driver.
Color crossovers (green/red) on the spread's EMAs signal a regime change — useful for confirming the yield trend is still active before entering, rather than already exhausted.
Technical: Pine Script v6. All 28 spreads are calculated locally from just 8 request.security calls (one per currency), working around PulseWire's 40-security limit even while analyzing 28 pairs. Indicator

Indicator

Indicator

COT Commercial Hedger ExtremeIn commodities, the crowd and the smart money sit on opposite sides of the same report every week. The Commitment of Traders breaks open interest into commercials -- the producers, merchants and processors who hedge physical -- and large speculators, who are mostly trend-following money. The commercials are the ones who actually touch the barrel, the bushel, the bar. When they move to an extreme, it pays to listen.
The pattern that marks real commodity bottoms is simple to say and hard to wait for: commercial hedgers covering shorts en masse, from a multi-year net-short extreme, and curling back toward flat or net long. That is the producers deciding price has fallen far enough that they no longer need to hedge aggressively. It happened at the 2008 low, it happened into the 2018-19 lows, and I used this exact tell to call the September 2022 gold bottom near $1,640 in real time on PulseWire. Gold peaked above $5,500 in January 2026, a move of more than 200% from that low.
This indicator puts that read on your chart.
The colored net line is the commercial position: red when they're at an extreme and still pressing shorts (no bottom), yellow when they start covering up off that extreme, green when they curl to flat or net long (the bottom tell). A triangle marks the first week they begin covering, a diamond marks the cross to net long. The blue line is large speculators for context -- they are usually heaviest long right as commercials are heaviest short, which is the whole point. Optional small-trader line too.
The dashboard shows commercial net, where it sits in its multi-year percentile, the spec and small-trader nets, and whether covering is underway. Alerts fire when hedgers start covering and when they flip toward net long.
Works on any futures with a CFTC code -- gold, silver, copper, oil, grains, even the index futures. Set the code in the settings to match the contract you're charting. Default is gold.
One read in isolation is a tell, not a trigger. I pair it with trend and price structure -- it tells you the tank is full of fuel, not that the match is lit. But when commercials cover their shorts, I want to know. Indicator

Indicator

The Island 4H MTFThe Indicator looks for a failed breakout on the 4H — what most people call a liquidity sweep or a stop run.The mechanic is deliberately simple. On each closed 4H candle it asks two questions:
Buy: Did this candle's low go below the previous candle's low, and did it then close back above that low? If yes, price probed below a level where stops were resting, failed to hold there, and buyers reclaimed the level before the candle closed. Green triangle below the bar.
Sell: Did this candle's high go above the previous candle's high, and did it close back below it? Sellers rejected the probe. Red triangle above the bar.
Everything is computed on the 4H series itself, so the signals are identical whether you're looking at a 5m, 15m, 1h or 4h chart. The lower timeframe just gives you a finer view of the same 4H events.
What actually matters when you take these entries
1. The signal tells you where, not whether. A sweep at a level nobody cares about is noise. A sweep of a prior day's low, a weekly open, a swing point that's been tested twice, a round number — that's a sweep with a reason. Before taking any triangle, ask what liquidity was actually taken. If you can't name the level, skip it. This is the single biggest filter and the indicator can't do it for you.
2. Direction bias. Buy sweeps taken against a strong 4H/daily downtrend get run over. The pattern works best when the sweep is against the immediate move but with the higher-timeframe direction — a fake breakdown inside an uptrend. Overlay a daily 50/200 EMA and be honest about which side you're on. I offered a built-in bias filter earlier; this is why it's worth adding.
3. Location within the range. Sweeps at the extremes of a multi-day range are meaningfully different from sweeps in the middle of one. Mid-range sweeps in chop will fire constantly and most will fail. If price has been going sideways for a week, expect a lot of triangles and a lot of losses.
4. The signal bar offset. With confirmed close on, the triangle prints at the open of the following 4H candle, not on the sweep candle. That's what makes it non-repainting — but it means the entry price you get is the next 4H open, which can gap away from the signal candle's close, especially on equities and at session boundaries. Decide in advance: are you entering at that open, or waiting for a pullback into the swept level?
5. Where your stop goes defines the trade. Natural invalidation is below the sweep wick's low (for a buy). If that wick is enormous, your stop is far and the position has to be small — the setup may be structurally valid but not worth taking on risk-to-reward alone. Check the wick size before you decide you like the signal.
6. Sweep depth and the reclaim quality. A deep wick with a strong close near the high is a violent rejection. A shallow poke with a close barely back inside is often just noise that happens to satisfy the rule. The close-location filter is the crude version of this judgement; your eyes are better.
7. Session boundaries. 4H candles align to the instrument's session. On equities and futures the 4H boundaries follow exchange hours, and the first bar after a session break behaves differently — overnight gaps can create "sweeps" that are just the gap, not participation.
8. News. A sweep driven by a scheduled release is a different animal from an organic one. CPI, FOMC, earnings — the wick is real but the follow-through is unpredictable. Know what's on the calendar.
9. Consecutive signals. In a strong trend you'll get repeated sweeps in the losing direction as price grinds. Three buy triangles in a row while price makes lower lows is not three opportunities, it's the market telling you the pattern isn't working right now.
Depending on what time frame you decide to use, careful with your risk management and not to make it too large or too close to your entries. You will experience downdraw on your entries. So please pay attention to volume and continuation confirmation on the momentum.
Happy Trading!!!! Indicator

Market Correlation Visualizer (Z-Score)Market Correlation Visualizer (Z-Score & % Var)
OVERVIEW
The Market Correlation Visualizer is a multi-asset analysis tool designed for intraday traders and quant analysts. Instead of relying on static correlation tables, this script plots real-time relative performance across up to 8 benchmark assets (Indices, Volatility, Commodities, Bonds, and Crypto) directly on your chart panel.
By standardizing assets through either Z-Score (Standard Deviations) or Percentage Change, you can instantly spot institutional imbalances, intermarket divergences, and statistical overextensions before they manifest on price action alone.
KEY FEATURES
Dual Engine Calculation:
Z-Score Normalization scales price movements based on rolling standard deviation. It identifies when an asset is statistically overbought/oversold relative to its peers.
Daily % Change Anchor normalizes performance from a customizable anchor time (e.g. Daily Open) to track pure percentage strength or weakness throughout the session.
Smart Right-Hand Labels:
Clean, dynamic labels automatically lock onto the right boundary of the indicator panel, displaying the ticker name and exact current reading. No need to memorize line colors.
Statistical Excess Zones (+/- 2.0 SD):
Visual upper and lower threshold bands immediately highlight extreme mean-reversion zones when using Z-Score mode.
Selective Visibility Filters:
Toggle up to 8 custom symbols on or off directly from the settings menu to keep your workspace uncluttered.
Error-Handled Security Fetching:
Built with robust fallback logic to ensure smooth performance across various brokers without breaking the chart panel if a specific ticker fails to load.
HOW TO USE FOR INTRADAY TRADING
Spotting SMT / Intermarket Divergences:
Watch key correlated pairs (e.g. ES vs NQ). If one index makes a new high while the visualizer line on the other fails to confirm, a liquidity sweep or SMT divergence is in play.
Mean-Reversion & Arbitrage:
When an asset crosses outside the +/- 2.0 Standard Deviation band while others remain neutral, it indicates an overextended asset prone to snapping back toward the zero-line.
Volatility Confirmation:
Track VIX against equity futures (ES, NQ). If ES hits a new low but the VIX line fails to push upward, the selling momentum lacks institutional backing.
DEFAULT TICKERS INCLUDED
Asset 1: TVC:VIX (Volatility)
Asset 2: CME_MINI:ES1! (S&P 500)
Asset 3: CME_MINI:NQ1! (Nasdaq 100)
Asset 4: COMEX:GC1! (Gold)
Assets 5 to 8 (Optional): NYMEX:CL1! (Crude Oil), CBOT:ZB1! (30Y Bonds), CME_MINI:RTY1! (Russell 2000), BINANCE:BTCUSDT (Bitcoin).
All inputs can be fully customized in the script settings. Indicator

IB + OR Developing Lines DashboardIB + OR Dashboard
Plots the Opening Range and Initial Balance for the session, with quarter levels through the IB and a small table showing the size of each range in points.
The problem it solves
Most OR/IB scripts build their levels from chart bars, which breaks the moment your OR length doesn't divide evenly into your chart timeframe. A 15-minute Opening Range on a 2-minute chart is the obvious case: the bar that opens at 9:44 runs through 9:46, so the script either swallows an extra minute of price that isn't part of the range, or drops the last minute entirely. Either way the level you're trading off is wrong, and it doesn't print until 9:46 — a full minute after the range actually closed.
This one pulls lower-timeframe data and checks every sub-bar against the real cutoff timestamp. The straddling bar only contributes the part that belongs inside the window. The levels also lock the moment the cutoff passes instead of waiting for the chart bar to finish, so a 15-minute OR prints at 9:45 like it should.
If the intrabar resolution isn't lower than your chart timeframe, it falls back to chart-bar logic instead of erroring out. A "Source" row in the dashboard tells you which mode is running.
Settings
Session window and timezone
OR duration (default 15 min) and IB duration (default 60 min)
Intrabar resolution — 1 minute is enough for a 15-minute OR
Toggles for OR lines, IB lines, and IB quarter levels
Colors, widths, and line styles for each group
Dashboard position, or turn it off Indicator

Strategy

Mean Reversion Half-Life & Spread Tracker [OnlyFibonacci] v3.0Mean Reversion Half-Life & Spread Tracker v3.0
A statistical mean-reversion oscillator for spread analysis — Z-Score normalization, closure-time tracking, confirmed signals, target price projection, and a real-time dashboard. Built in Pine Script v6.
This indicator is for educational and analytical purposes only. It does not constitute investment advice, financial advice, or a trading recommendation. Past signal performance does not guarantee future results. Always do your own research and manage risk responsibly.
---
What does this indicator do?
Mean Reversion Half-Life & Spread Tracker measures how far a price or spread has deviated from its statistical mean using a Z-Score oscillator . Beyond simple overbought/oversold readings, it tracks how long extreme deviations typically take to revert to zero, whether the current deviation is lasting longer than average, where price may revert if Z-Score returns to 0, and the historical success rate of confirmed signals.
Default mode: Asset vs Single Moving Average (Mean Reversion) — the chart symbol is normalized against a configurable SMA.
---
Core Features
Two Operational Modes
Asset vs SMA (default): Analyzes Close / SMA ratio for single-asset mean reversion
Pair Trading : Analyzes chart symbol (Asset A) divided by a secondary symbol (Asset B)
Z-Score Engine
Spread Ratio = Close/SMA or Close/Asset B
Z-Score = (Ratio − Rolling Mean) / Rolling Standard Deviation
Default lookback: 200 bars
EMA(3) smoothing applied to raw Z-Score to reduce whipsaw noise
Threshold Levels
Upper threshold: +2.3 (statistical overbought zone)
Lower threshold: −2.3 (statistical oversold zone)
Center line: 0.0 (equilibrium / mean)
Mean Closure Time
Tracks the average number of bars required for Z-Score to return to 0 after breaching ±2.3
Displays active spread duration in real time
Triggers a Time-Stop WARNING when duration exceeds the historical average
Confirmed Signal Logic
BUY : Smoothed Z-Score crosses above −2.3 and holds beyond the threshold for at least 1 full confirmed bar close (bullish mean reversion)
SELL : Smoothed Z-Score crosses below +2.3 and holds beyond the threshold for at least 1 full confirmed bar close (bearish mean reversion)
EXIT : Z-Score reaches 0, time-stop is triggered, or duration exceeds 2× average closure time
Signal Win Rate (%)
Historical success rate of confirmed signals
Win: Z-Score returns to 0 before exceeding 2× average closure time
Loss: Timeout or time-stop triggered before mean reversion completes
Target Price Level
Estimated chart price where Z-Score would equal 0
MA mode: RatioMean × SMA
Pair mode: RatioMean × Asset B price
Optional dynamic dashed projection line on the main chart while a signal is active
Visual Design (v3.0)
Dynamic gradient Z-Score line (red above 0, green below 0, neon tones at extremes)
Gradient-filled area between Z-Score and the zero line
Soft background glow in extreme zones
Modern dark-theme dashboard table with live status indicators
Built-in Alerts
Upper / Lower Threshold Breach
Time-Stop Warning
Bullish Mean Reversion BUY
Bearish Mean Reversion SELL
Signal EXIT
---
Dashboard Table
Live metrics displayed in the top-right corner:
Pair / Mode — active analysis configuration
Current Z-Score — real-time smoothed reading
Target Price Level — estimated Z=0 price
Avg Closure Time — historical mean reversion duration (bars)
Spread Duration — active deviation duration
Time-Stop Status — Normal or Warning
Signal Win Rate (%) — historical confirmed signal success rate
Status indicators: Normal, Active Trade, Warning.
---
How to Use
Add the indicator to your chart (separate oscillator pane).
In default Asset vs SMA mode, set the SMA length (default: 50).
For pair analysis, switch to Pair Trading mode and select Asset B.
Monitor the Z-Score panel:
Z > +2.3 → spread is statistically extended above mean (potential bearish mean reversion)
Z < −2.3 → spread is statistically extended below mean (potential bullish mean reversion)
Z ≈ 0 → statistical equilibrium
Compare Spread Duration against Avg Closure Time in the dashboard.
If Time-Stop shows WARNING, the deviation may be persisting longer than historically normal — review risk management.
Set alerts for threshold breaches, confirmed signals, and exits.
---
How to Interpret
Mean reversion concept : When price or spread reaches statistical extremes, it tends to revert toward its rolling mean over time.
Z-Score : Measures deviation in standard deviation units. ±2.3 represents a strong statistical extreme.
Avg Closure Time : How long past extreme deviations took to revert to zero. If current duration exceeds this, caution is warranted.
Target Price : A dynamic estimate of where price may revert if Z-Score normalizes — a reference level, not a guaranteed target.
Win Rate : A summary of past confirmed signal outcomes. Not a promise of future performance.
Gradient fill : Visually emphasizes the magnitude and direction of deviation from equilibrium.
Horizontal dashed line on the main chart (if enabled): Projects the estimated price level where Z-Score = 0 while a BUY or SELL signal is active. It updates dynamically and disappears on EXIT or target reached. Disable via Show Target Price Projection Line .
---
Recommended Use Cases
Single-asset mean reversion analysis vs SMA
Crypto, forex, and equity pair spread monitoring
Multi-timeframe confluence checks
Alert-based watchlist monitoring
Time-stop and duration-based risk awareness
---
Customizable Inputs
Mode, Asset B Symbol, MA Length
Z-Score Lookback (200), EMA Smoothing (3)
Upper/Lower Threshold (±2.3)
Signal Confirmation Bars (1–5)
Gradient Area Fill, Background Glow, Target Line, Dashboard
---
Important Notes
Non-repainting security calls: gaps_off, lookahead_off
This is an analysis tool — it does not execute trades automatically
Parameters may require optimization across different markets and timeframes
Win rate and closure time are based on historical data and may differ in live conditions
Always use proper position sizing and risk management
---
Keywords
Mean Reversion, Z-Score, Half-Life, Spread Tracker, Pair Trading, Statistical Arbitrage, Oscillator, SMA, Closure Time, Time-Stop, Pine Script v6, OnlyFibonacci
---
Developed with Pine Script v6. For analysis and education only. Indicator

Indicator

Indicator

MACD Trend Phase MTF by [Itto Ryu]# MACD Trend Phase MTF by — User Manual (Publication Version)
---
## 1 · Purpose
This indicator answers one question: **"Where are we in the trend lifecycle?"** — not merely "has MACD crossed yet?"
A single MACD can only describe momentum state; it cannot describe trend *phase*, because phase emerges from the relationship between multiple timeframes. This script reads a PPO-normalized MACD across three time layers — a slow timeframe sets the regime, a mid timeframe defines the phase, and the chart timeframe tracks entry timing — then outputs an instantly readable phase name, a multi-timeframe dashboard, and a weighted consensus verdict (MAJOR).
Because everything is normalized to percentages, it works on any market and any symbol: index futures, stocks, crypto, or forex.
## 2 · Methodology
**Engine — PPO (Percentage Price Oscillator):**
```
PPO = (EMA(close,12) − EMA(close,26)) / EMA(close,26) × 100
Signal = EMA(PPO, 9)
Hist = PPO − Signal
```
PPO is used instead of raw MACD so thresholds stay constant across markets and across years (raw MACD is denominated in price units and cannot be compared across symbols).
**Phase state machine (computed on the Phase TF, default 4H):** each timeframe uses only three features:
1. **Regime** — PPO above/below zero
2. **Impulse** — PPO above/below its signal line
3. **Leg-peak memory** — is the latest impulse leg's PPO peak lower than the previous leg's peak? (structural momentum divergence)
Combined with the slow-TF regime, this yields 9 phases:
| Phase | Condition | Meaning |
|---|---|---|
| ESTABLISHED BULL | Slow bull + mid bull + impulse up | Fully aligned uptrend |
| BULL PULLBACK | Mid bull + impulse down + peaks not declining | Correction inside an uptrend — a classic continuation setup |
| WEAKENING BULL | Mid bull + impulse down + lower peaks | Late-stage uptrend — momentum thinning |
| EMERGING BULL | Mid bull but slow TF not yet bull | New trend, not yet confirmed |
| TRANSITION / CHOP | \|PPO\| < chop threshold | No phase — directionless market |
| (4 BEAR phases = mirror) | | BEAR RALLY = the mirror continuation setup |
**Anti-flicker:** the committed phase changes only after the new raw phase persists for N chart bars (default 2) — hysteresis prevents flickering.
**Timing signal:** when the phase is a pullback phase and the chart-TF histogram inflects back in the trend direction (`hist > hist ` after falling, or the mirror), a ▲/▼ triangle prints on the price chart. The idea: the higher timeframe defines *where* momentum entries make conceptual sense; the chart timeframe shows *when* the counter-move is fading.
**MAJOR consensus:** each grid TF scores its phase (Established ±1.0, Pullback ±0.75, Emerging ±0.5, Weakening ±0.25, Chop 0), weighted by timeframe (default 30m×1, 1H×1.5, 4H×2, D×3) → summed into a net % → |net| ≥ 20% = LONG/SHORT lean, ≥ 50% = strong. This is a structured way of reading multi-timeframe agreement at a glance — higher timeframes get louder votes.
## 3 · Defaults (Inputs)
| Input | Default | Rationale |
|---|---|---|
| Regime TF | D | Slowest layer; only its zero-line side is used |
| Phase TF | 240 (4H) | Phase-defining layer — roughly 4–6× the chart TF works well |
| Fast / Slow / Signal | 12 / 26 / 9 | Standard values, identical on every TF — deliberately untuned |
| Chop threshold | 0.10% | \|PPO\| below this = directionless market |
| Phase confirm bars | 2 | Hysteresis against phase flicker |
| Grid TFs | 30m / 1H / 4H / D | Dashboard rows |
| Weights | 1 / 1.5 / 2 / 3 | Higher timeframes get louder votes |
| Major bias / Strong | 20% / 50% | Verdict thresholds |
| Dashboard size | Middle | Tiny / Middle / Large |
All defaults are starting points, not optimized values — adjust them to your market and timeframe structure.
## 4 · Visual Elements
| Element | Meaning |
|---|---|
| Histogram columns (pane) | Chart-TF PPO − Signal; solid color = accelerating, faded = fading |
| Blue / orange lines (pane) | Chart-TF PPO / Signal |
| Pane background color | Current phase (green = bull family, red = bear family, orange = weakening, gray = chop) |
| ▲ / ▼ on the price chart | Timing markers — phase-gated momentum inflections |
| TF grid table | Phase per timeframe + ● dot in the L / S / H column |
| MAJOR row | Weighted consensus verdict + net % |
| Timing row | Timing status ("wait" / "TIMING NOW") |
| ⚠ row | Warns when chart TF ≥ Phase TF (view a lower TF, e.g. 1H) |
## 5 · Who This Is For / NOT For
**For:** traders studying trend-pullback structure who execute manually and use indicators as context filters; anyone who wants a one-glance answer to "is this market trending, correcting, weakening, or going nowhere?"
**NOT for:** scalpers far below the phase TF (higher-TF data updates too slowly to matter); anyone expecting a fully automatic buy/sell system (this is decision support, not a bot); extended sideways markets (it will mostly show CHOP — which is the correct reading: no trend phase exists).
## 6 · How to Use (Study Playbook)
1. Open the chart one or more steps **below the Phase TF** (e.g. 1H chart with a 4H phase TF).
2. Use the background color and phase label as context: trend-following ideas align with ESTABLISHED phases, continuation setups form during PULLBACK / RALLY phases, and WEAKENING or CHOP suggest standing aside.
3. Check the **MAJOR** row — study how often lower and higher timeframes agree before strong moves, and how disagreement resolves.
4. The ▲/▼ triangles mark where a counter-trend swing's momentum fades *while the higher timeframe still points with the trend* — the classic pullback-entry concept. Observe how these behave on your market before acting on any of them.
5. Momentum-inflection signals are, by nature, short-horizon events — they describe the next swing, not the next month. Re-evaluate whenever the phase changes.
6. Alerts: alert dialog → Condition = "MACD Phase" → choose "Phase changed", "Major bias changed", "Long timing" or "Short timing" → recommended trigger **Once per bar close**.
7. WEAKENING is best studied as a position-management state (momentum thinning), not a reversal signal.
## 7 · Common Mistakes
- ❌ Treating ESTABLISHED phases as entry signals — by the time everything is aligned, much of the move has often happened; the pullback phases are where continuation logic actually applies.
- ❌ Taking every triangle in both directions on every market — different markets have different structural drifts; study each side's behavior on your instrument first.
- ❌ Expecting momentum-inflection signals to define long swings — their information decays quickly.
- ❌ Viewing on a chart TF larger than the Phase TF (the ⚠ row will warn you).
- ❌ Reading MAJOR % as a probability — it is a weighted vote score (a structured prior), not a measured probability.
- ❌ Changing several inputs at once — you lose track of what actually changed the behavior.
## 8 · For Educational Purposes Only
This indicator is published **for educational purposes only**. It is a tool for studying how momentum, trend phase, and multi-timeframe structure interact — it is **not** a trading system, does not generate financial advice, and makes **no claim of profitability**. No performance figures are stated or implied; past behavior of any signal, on any market, does not guarantee future results. Before risking real capital on any concept illustrated here, do your own testing on your own market, timeframe, and cost structure, and consult a licensed financial professional where appropriate. You alone are responsible for your trading decisions.
## 9 · Disclosure Block
- **Pine version:** v6
- **Repaint:** NO on closed bars — every HTF value uses only fully closed bars (`security(expr , lookahead_on)` idiom); historical bars are never redrawn. Note: current-bar table values and signals update until the bar closes — use alerts set to "Once per bar close".
- **Chart type:** standard candles only (no Heikin Ashi / Renko / Range — synthetic prices distort PPO).
- **Originality:** fully original code — the phase state machine, leg-peak memory, and weighted MTF consensus were written from scratch, not adapted from any open-source script.
- **This indicator is create for educational purposes only — not investment advice or recommendation or professional advice, you are on your own risk **
---
Indicator

Market Internals Status: TICK / ADD / VOLDThis indicator displays a real-time status table for three classic NYSE/Nasdaq
market-breadth internals: USI:TICK , USI:ADD (advance/decline issues, Nasdaq variant
by default) and USI:VOLD (up/down volume difference). It is designed for index
futures and index CFD traders (ES, MES, SPX, NQ, etc.) who use market
internals to confirm directional bias before entering a trade.
METHODOLOGY
Each internal is classified using a fixed absolute-level threshold you control
from the settings: a reading above the "bullish" threshold is tagged BULLISH,
below the "bearish" threshold is tagged BEARISH, and anything in between is
NEUTRAL. This is a simple level-based read, not a moving average, oscillator,
or percentile rank — the goal is to mirror how discretionary traders read raw
internals on a dedicated internals chart, but with an objective, repeatable
rule instead of a visual guess.
A CONSENSUS row aggregates the three readings: it shows "aligned bullish" or
"aligned bearish" only when at least two of the three internals agree in the
same direction past their threshold; otherwise it shows "mixed/flat",
flagging a session where internals do not confirm a clean directional bias.
DATA VALIDATION
Market-internal data feeds occasionally emit corrupted or placeholder values
when the underlying index has no valid tick (e.g., outside NYSE/Nasdaq
cash-session hours). The script validates every reading against a
configurable sanity ceiling per internal. A reading outside that realistic
range is treated as invalid and shown as N/A instead of being misclassified
as bullish or bearish, and it is excluded from the consensus calculation.
SESSION AWARENESS
USI:TICK , USI:ADD and USI:VOLD are breadth measures of the NYSE/Nasdaq cash equity
market and therefore only update during the 09:30–16:00 America/New_York
session. A SESSION row tells you at a glance whether the reading is live or
frozen from the prior session close — important context if you trade an
instrument (like index futures) that keeps trading outside cash-market hours.
HOW TO USE IT
Add the indicator to any chart — it does not need to be an internals chart
itself, it fetches its own data via request.security(). Open the settings to:
(1) pick the exact ticker for each internal your data plan provides, since
exchange-composite symbol naming can vary; (2) set your own bullish/bearish
thresholds; (3) adjust the sanity ceilings if you trade an internal with an
unusually wide typical range. Use the resulting table as a breadth
confirmation filter alongside your own price/volume-based setup — it is not
a standalone entry signal. Indicator

Forex Liquidity Map [invincible3]b]Forex Liquidity Glow Map
The Forex Liquidity Glow Map is a visual currency-rotation dashboard designed to estimate where relative strength and trading activity are moving across the major Forex market.
The indicator analyzes all 28 unique currency pairs formed from:
USD, EUR, GBP, JPY, CHF, CAD, AUD, and NZD
Instead of evaluating one pair in isolation, it combines information from every relationship connected to each currency. This produces an aggregated flow score for all eight currencies and helps identify the strongest and weakest areas of the Forex market.
Calculation Model
Each Forex pair is evaluated using:
• ATR-normalized price momentum
• Relative tick-volume activity
• Fast-versus-slow trend structure
• Volatility expansion
• Directional breadth
• Score smoothing
• Flow acceleration
A positive pair score strengthens the base currency and weakens the quote currency. A negative pair score strengthens the quote currency and weakens the base currency.
Each currency’s final score is calculated from its seven connected pair relationships.
Because spot Forex is decentralized, the indicator uses PulseWire broker-feed tick volume as an activity proxy. It does not represent centralized institutional order flow.
Forex Liquidity Map
The circular map displays the eight major currencies as nodes.
• Node value: Aggregated currency-flow score
• Node size: Average relative activity across connected pairs
• River direction: Weaker currency toward stronger currency
• River width: Estimated strength of liquidity rotation
• River color: Leading currency in that relationship
• Arrow: Direction of relative capital rotation
A positive score indicates relative strength or estimated inflow. A negative score indicates relative weakness or estimated outflow.
Water Flow Matrix
The scatter matrix shows each currency according to:
• Horizontal position: Current flow score
• Vertical position: Flow acceleration
• Bubble size: Relative pair activity
• Bubble color: Currency identity
The four matrix conditions are:
• Accelerating inflow: Positive flow with positive acceleration
• Weakening inflow: Positive flow with negative acceleration
• Accelerating outflow: Negative flow with negative acceleration
• Weakening outflow: Negative flow with positive acceleration
This helps distinguish a currency that is merely strong from one whose strength is actively increasing.
Dashboard and Pair Ranking
The dashboard includes:
• Currency strength ranking
• Current flow score
• Relative tick activity
• Momentum condition
• Inflow, outflow, or balanced status
• Ranked breakdown of all 28 Forex pairs
• Strongest and weakest currencies
• Best relative-strength pair
• Market confirmation percentage
• Current Forex-rotation regime
For example, when GBP is the strongest currency and AUD is the weakest, the dashboard may identify GBPAUD as the primary relative-strength opportunity.
Update Modes
Confirmed bars only uses completed calculation-timeframe candles. The rivers, matrix, rankings, and signals remain fixed while the current candle is forming.
Live uses the active candle and updates as price and tick volume change. This provides faster information but may change before candle close.
Confirmed mode is recommended for stable analysis and alerts. Live mode is intended for intrabar monitoring.
Display Features
• Responsive bar-index geometry
• Stable layout across intraday and higher timeframes
• Dark and Bright theme presets
• Fully opaque dashboard cells
• High-contrast currency colors
• Adjustable map and matrix dimensions
• Adjustable river threshold
• Optional arrows, glow, tooltips, tables, and signals
• Configurable PulseWire Forex-feed prefix
Interpretation
The indicator is most useful for:
• Finding strongest-versus-weakest currency combinations
• Confirming directional pair setups
• Monitoring broad Forex rotation
• Detecting strengthening or weakening flows
• Avoiding pairs where both currencies have similar strength
• Comparing pair-level movement with broader currency-level confirmation
The output should be used as a market-structure and relative-strength tool , not as a standalone entry system.
Execution decisions should also consider price structure, volatility, liquidity conditions, risk management, and scheduled economic events. Indicator

Adaptive SuperTrend AI - Regime-Tuned [Dots3Red]📈 ADAPTIVE SUPERTREND AI — REGIME-TUNED
Classic SuperTrend uses one fixed ATR multiplier forever. That single number is a compromise: tight enough to track trends closely, it whipsaws during ranges; wide enough to survive ranges, it lags badly once a real trend starts. This script replaces the fixed multiplier with one that changes based on what kind of market is actually happening, using the same regime-detection engine shared across the Dots3Red catalog.
🧠 THE REGIME ENGINE
Every bar is classified into one of four states using ADX and the Choppiness Index together:
• 📈 TRENDING — ADX confirms directional strength and Choppiness confirms low chop
• 🔁 RANGING — the opposite: weak directional strength, high chop
• ⚡ VOLATILE — current ATR has expanded well beyond its baseline, regardless of direction or chop
• ❔ UNCERTAIN — none of the above conditions are clearly met
The raw regime reading is smoothed by taking the most frequent classification over a short lookback window, so a single noisy bar can't flip the regime label back and forth.
🤔 WHY RANGING GETS THE WIDEST BAND, NOT TRENDING
This is the part that looks backwards at first glance, so it's worth explaining directly. A ranging market chops back and forth around a mean — if the band were narrow here, ordinary noise would cross it constantly, causing false flips. So RANGING gets the widest multiplier (default 3.5×), letting normal chop stay inside the band. A TRENDING market is moving with genuine conviction, so a moderate multiplier (default 2.5×) tracks the move closely without giving back excessive profit before flipping on an actual reversal. VOLATILE conditions get the widest multiplier of all (default 4.5×) as a purely defensive setting, since sudden expansion is unpredictable by nature.
When the regime changes, the active multiplier doesn't jump to its new value instantly — it glides toward it over a configurable number of bars. This prevents the band from visibly teleporting on a regime transition, which would otherwise look jarring and could itself trigger a false flip right at the transition point.
The underlying band mechanics — the ratcheting upper/lower band logic, and a flip only when price closes beyond the active band — are the same as classic SuperTrend. Only the multiplier driving the band width is dynamic.
✅ THE CONFIDENCE LAYER
A SuperTrend flip is a single binary event: price crossed the band, direction changed. This script adds a secondary read on how convincing that flip actually is, using 8 independent checks against the new direction:
1. Close vs. a trend moving average
2. MACD histogram sign
3. Recent higher-high / lower-low structure
4. Close vs. the SuperTrend's own midline (hl2)
5. RSI side of 50
6. +DI vs. -DI dominance
7. Volume above its moving average on a trend-direction bar
8. Whether the regime is currently TRENDING
Every confirmed flip shows this count directly on its label — "▲ 6/8" means 6 of the 8 checks currently agree with the new uptrend. A flip with 7/8 agreement and one with 3/8 are treated identically by the raw band mechanics, but this layer gives a way to distinguish a well-supported flip from a marginal one at a glance.
🎯 FLIP WIN-RATE TRACKING
Each flip is graded once the following flip occurs: did price actually finish above the flip price (for an up-flip) or below it (for a down-flip) by the time direction changed again? This produces a running win rate — for example "58% (n=34)" — shown in the dashboard. It is a simple, honest measure of how the flips on this specific chart have actually played out, not a backtest or a promise about future flips.
🔒 NON-REPAINTING
Flips, confidence readings, and labels are all evaluated only on confirmed (closed) bars. A flip that appears on the chart will not later disappear or move to a different bar as new price data arrives.
🎨 VISUALS AND CUSTOMIZATION
The SuperTrend line and gradient fill are colored by current direction. Flip labels appear directly on confirmed flip bars with their confidence count. An optional background tint can shade the chart by current regime. All four core colors (bullish, bearish, volatile/warning, and uncertain/neutral) are fully customizable in settings, independent of the script's default palette.
The dashboard (position configurable) shows: current direction, current regime, the active ATR multiplier, the confidence count with a progress bar, the running flip win rate, and the raw ADX, Choppiness, and ATR ratio readings behind the regime classification.
🧭 HOW TO USE
👀 Reading the line and fill — the colored line and gradient fill show current direction at a glance. This is the same information classic SuperTrend gives you; the difference here is in how the band width behind that line was chosen.
🧠 Check the regime before trusting the band width — the dashboard's Regime row tells you why the band is currently as wide (or narrow) as it is. A band that looks unusually wide isn't a bug — it likely means the engine has classified the market as RANGING or VOLATILE and widened defensively. Knowing the current regime helps set expectations for how the band will behave if conditions stay the same.
✅ Use the confidence count to gauge flip quality, not to filter flips — every flip is real and non-repainting regardless of its confidence count. The count is a lens for judging how broadly supported a given flip is, not a gate that decides whether one occurs. A "▲ 7/8" flip and a "▲ 3/8" flip both mean the band was crossed; the number tells you how much independent agreement existed at that moment, which is useful context when deciding how much weight to put on that particular signal versus your own analysis.
🎯 Watch the flip win rate as a running self-check on this chart — because it only starts once flips have accumulated and been graded, treat an early or low-sample win rate as inconclusive rather than a verdict. It becomes more informative the longer the script runs on a given symbol and timeframe.
🔔 Regime changes are themselves informative — the alert for a regime change fires independently of any flip. A shift from RANGING to TRENDING, for example, can be useful context on its own, since it signals the band is about to glide toward a different multiplier even before any flip occurs.
🚫 This script describes band behavior, not entries or exits — it does not tell you when to open or close a position. Use it as one input alongside price action, structure, and whatever other analysis you already rely on.
⚙️ SETTINGS
📈 SuperTrend Core
• ATR Length
• Factor — Trending / Ranging / Volatile / Uncertain — the four regime-driven multipliers
• Factor Transition (bars) — how gradually the multiplier glides between regimes
🧠 Regime Engine
• ADX Length, Choppiness Length, ATR Baseline Period
• Trending / Ranging Thresholds — where the combined ADX+Choppiness score is classified
• Volatile ATR Multiple — how far above baseline ATR counts as volatility expansion
• Regime Smoothing — lookback window for the majority-vote smoothing
✅ Confidence Layer
• Trend MA Length, RSI Length, Structure Lookback — parameters for the 8 confidence checks
🎨 Visualization
• Gradient Fill, Flip Labels, Regime Background Tint — each toggleable independently
• Full color customization for all four regime/direction colors
🖥️ Dashboard
• Show/hide, position
📝 NOTES
The regime engine needs a short warm-up period before its smoothing window is fully populated; early bars on a fresh chart may show less stable regime labels than bars further along. The flip win rate starts empty and only becomes meaningful after several flips have occurred and been graded.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical flip win rate does not guarantee future performance. Indicator

Indicator
