SMCNexusFactsCoreV2SMCNexusFactsCoreV2 is an open-source, non-visual Pine Script library that maintains confirmed and bounded Smart Money Concepts market facts for use by importing indicators.
The library provides a stateful market-facts engine for swing structure, BOS, CHoCH, MSS, Fair Value Gaps, Order Blocks, liquidity pools, liquidity sweeps, Premium/Discount context and EMA-based context.
It does not draw chart objects, create inputs, request other timeframes, generate alerts, transmit data, calculate trade recommendations or place orders. The importing indicator supplies all chart series and decides how the returned facts are displayed or used.
ORIGINAL CONCEPT AND PURPOSE
The library maintains one consistent, confirmed market-state model instead of calculating unrelated labels independently.
Confirmed swing points become the shared source for:
• HH, HL, LH and LL classification,
• market bias,
• Break of Structure,
• Change of Character,
• Market Structure Shift,
• buy-side and sell-side liquidity pools,
• Premium and Discount dealing ranges.
Fair Value Gaps and Order Blocks use bounded lifecycle records. The library retains only a limited number of objects for each type and direction, preventing unbounded array growth.
Visual settings are not part of this library. An importing indicator can hide or show its own presentation without changing the underlying facts maintained by Facts Core.
CONFIRMED-ONLY PROCESSING
The importing indicator explicitly tells the library whether the current bar is confirmed.
Canonical state changes occur only when confirmed data is supplied. This includes:
• new swing confirmation,
• BOS or CHoCH confirmation,
• MSS confirmation,
• creation of FVG and Order Block facts,
• zone tests and mitigation,
• liquidity-pool creation and collection,
• sweep confirmation.
The library does not use future chart data, negative visual offsets to rewrite history or hidden lookahead requests.
MARKET STRUCTURE
The stateful swing engine stores the latest and previous confirmed swing highs and lows.
It classifies confirmed swings as:
• HH — Higher High
• HL — Higher Low
• LH — Lower High
• LL — Lower Low
The structure model tracks:
• latest swing prices,
• origin bars,
• swing types,
• current market bias,
• consumed structure levels,
• latest break type and direction,
• latest MSS direction and bar.
BOS AND CHOCH
A confirmed break can require a candle close beyond the structure level, depending on the supplied configuration.
The current market bias and the direction of the broken swing determine whether the event represents continuation or a Change of Character.
The library preserves the confirmed event level, direction, origin and confirmation bar in the returned snapshot.
MARKET STRUCTURE SHIFT
MSS can require:
• a confirmed close through structure,
• a previous opposite bias,
• a displacement candle,
• a minimum ATR-based displacement.
These requirements are provided through FactsConfiguration. The library does not silently relax a missing requirement.
FAIR VALUE GAPS
The library detects bullish and bearish three-candle imbalances from caller-supplied OHLC data.
Optional ATR filtering can require a minimum imbalance size.
Each FVG fact can contain:
• direction,
• upper and lower boundaries,
• origin bar and time,
• confirmation bar,
• mitigation state,
• invalidation state,
• test count,
• fill percentage,
• latest test bar,
• origin volume,
• origin average volume,
• origin Premium/Discount location,
• bounded strength,
• displacement confirmation.
ORDER BLOCKS
Order Block facts are created from a bounded lookback and can require a confirmed BOS or MSS.
The configuration controls whether candle bodies or full candle ranges define the zone.
Each Order Block uses the same auditable lifecycle metadata as an FVG, including origin, tests, fill, mitigation, invalidation, volume, relative volume context, strength and displacement confirmation.
ZONE LIFECYCLE
A zone can be:
• available,
• tested,
• partially filled,
• mitigated,
• invalidated.
The test counter and fill percentage are updated from confirmed interaction with the stored zone boundaries.
The library does not invent missing origin metadata. If a fact cannot be associated with a valid source, the unavailable value remains unavailable.
LIQUIDITY
The library maintains bounded arrays of confirmed swing-high and swing-low liquidity references.
It derives:
• BSL — Buy-Side Liquidity,
• SSL — Sell-Side Liquidity,
• EQH — Equal Highs,
• EQL — Equal Lows.
Equal-level classification uses the supplied ATR-based tolerance rather than exact floating-point equality.
Liquidity metadata includes:
• side and type,
• level,
• origin bar,
• collection state,
• collection time,
• sweep type and level.
A pool origin is preserved only when its price is genuinely associated with the originating swing. The library does not transfer unrelated swing metadata to a new liquidity level.
LIQUIDITY SWEEPS
Depending on configuration, a sweep can require price to move beyond the stored pool and close back inside it.
The returned snapshot distinguishes BSL and SSL sweep facts. A sweep is a confirmed market fact, not a BUY or SELL recommendation.
PREMIUM AND DISCOUNT
The library can build a dealing range from confirmed swing extremes.
The returned context can contain:
• range high,
• range low,
• equilibrium,
• current Premium, Discount or Equilibrium classification.
An unavailable or invalid range remains unavailable rather than using a synthetic fallback.
EMA AND CONTEXT FACTS
The importing indicator supplies the configured fast, medium and slow EMA values together with available higher-timeframe context.
Facts Core returns bounded contextual facts such as:
• EMA trend state,
• price relation to EMA values,
• available higher-timeframe trend and bias context.
The library does not request higher-timeframe data itself. This keeps data ownership and confirmation timing inside the importing indicator.
BOUNDED STATE
The implementation uses explicit limits:
• maximum six zones for each kind and direction,
• maximum eight swing references for each side.
This prevents unlimited state growth and makes runtime behavior predictable.
PUBLIC API
Exported records:
• FactsConfiguration
• ZoneFact
• FactsState
• StructureFacts
• ZoneFacts
• LiquidityFacts
• ContextFacts
• FactsSnapshot
Exported functions:
• contractVersion()
• defaultConfiguration()
• newState()
• advance(...)
• snapshotValid(...)
TYPICAL USAGE
An importing indicator should:
1. Create one persistent FactsState.
2. Create or resolve a FactsConfiguration.
3. Supply confirmed OHLCV, ATR, EMA and available context values to advance().
4. Store the returned state.
5. Read the returned FactsSnapshot.
6. Validate the snapshot with snapshotValid().
7. Present or transport only facts that are actually available.
Conceptual example:
```pine
import AreXoN_/SMCNexusFactsCoreV2/1 as facts
var facts.FactsState state = facts.newState()
facts.FactsConfiguration configuration =
facts.defaultConfiguration()
= facts.advance(
state,
configuration,
barstate.isconfirmed,
bar_index,
time,
open,
high,
low,
close,
volume,
atr14,
emaFast,
emaMedium,
emaSlow,
higherTimeframeTrend,
higherTimeframeBias,
localContext)
state := stateNext
bool validSnapshot = facts.snapshotValid(snapshot)
```
The example is conceptual. The exact function signature in the published source is authoritative. Replace the example import with the exact path assigned by TradingView.
WHY THE CHART IS CLEAN
This is a non-visual market-facts library. It intentionally creates no plots, labels, boxes, lines, tables or chart drawings.
The publication chart is therefore intentionally clean and contains no other indicators or unexplained visual elements. An importing indicator is responsible for visual presentation.
LIMITATIONS
• Facts are based on the chart OHLCV series supplied by the importer.
• Swing confirmation necessarily occurs after the configured right-side bars.
• The library does not provide native bid/ask data, footprint or real order flow.
• Chart volume may be broker tick volume rather than centralized exchange volume.
• It does not verify spread, slippage or broker execution.
• It does not request macroeconomic information.
• It does not produce trading signals or recommendations.
• It does not place, modify or close orders.
• It produces no visual chart output by itself.
Contract version: 1.0.0.
This library is an analytical and software-development component. It is not investment advice, a trading recommendation or an automated trading system. Library

Indicator

Range Commander ORB [JOAT]An Opening Range Breakout command center: captures the opening range, projects measured-move targets, and tracks the breakout live.
◆ WHAT IT IS
The opening range — the high and low of the first minutes of a session — is one of the most-watched intraday reference structures. Range Commander captures it automatically, locks it into a clean box, and builds a full breakout and target framework around it. It is a context and structure tool: it maps the range, marks the breaks, and tracks the targets — it does not fire endless buy/sell arrows.
This is 100% original code, written from scratch. It does not reuse any other author's ORB script.
◆ HOW IT WORKS
1. Range capture. During your chosen session window (default 09:30–09:45 New York, fully adjustable with a timezone selector), the indicator records the running high and low into a live box.
2. Lock and project. When the window closes, the range locks. Its height becomes 1R , and the tool projects measured-move target rails at ±0.5R, ±1R and ±1.5R (all configurable), plus the range midline.
3. Breakout logic. A breakout is registered on either a close beyond the range (cleaner) or a wick beyond the range (faster) — your choice. An option stamps only the first break per side per day to keep the chart immaculate. A minimum range-size filter (in ATR) lets you skip dead, low-range opens.
4. Retests and targets. After a break, the first return to the broken edge is marked with a subtle diamond, and each measured-move target is tracked as hit or unhit in the dashboard.
◆ WHAT YOU SEE
• A precision opening-range box with high/low rails and optional midline
• Measured-move target rails at ±0.5R / ±1R / ±1.5R
• Minimal breakout stamps and retest diamonds — no arrow spam
• A resizable command dashboard with breakout status, OR high/low with intact-or-broken state, range height, range-versus-ATR quality (tight / normal / wide), which targets have printed, and retest status
◆ HOW TO USE IT
• Set the session window to match your instrument and desired ORB length (e.g. 0930-1000 for a 30-minute range).
• A wide range vs. ATR often signals a more energetic session; a tight range warns breakouts may be prone to failure.
• Use the ±R target rails as objective, pre-defined profit references and the opposite range edge as a natural invalidation.
• Designed for intraday timeframes . On daily and higher charts the session concept does not apply, and the dashboard will say so.
◆ NOTES & LIMITATIONS
Use on standard candlestick charts and intraday timeframes. Opening-range breakouts fail as well as follow through — the tool maps structure and targets, it is not financial advice and cannot guarantee a break will run. Combine it with your own analysis and risk management.
— made with passion by officialjackofalltrade
Indicator

Top Dog Energy Matrix Trading System// =============================================================================
// TOP DOG ENERGY MATRIX - TABLE GUIDE & METHODOLOGY
// =============================================================================
// Summarizes the Top Dog energies (Barry Burns method) across 5 timeframes at
// once: 1D / 4H / 1H / 15m / 5m. Each ROW is a timeframe and computes its own
// indicators in its own timeframe.
// READ IT: top -> bottom (slow/dominant -> fast/execution)
// left -> right (cycle -> entry signal)
// =============================================================================
//
// -----------------------------------------------------------------------------
// 1. COLUMNS (what each one means)
// -----------------------------------------------------------------------------
// TF Timeframe of the row (1D/4H/1H/15m/5m). Top rules: 1D & 4H set
// the bias, 1H & 15m fine-tune, 5m executes.
//
// Ciclos Cycle count within the trend: "previous / new" (e.g. 5 / 2).
// +1 each time %D crosses the 50 level. Resets to 0 when trend
// flips (15EMA vs 50SMA), saving the prior count.
// 1-2 = early (trade zone). 5-7 = extended (caution, near end).
// Teal bg = %D rising, red = falling.
//
// C.M "Cycle Momentum": live %D value vs 50 + direction (U/D/=).
// e.g. "62 U". Read the trajectory (50->55->60 = rising).
// Blue if %D>50, yellow at 50, red if <50.
//
// Momentum Momentum (MACD/MOM) direction: UP / DOWN / PLANO.
// PLANO = histogram below 70% of its own average.
// UP=teal (bullish), DOWN=red (bearish), PLANO=gray (no energy).
//
// ATR Relative volatility vs its own 50-bar avg: ALTA/NORM/BAJA.
// ALTA(orange)=big candles, more risk+range. BAJA(faint blue)=
// tight market. NORM(gray)=normal.
//
// Vol Volume vs its own 50-bar avg: ALTA/NORM/BAJA (same colors as
// ATR). ALTA=conviction behind the move. BAJA=few participating
// (suspicious, more likely to fail).
//
// Divergencias Stochastic divergence in that TF: direction + strength.
// UP FUERTE (solid lime) = %K AND %D diverge = most reliable.
// UP debil (faint lime) = %K only = early.
// DN debil (faint red) = bearish %K only.
// DN FUERTE (solid red) = bearish %K AND %D.
// "-" (gray) = none. UP=possible bottom, DN=possible top.
//
// Trend/ADX Trend (15EMA vs 50SMA): ALCISTA/BAJISTA + ADX value beside it
// (e.g. "ALCISTA 32"). Teal=bull, red=bear. ADX = STRENGTH only
// (>25 solid, <20 weak/ranging), NOT direction.
//
// Estado Do cycle & momentum of that TF agree?
// ALINEADO(green)=yes, onside. MIXTO(orange)=disagree.
// PLANO(gray)=no momentum.
//
// Gatillo Entry signal - only meaningful on the 5m row.
// ARMADO = hook fired, waiting for the break.
// LONG/SHORT (teal/red) = fired with 15m aligned.
// DEBIL (blue) = fired but 15m not backing it = lower quality.
// "-" = nothing.
//
// -----------------------------------------------------------------------------
// 2. COLORS AT A GLANCE (background tells you the state)
// -----------------------------------------------------------------------------
// Green/Teal bullish / TF aligned / LONG
// Red bearish / SHORT / strong bearish divergence
// Blue C.M %D>50 | Gatillo DEBIL
// Orange ATR/Vol ALTA | Estado MIXTO
// Yellow C.M right at 50 (decision zone)
// Faint gray neutral: NORM / PLANO / no signal
// (ATR and Vol share identical colors: same state = same color.)
//
// -----------------------------------------------------------------------------
// 3. METHODOLOGY (step by step)
// -----------------------------------------------------------------------------
// GOLDEN RULE: the higher timeframe rules. Never trade against 1D/4H just
// because the 5m looks good. This table is a CONFLUENCE MAP - it tells you
// WHETHER to trade, in WHICH direction, and if it's a good MOMENT.
//
// Step 1 BIAS (1D & 4H): read Trend/ADX + Estado. Both ALCISTA/ALINEADO ->
// longs only. Both BAJISTA -> shorts only. Contradicting or ADX<20 ->
// weak bias, wait. Lower TFs do NOT change this direction.
//
// Step 2 NOT LATE? (Ciclos on 1H & 4H): count 1-2 = early = ideal.
// Count 5-7 = extended -> caution, Indicator

SMCNexusTradePlanCoreV2SMCNexusTradePlanCoreV2 is an open-source, non-visual Pine Script library for deterministic candidate-plan geometry.
The library receives already-detected market facts from an importing indicator and resolves candidate Entry, protective Stop Loss, real target clusters, risk-to-reward values, confluence and fail-closed plan validity.
It does not scan the chart independently, predict future prices, generate guaranteed signals, place orders or fabricate missing levels. The importing indicator remains responsible for detecting and confirming market structure, zones, liquidity, pivots and other market facts.
ORIGINAL CONCEPT AND PURPOSE
The library converts confirmed analytical facts into auditable candidate-plan geometry using fixed source priorities and strict validation rules.
Every Entry, Stop Loss and target must originate from a real level supplied by the importing indicator. Missing or contradictory information remains unavailable instead of being replaced with a synthetic price.
ENTRY RESOLUTION
The candidate direction is derived from the primary bias supplied by the importing indicator.
For a BUY candidate, the Entry zone is selected from the first available source in this fixed order:
1. Bullish Order Block
2. Bullish Fair Value Gap
3. Discount half of the current dealing range
4. S1 pivot
For a SELL candidate, the fixed order is:
1. Bearish Order Block
2. Bearish Fair Value Gap
3. Premium half of the current dealing range
4. R1 pivot
The candidate Entry is the midpoint of the selected zone. A single-price pivot remains a single-price zone.
The library does not search for the best historical result and does not reorder sources according to later price movement.
STOP LOSS RESOLUTION
Stop Loss candidates are checked using a fixed protective hierarchy.
For BUY candidates, a valid Stop Loss must be below Entry. For SELL candidates, it must be above Entry.
The available candidates are checked in this order:
1. Opposite-side liquidity level
2. Direction-matching Order Block edge
3. Dealing-range edge
4. Directional pivot
A candidate located on the wrong side of Entry is skipped without changing the priority of the remaining sources.
If no supplied level is directionally valid, Stop Loss remains unavailable. The library never creates a Stop Loss from a fixed percentage or an arbitrary distance.
REAL TARGET SELECTION
Targets must be genuine levels supplied by the importing indicator.
Possible sources may include:
• liquidity pools,
• opposing Order Blocks,
• opposing Fair Value Gaps,
• confirmed swing levels,
• pivots,
• Premium, Discount or Equilibrium levels.
The importing indicator owns one bounded TargetCandidate array and decides which confirmed levels are eligible.
Each candidate contains:
• real price,
• source identifier,
• origin type,
• stable origin key,
• confirmation bar,
• direction,
• active state.
Candidates located on the wrong side of Entry are rejected. The origin used for Entry or Stop Loss can also be excluded from the target collection.
TARGET CLUSTERING
Several analytical sources may describe practically the same price area. The library groups nearby candidates into separate clusters using a caller-provided distance.
The distance can be calculated from ATR using clusterDistance(). ATR controls cluster separation only. It never creates, moves or estimates a target price.
The nearest real representative from the first separate cluster becomes TP1. The nearest representative outside the TP1 cluster becomes TP2. The nearest representative outside the first two clusters becomes TP3.
Every selected target is therefore an actual price supplied by the importing indicator.
STABLE ORIGIN KEYS
The library provides helpers for creating auditable source identities:
• zoneKey(...)
• liquidityKey(...)
• swingKey(...)
• pdKey(...)
• pivotKey(...)
These keys help the importing indicator identify duplicate sources and prevent the same analytical object from being reused incorrectly.
FINAL VALIDATION
The final resolver calculates:
• risk distance,
• reward to TP1, TP2 and TP3,
• RR1, RR2 and RR3,
• candidate order type,
• latest structural confirmation,
• directional confluence,
• final sanity status.
The geometry must satisfy all required conditions:
• Entry and Stop Loss are available,
• Stop Loss is on the protective side of Entry,
• targets are on the correct side of Entry,
• targets are ordered nearest-to-farthest,
• required target data is complete.
Invalid geometry returns a specific fail-closed status instead of displaying an apparently valid plan.
PUBLIC API
Typed records:
• EntryResult
• TargetCandidate
• TargetSelection
• FinalResult
Exported functions:
• resolveEntry(...)
• sameLevel(...)
• zoneKey(...)
• liquidityKey(...)
• swingKey(...)
• pdKey(...)
• pivotKey(...)
• addCandidate(...)
• selectTargets(...)
• clusterDistance(...)
• riskDistance(...)
• resolveFinal(...)
INTENDED USE
The importing indicator should:
1. Detect and confirm its own structure, zones, liquidity and pivots.
2. Pass the current facts to resolveEntry().
3. Add only genuine eligible levels to one bounded candidate array.
4. Call selectTargets() using an explicit cluster distance.
5. Pass Entry, Stop Loss, targets and contextual facts to resolveFinal().
6. Display a candidate only when the returned validity state permits it.
Conceptual example:
```pine
import AreXoN_/SMCNexusTradePlanCoreV2/1 as plan
plan.EntryResult entry = plan.resolveEntry(
primaryBias,
bullishObActive, bullishObHigh, bullishObLow,
bearishObActive, bearishObHigh, bearishObLow,
bullishFvgActive, bullishFvgHigh, bullishFvgLow,
bearishFvgActive, bearishFvgHigh, bearishFvgLow,
dealingRangeValid, dealingRangeHigh, dealingRangeLow,
equilibrium,
pivotS1Available, pivotS1,
pivotR1Available, pivotR1,
lastSsl, lastBsl)
array candidates =
array.new()
// Add only confirmed real levels detected by the importing indicator.
float distance = plan.clusterDistance(atrValue, 0.55)
plan.TargetSelection targets =
plan.selectTargets(
candidates,
entry.isBuy ? 1 : -1,
distance)
```
The example import path should be replaced with the exact path assigned by TradingView after publication.
WHY THE CHART IS CLEAN
This is a non-visual calculation library. It intentionally creates no plots, labels, tables, lines or boxes.
The publication chart is therefore intentionally clean and contains no additional indicators, drawings or unexplained visual elements. Visual presentation is the responsibility of an importing indicator.
LIMITATIONS
• The result depends entirely on the confirmed facts supplied by the importing indicator.
• It is a mechanical analytical candidate, not a recommendation.
• It cannot verify live spread, slippage, broker StopLevel or execution rules.
• It does not provide native bid/ask order flow.
• It does not place, modify or close orders.
• Missing real levels produce an incomplete result by design.
• Risk-to-reward values describe supplied geometry and do not predict outcome.
• It produces no chart output by itself.
This library is an analytical and software-development component. It is not investment advice, a trading recommendation or an automated trading system. Library

SMCNexusConfigurationCoreV2SMCNexusConfigurationCoreV2 is an open-source, non-visual Pine Script library for resolving deterministic indicator configuration profiles and bounded visibility settings.
The library separates pure configuration decisions from market detection, chart state and presentation code. It does not generate signals, place orders or draw objects.
The importing indicator supplies its saved manual settings, chart timeframe and supported-symbol state. The library returns typed effective configuration records without calling input functions, requesting external timeframes or changing the importing script's saved settings.
ORIGINAL CONCEPT AND PURPOSE
The library implements three explicit configuration modes:
• MANUAL — preserves every value supplied by the importing indicator.
• AUTO — applies an exact predefined profile only when the supplied symbol and timeframe combination is explicitly supported.
• HYBRID — applies automatic values only to individually selected categories while preserving manual values for all other categories.
The implementation does not use nearest-timeframe guessing. An unsupported symbol or timeframe falls back to the supplied manual settings.
Detection parameters and visual settings are resolved separately. This prevents a visibility option from unintentionally disabling the underlying analytical calculation. For example, hiding a market-structure label does not remove the structure state used elsewhere by the importing indicator.
SUPPORTED PROFILE CONTEXT
The profile resolver distinguishes exact chart timeframes:
• M1
• M5
• M15
• M30
• H1
• H4
• D1
• W1
The importing indicator decides whether the current symbol is supported. If the symbol or timeframe is unsupported, the automatic profile is not applied.
CONFIGURATION CATEGORIES
The resolved configuration includes separate categories for:
• swing structure,
• Market Structure Shift requirements,
• Fair Value Gap parameters,
• Order Block parameters,
• liquidity and sweep parameters,
• volume-profile range settings,
• structure visibility,
• zone visibility,
• liquidity and Premium/Discount visibility,
• EMA, pivot and volume-marker visibility,
• panel and Trade Plan visibility,
• trendline and volume-profile visibility.
ADAPTIVE GRID RESOLUTION
The library also contains a bounded adaptive-grid resolver for importing scripts that build a volume-profile approximation.
The resolver receives:
• the manual tick floor,
• the instrument minimum tick,
• the current range low and high,
• the requested target number of bins.
It calculates:
• whether the result is valid,
• effective ticks per bin,
• effective bin size,
• maximum permitted span,
• actual span in ticks,
• applied scale.
The effective tick step is never lower than the supplied manual floor. The resolver increases the step using a power-of-two scale when the requested price span would exceed the bounded target. Invalid or incomplete inputs return an unavailable result instead of an invented value.
PUBLIC API
Typed result records:
• ProfileContext
• CoreConfiguration
• StructureVisibility
• ZoneVisibility
• ContextVisibility
• OverlayVisibility
• PanelVisibility
• AuxiliaryVisibility
• AdaptiveGridResolution
Exported resolvers:
• resolveAdaptiveGrid(...)
• resolveProfileContext(...)
• resolveCoreConfiguration(...)
• resolveStructureVisibility(...)
• resolveZoneVisibility(...)
• resolveContextVisibility(...)
• resolveOverlayVisibility(...)
• resolvePanelVisibility(...)
• resolveAuxiliaryVisibility(...)
INTENDED USE
An importing indicator first creates a ProfileContext. It then passes that context together with its saved manual settings to the required resolver.
Conceptual example:
```pine
import AreXoN_/SMCNexusConfigurationCoreV2/1 as config
config.ProfileContext profile = config.resolveProfileContext(
configurationMode,
supportedSymbol,
timeframe.period,
autoStructure,
autoMss,
autoFvg,
autoOb,
autoLiquidity,
autoVolumeProfile,
autoVisibility)
config.CoreConfiguration effective = config.resolveCoreConfiguration(
profile,
manualSwingLeft,
manualSwingRight,
manualRequireCloseBreak,
manualRequireOppositeBias,
manualRequireDisplacement,
manualDisplacementAtr,
manualFvgCount,
manualFvgAtrFilter,
manualFvgAtrSize,
manualObCount,
manualObLookback,
manualObStructureRequirement,
manualObBodyMode,
manualLiquidityLookback,
manualEqualLevelTolerance,
manualSweepCloseBack,
manualProfileMode,
manualProfileBars)
```
The example import path should be replaced with the exact path assigned by TradingView after publication.
WHY THE CHART IS CLEAN
This is a non-visual configuration library. It intentionally creates no plots, labels, tables, lines or boxes.
The publication chart is therefore intentionally clean and contains no additional indicators, drawings or unexplained visual elements. An importing indicator is responsible for presenting the resolved settings.
LIMITATIONS
• Automatic profiles are applied only to exact supported combinations.
• The library does not optimize settings or claim that a profile is profitable.
• It does not independently inspect a symbol or identify a broker feed.
• It does not read live market data.
• It does not preserve state between executions.
• It does not place, modify or close orders.
• It produces no chart output by itself.
This library is a reusable software-development component. It is not investment advice, a trading signal or an automated trading system. Library

SMCNexusScoringCoreV2SMCNexusScoringCoreV2 is an open-source, non-visual Pine Script library that calculates a deterministic Smart Money Concepts evidence score from market facts supplied by an importing indicator.
The library does not independently read chart state, request other timeframes, generate trading signals, place orders or draw chart objects. Its purpose is to separate the scoring calculation from detection and presentation code, making every component reusable and independently auditable.
ORIGINAL CONCEPT AND PURPOSE
The library combines twelve bounded Smart Money Concepts evidence components into one normalized 0–100 result while retaining each individual component in the returned ScoreResult record.
It also provides optional event-age decay for selected structural evidence. This prevents an old BOS, CHoCH, MSS or liquidity sweep from retaining the same influence indefinitely.
The importing indicator is responsible for detecting and confirming market events. This library receives those facts through typed parameters and performs deterministic calculations only. It does not infer missing events or substitute unknown data.
CALCULATION METHOD
The twelve components are:
1. Market Structure Shift
2. Break of Structure
3. Change of Character
4. Fair Value Gap
5. Order Block
6. Liquidity context
7. Liquidity sweep
8. Premium or Discount location
9. Volume state
10. Momentum state
11. Local Smart Money context
12. Primary trend
Each component contributes a bounded value based on the supplied state. The component total is divided by twelve and normalized to a value from 0 to 100.
The resulting descriptive classes are:
• VERY WEAK
• WEAK
• NEUTRAL
• STRONG
• ELITE
These classes describe the supplied analytical evidence. They are not trading recommendations and do not predict future performance.
AGE DECAY
When age decay is enabled, the selected structural and sweep components use a linear age factor.
The factor:
• remains at 1.0 until the configured full-strength age,
• decreases linearly between the full-strength and zero-strength ages,
• reaches 0.0 at or beyond the configured zero-strength age.
If the supplied age window is invalid, the calculation fails safely to full strength instead of producing a negative or undefined weight.
PUBLIC API
ScoreResult
The returned record contains:
• all twelve effective components,
• effective MSS age factor,
• effective BOS/CHoCH age factor,
• effective sweep age factor,
• component total,
• normalized score,
• descriptive class,
• compact text representation.
calculate(...)
This function accepts typed, confirmed market facts and returns one ScoreResult record.
INTENDED USE
An importing indicator should:
1. Detect and confirm its own market-structure events.
2. Determine its current FVG, Order Block, liquidity, volume, momentum and trend states.
3. Pass those facts to calculate().
4. Read the normalized result or inspect the individual returned components for a complete breakdown.
Conceptual example:
```pine
import AreXoN_/SMCNexusScoringCoreV2/1 as scoring
scoring.ScoreResult result = scoring.calculate(
scoringEnabled,
ageDecayEnabled,
bar_index,
lastMssBar,
lastBreakBar,
lastSweepBar,
structureFullStrengthBars,
structureZeroStrengthBars,
sweepFullStrengthBars,
sweepZeroStrengthBars,
mssDirection,
breakType,
breakDirection,
fvgType,
fvgMitigated,
obType,
obMitigated,
liquidityContext,
sweepType,
premiumDiscountZone,
volumeState,
momentumState,
smartMoneyState,
primaryTrendState)
```
The example import path should be replaced with the exact path assigned by TradingView after publication.
WHY THE CHART IS CLEAN
This is a non-visual calculation library. It intentionally creates no plots, labels, tables, lines or boxes. Visual output is the responsibility of an importing indicator.
The publication chart is therefore intentionally clean and contains no additional indicators or unexplained drawings.
LIMITATIONS
• Output quality depends on the facts supplied by the importing indicator.
• The library does not independently verify market events.
• It does not provide native bid/ask order flow or broker execution data.
• It does not account for spread, slippage or broker restrictions.
• It does not place, modify or close orders.
• It produces no chart output by itself.
• A score or class is not a guarantee of future market behavior.
This library is an analytical and software-development component. It is not investment advice or an automated trading system. Library

HTF Time Markers [twr]HTF Time Markers
This indicator plots higher-timeframe (HTF) period boundaries directly on your current chart, giving you a clean visual reference for where each new HTF candle begins — without needing to switch charts or add a separate HTF overlay.
Key Features
Auto Timeframe Detection — Automatically selects an appropriate HTF based on your current chart resolution (e.g. 5m chart → 15m markers, 1H chart → 4H markers), or set a manual timeframe if you prefer full control.
Two Display Modes
Full Height — draws a vertical line stretching across the entire chart at the start of each new HTF period.
Session Range — draws a live-updating box confined to the actual high/low range of the developing HTF candle, expanding in real time as the period forms.
HTF Open Price Line — Plots a horizontal line at the open price of each HTF candle, independent of the vertical marker settings. Choose how it extends:
Until Next Period — stops automatically where the next HTF candle begins.
Full Right — extends indefinitely into future bars.
Full Chart — extends across the entire chart in both directions.
Useful as a quick reference for whether price is trading above or below the current HTF open — a key reference level in many ICT/SMC frameworks.
Smart Timestamp Labels — Each vertical marker is labeled with contextual text that adapts to the timeframe:
Sub-weekly HTFs show time and weekday (e.g. "09:30 / Monday"), or weekday-only if preferred.
Weekly HTFs show the week-of-month (e.g. "Week 2").
Monthly, Quarterly, and Yearly HTFs show calendar-relative labels (month name, quarter number, or year) instead of a redundant time stamp, since higher-timeframe opens always land on the same weekday/time.
Timezone Control — Labels are calculated using a selectable timezone (default America/New_York), so your markers align with the session times your strategy is actually built around, rather than the raw exchange timezone.
Full Styling Control — Independently adjust color, width, and style (solid, dotted, dashed) for both the vertical markers and the open line, plus label size and a configurable cap on how many historical markers/lines are kept on the chart.
How It Works
The indicator tracks the start of each new HTF bar using request.security and draws a vertical marker at that boundary. In Session Range mode, the box continues updating its top/bottom/right edges on every bar until the HTF period closes, giving you a live read on the developing range. At the same time, an independent open-price line is plotted at the HTF candle's opening price and extended according to your chosen mode. Older markers and lines are automatically pruned once you exceed your configured maximums, keeping the chart uncluttered.
Use Case
Useful for traders who reference higher-timeframe context (e.g. 4H, Daily, Weekly opens) while executing on a lower timeframe, and want both a visual cue for where each HTF candle starts and a persistent open-price reference level — without constantly toggling chart resolutions. Indicator

Custom ORB, Premarket & EMAs// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org
//@version=6
indicator("Custom ORB, Premarket & EMAs", overlay = true, max_lines_count = 100, max_labels_count = 100, max_bars_back = 5000)
// --- Groups ---
var string G_PRE = "Premarket Settings"
var string G_PD = "Previous Day Levels"
var string G_2OR = "2m Opening Range Settings"
var string G_5OR = "5m Opening Range Settings"
var string G_15OR = "15m Opening Range Settings"
var string G_EMA = "EMA Settings"
var string G_VWAP = "VWAP Settings"
var string G_SIG = "Signal Visuals"
// --- Inputs ---
pmColor = input.color(color.gray, "Premarket Color", group = G_PRE, tooltip = "Color used for the premarket high and low levels.")
pmStyle = input.string("Dashed", "Premarket Style", options = , group = G_PRE, tooltip = "Line style used for the premarket levels.")
pmWidth = input.int(1, "Premarket Line Width", minval = 1, maxval = 10, group = G_PRE, tooltip = "Width of the premarket high and low lines.")
pmSession = input.session("0400-0930", "Premarket Session", group = G_PRE, tooltip = "Exchange-time session used to calculate the premarket range.")
showPd = input.bool(true, "Show PDH/PDL", group = G_PD, tooltip = "Display the confirmed previous trading day's high and low.")
pdhColor = input.color(#5b9cf6, "PDH Color", group = G_PD, tooltip = "Color used for the previous day high level.")
pdlColor = input.color(#f23645, "PDL Color", group = G_PD, tooltip = "Color used for the previous day low level.")
pdStyle = input.string("Dotted", "PDH/PDL Style", options = , group = G_PD, tooltip = "Line style used for the previous day high and low levels.")
pdWidth = input.int(1, "PDH/PDL Line Width", minval = 1, maxval = 10, group = G_PD, tooltip = "Width of the previous day high and low lines.")
showOr2 = input.bool(true, "Show 2m ORB", group = G_2OR, tooltip = "Display the 2-minute opening range high and low.")
or2Color = input.color(#5b9cf6, "2m OR Color", group = G_2OR, tooltip = "Color used for the 2-minute opening range.")
or2Style = input.string("Solid", "2m OR Style", options = , group = G_2OR, tooltip = "Line style used for the 2-minute opening range.")
or2Width = input.int(1, "2m OR Line Width", minval = 1, maxval = 10, group = G_2OR, tooltip = "Width of the 2-minute opening range lines.")
or2Time = input.string("0930-0932", "2m OR Time", group = G_2OR, tooltip = "Exchange-time session used to calculate the 2-minute opening range.")
showOr5 = input.bool(true, "Show 5m ORB", group = G_5OR, tooltip = "Display the 5-minute opening range high and low.")
or5Color = input.color(#089981, "5m OR Color", group = G_5OR, tooltip = "Color used for the 5-minute opening range.")
or5Style = input.string("Solid", "5m OR Style", options = , group = G_5OR, tooltip = "Line style used for the 5-minute opening range.")
or5Width = input.int(1, "5m OR Line Width", minval = 1, maxval = 10, group = G_5OR, tooltip = "Width of the 5-minute opening range lines.")
or5Time = input.string("0930-0935", "5m OR Time", group = G_5OR, tooltip = "Exchange-time session used to calculate the 5-minute opening range.")
showOr15 = input.bool(true, "Show 15m ORB", group = G_15OR, tooltip = "Display the 15-minute opening range high and low.")
or15Color = input.color(#f23645, "15m OR Color", group = G_15OR, tooltip = "Color used for the 15-minute opening range.")
or15Style = input.string("Solid", "15m OR Style", options = , group = G_15OR, tooltip = "Line style used for the 15-minute opening range.")
or15Width = input.int(1, "15m OR Line Width", minval = 1, maxval = 10, group = G_15OR, tooltip = "Width of the 15-minute opening range lines.")
or15Time = input.string("0930-0945", "15m OR Time", group = G_15OR, tooltip = "Exchange-time session used to calculate the 15-minute opening range.")
emaFastLength = input.int(9, "Fast EMA Length", minval = 1, group = G_EMA, tooltip = "Period used to calculate the fast EMA.")
emaSlowLength = input.int(20, "Slow EMA Length", minval = 1, group = G_EMA, tooltip = "Period used to calculate the slow EMA.")
ema9Color = input.color(#5b9cf6, "Fast EMA Color", group = G_EMA, tooltip = "Color used for the fast EMA.")
ema20Color = input.color(#f23645, "Slow EMA Color", group = G_EMA, tooltip = "Color used for the slow EMA.")
showVwap = input.bool(true, "Show VWAP", group = G_VWAP, tooltip = "Display the volume-weighted average price.")
vwapColor = input.color(color.orange, "VWAP Color", group = G_VWAP, tooltip = "Color used for VWAP.")
showShapes = input.bool(true, "Show Buy/Sell Triangles", group = G_SIG, tooltip = "Display triangles when tracked levels break during regular session.")
// --- Helper: Get Line Style ---
getLineStyle(styleStr) =>
switch styleStr
"Solid" => line.style_solid
"Dotted" => line.style_dotted
"Dashed" => line.style_dashed
=> line.style_solid
// --- Logic ---
inSession(sess) => not na(time(timeframe.period, sess))
isNewDay = ta.change(time("D")) != 0
// EMAs, VWAP & Previous Day Levels
ema9 = ta.ema(close, emaFastLength)
ema20 = ta.ema(close, emaSlowLength)
vwapVal = ta.vwap(hlc3)
pdhVal = request.security(syminfo.tickerid, "D", high , lookahead = barmerge.lookahead_on)
pdlVal = request.security(syminfo.tickerid, "D", low , lookahead = barmerge.lookahead_on)
plot(ema9, "Fast EMA", color = ema9Color, linewidth = 1)
plot(ema20, "Slow EMA", color = ema20Color, linewidth = 1)
plot(showVwap ? vwapVal : na, "VWAP", color = vwapColor, linewidth = 2)
// --- Trackers ---
var float pmH = na
var float pmL = na
var int pmStartIdx = na
var float or2H = na
var float or2L = na
var int or2StartIdx = na
var float or5H = na
var float or5L = na
var int or5StartIdx = na
var float or15H = na
var float or15L = na
var int or15StartIdx = na
var int dayStartIdx = na
// --- Reset & Start Index Capture ---
if na(dayStartIdx) or isNewDay
dayStartIdx := bar_index
if isNewDay
pmH := na
pmL := na
pmStartIdx := na
or2H := na
or2L := na
or2StartIdx := na
or5H := na
or5L := na
or5StartIdx := na
or15H := na
or15L := na
or15StartIdx := na
if inSession(pmSession)
if na(pmStartIdx)
pmStartIdx := bar_index
pmH := math.max(high, nz(pmH, high))
pmL := math.min(low, nz(pmL, low))
if inSession(or2Time)
if na(or2StartIdx)
or2StartIdx := bar_index
or2H := math.max(high, nz(or2H, high))
or2L := math.min(low, nz(or2L, low))
if inSession(or5Time)
if na(or5StartIdx)
or5StartIdx := bar_index
or5H := math.max(high, nz(or5H, high))
or5L := math.min(low, nz(or5L, low))
if inSession(or15Time)
if na(or15StartIdx)
or15StartIdx := bar_index
or15H := math.max(high, nz(or15H, high))
or15L := math.min(low, nz(or15L, low))
// --- Visuals: Current Session Only Redraw ---
var line lines = array.new_line()
var label labels = array.new_label()
if barstate.islast
for l in lines
line.delete(l)
for lb in labels
label.delete(lb)
array.clear(lines)
array.clear(labels)
// Stagger the label x-positions to prevent overlapping if levels share the same price.
int pdIdx = bar_index + 2
int pmIdx = bar_index + 6
int or2Idx = bar_index + 10
int or5Idx = bar_index + 14
int or15Idx = bar_index + 18
// Previous day high and low.
if showPd and not na(pdhVal) and not na(pdlVal) and not na(dayStartIdx)
array.push(lines, line.new(dayStartIdx, pdhVal, bar_index, pdhVal, color = pdhColor, style = getLineStyle(pdStyle), width = pdWidth))
array.push(lines, line.new(dayStartIdx, pdlVal, bar_index, pdlVal, color = pdlColor, style = getLineStyle(pdStyle), width = pdWidth))
array.push(labels, label.new(pdIdx, pdhVal, "PDH", color = #00000000, textcolor = pdhColor, style = label.style_label_left, size = size.small))
array.push(labels, label.new(pdIdx, pdlVal, "PDL", color = #00000000, textcolor = pdlColor, style = label.style_label_left, size = size.small))
// Premarket.
if not na(pmH) and not na(pmStartIdx)
array.push(lines, line.new(pmStartIdx, pmH, bar_index, pmH, color = pmColor, style = getLineStyle(pmStyle), width = pmWidth))
array.push(lines, line.new(pmStartIdx, pmL, bar_index, pmL, color = pmColor, style = getLineStyle(pmStyle), width = pmWidth))
array.push(labels, label.new(pmIdx, pmH, "PM High", color = #00000000, textcolor = pmColor, style = label.style_label_left, size = size.small))
array.push(labels, label.new(pmIdx, pmL, "PM Low", color = #00000000, textcolor = pmColor, style = label.style_label_left, size = size.small))
// 2m ORB.
if showOr2 and not na(or2H) and not na(or2StartIdx) and not inSession(or2Time)
array.push(lines, line.new(or2StartIdx, or2H, bar_index, or2H, color = or2Color, style = getLineStyle(or2Style), width = or2Width))
array.push(lines, line.new(or2StartIdx, or2L, bar_index, or2L, color = or2Color, style = getLineStyle(or2Style), width = or2Width))
array.push(labels, label.new(or2Idx, or2H, "2m OR High", color = #00000000, textcolor = or2Color, style = label.style_label_left, size = size.small))
array.push(labels, label.new(or2Idx, or2L, "2m OR Low", color = #00000000, textcolor = or2Color, style = label.style_label_left, size = size.small))
// 5m ORB.
if showOr5 and not na(or5H) and not na(or5StartIdx) and not inSession(or5Time)
array.push(lines, line.new(or5StartIdx, or5H, bar_index, or5H, color = or5Color, style = getLineStyle(or5Style), width = or5Width))
array.push(lines, line.new(or5StartIdx, or5L, bar_index, or5L, color = or5Color, style = getLineStyle(or5Style), width = or5Width))
array.push(labels, label.new(or5Idx, or5H, "5m OR High", color = #00000000, textcolor = or5Color, style = label.style_label_left, size = size.small))
array.push(labels, label.new(or5Idx, or5L, "5m OR Low", color = #00000000, textcolor = or5Color, style = label.style_label_left, size = size.small))
// 15m ORB.
if showOr15 and not na(or15H) and not na(or15StartIdx) and not inSession(or15Time)
array.push(lines, line.new(or15StartIdx, or15H, bar_index, or15H, color = or15Color, style = getLineStyle(or15Style), width = or15Width))
array.push(lines, line.new(or15StartIdx, or15L, bar_index, or15L, color = or15Color, style = getLineStyle(or15Style), width = or15Width))
array.push(labels, label.new(or15Idx, or15H, "15m OR High", color = #00000000, textcolor = or15Color, style = label.style_label_left, size = size.small))
array.push(labels, label.new(or15Idx, or15L, "15m OR Low", color = #00000000, textcolor = or15Color, style = label.style_label_left, size = size.small))
// --- Signal Logic & Alerts ---
isRegularSession = inSession("0930-1600")
// Track crossovers on all bars to avoid conditional evaluation warnings.
crossUpPM = ta.crossover(close, pmH)
crossDnPM = ta.crossunder(close, pmL)
crossUpOR2 = ta.crossover(close, or2H)
crossDnOR2 = ta.crossunder(close, or2L)
crossUpOR5 = ta.crossover(close, or5H)
crossDnOR5 = ta.crossunder(close, or5L)
crossUpOR15 = ta.crossover(close, or15H)
crossDnOR15 = ta.crossunder(close, or15L)
// Individual breakout booleans.
pmBreakUp = isRegularSession and not inSession(pmSession) and crossUpPM
pmBreakDn = isRegularSession and not inSession(pmSession) and crossDnPM
or2BreakUp = showOr2 and isRegularSession and not inSession(or2Time) and crossUpOR2
or2BreakDn = showOr2 and isRegularSession and not inSession(or2Time) and crossDnOR2
or5BreakUp = showOr5 and isRegularSession and not inSession(or5Time) and crossUpOR5
or5BreakDn = showOr5 and isRegularSession and not inSession(or5Time) and crossDnOR5
or15BreakUp = showOr15 and isRegularSession and not inSession(or15Time) and crossUpOR15
or15BreakDn = showOr15 and isRegularSession and not inSession(or15Time) and crossDnOR15
// Master buy/sell signal.
buySignal = pmBreakUp or or2BreakUp or or5BreakUp or or15BreakUp
sellSignal = pmBreakDn or or2BreakDn or or5BreakDn or or15BreakDn
// Visual signals.
plotshape(showShapes and buySignal, "Buy Breakout", shape.triangleup, location.belowbar, #089981, size = size.small)
plotshape(showShapes and sellSignal, "Sell Breakdown", shape.triangledown, location.abovebar, #f23645, size = size.small)
// Alert triggers.
if buySignal
alert("Level Breakout: Buy Signal", alert.freq_once_per_bar)
if sellSignal
alert("Level Breakdown: Sell Signal", alert.freq_once_per_bar)
Indicator

Indicator

Indicator

Indicator

Reticle - Structural Reversal GridWhy This Works
Financial markets rarely move in uninterrupted straight lines. Asset prices expand in directional vectors, exhaust themselves, and retrace back toward their origins to trap counter-trend traders before continuing. Reticle is designed to map this structural reality geometrically.
Most traders rely on static, horizontal support and resistance levels. The Reticle engine relies on the mathematical squaring of time and price. By anchoring a vector to a verified structural leg (A to B), the script projects a dynamic diagonal trend floor (the "Death Line") and mathematically subdivides the entire move. Furthermore, historical testing across crypto and legacy markets consistently demonstrates that the 50% to 62.5% retracement band is the highest-probability zone for trend continuation to occur following a structural push.
How This Works
Reticle operates as a dual-engine geometric tracker:
The Anchoring Engine: It auto-detects the dominant macro swing (highest high and lowest low over a specified lookback period) to find the current active leg in the market. It marks the start of the move as Anchor A and the climax as Anchor B.
The Geometry Engine: Once A and B are locked, it draws an 8x8 fractional lattice to subdivide the zone, extends a golden Exhaustion Box highlighting the 50–62.5% retracement levels, and calculates the true geometric "Death Line." The slope of this line dynamically adjusts to the actual ratio of the move, preventing the distortion that usually ruins diagonal trendlines across varying chart scales.
How to Use Reticle
The primary utility of this script is finding high-confluence continuation entries and identifying exact structural invalidation points.
1. Finding Entries in the Exhaustion Zone
Wait for an impulsive move to define Anchors A and B. As the price pulls back from B, watch for it to enter the golden 50–62.5% Exhaustion Box. This is your strike zone. You want to see the price wick into this box and print a strong rejection candle that closes back outside of it. The box dynamically flares red the deeper price pushes into it, visually highlighting peak tension.
2. Managing the Trade via the Death Line
The red diagonal Death Line originating from Anchor A acts as the ultimate structural invalidation. It rises in tandem with time. If the asset respects its market geometry, it should bounce out of the Exhaustion Box and remain on the "safe" side of the Death Line.
3. Trading the Break
If a candle cleanly closes across the Death Line (marked on the chart by a red ✕), the geometric structure of that leg is broken. If you are in a trend-continuation trade, this is your hard exit signal. Conversely, advanced traders can use this Death Line break as an entry trigger to play the structural reversal.
Settings Guide
Every chart and asset breathes differently. Use these settings to perfectly calibrate Reticle to your chosen instrument.
Anchor Mode & MTF
Auto Anchors: Leave this checked to let the script find the A and B swing points automatically. Unchecking it disables the script until you define manual time anchors.
Use Higher Timeframe (MTF) Swings: A powerful feature that allows you to calculate the dominant A→B swing on a macro timeframe (like the Daily) while executing your trades on a lower timeframe (like a 40-minute chart) without losing the structural geometry.
Auto Engine: Choose between "Dominant Swing" (finds the absolute high and low of the lookback window) or "Latest Pivots" (strictly grabs the last two confirmed pivot points).
Dominant Swing Lookback / Pivot Strengths: Adjusts how many bars the script scans to define a swing. Increase these numbers to track massive macro trends; decrease them to trade rapid intraday micro-structures.
Engine Parameters & Squaring
Death Line Slope Basis: Dictates the math behind the red invalidation line.
Auto (A→B Ratio): Recommended. The slope perfectly mirrors the steepness of the structural push.
Squaring Factor: Forces the line to rise by a fixed, absolute price amount per bar, achieving true Gann-style 1x1 squaring.
True Squaring (Price Units per Bar): Active only if "Squaring Factor" is chosen above. Input exactly how many dollars/cents the line should rise per bar (e.g., 100 means a $100 climb per candle).
Death Line Angle ×: Multiplies the final slope. 0.5 acts as a 1x2 support line hugging price action. 1.0 acts as a steep 1x1.
Exhaustion Band Forward Extension: Determines how many bars into the future the golden retracement box is drawn.
Toggle Visuals: Checkboxes to hide or show the Lattice, the Band, the Death Line, and the A→B Vector Spine to keep your chart uncluttered.
Alerts
Select exactly which structural events you want to be notified about. Reticle features a unified alert system that ensures signals are only fired on confirmed candle closes to avoid false wick triggers.
Format Alerts as JSON: Check this box if you are connecting the indicator to automated trading bots via webhooks. It outputs a clean, machine-readable data payload instead of standard text.
Status Table
Show Status Table: Toggles the HUD panel that provides live data readouts regarding the current vector size, slope settings, and the exact percentage distance between current price and the Death Line invalidation.
Position: Move the data panel to any corner of the chart to prevent it from covering active price action. Indicator

Alpha Forge Adaptive VWAP Wave v1.0.19Alpha Forge Adaptive VWAP Wave is a selective, long-side market-structure overlay designed specifically for standard 1-hour charts.
It combines an adaptive VWAP-based wave with confirmed multi-timeframe qualification to help distinguish between balanced conditions, directional expansion, and established trends. Rather than producing signals on every crossover, the indicator waits for its internal market profile and routing requirements to align.
HOW THE ROUTING WORKS
The indicator evaluates two possible routes:
• 1H PRIMARY — The setup qualifies directly from the 1-hour market structure.
• 4H QUALIFICATION / 1H EXECUTION — A completed 4-hour candle establishes the broader thesis while the actual entry remains timed and confirmed on the 1-hour chart.
The 1-hour route always receives priority. The 4-hour route is only considered when the primary route does not qualify.
If neither route meets the internal requirements, the dashboard displays NO QUALIFIED ROUTE. This is intentional and means the indicator is choosing to stand aside rather than force a setup.
SIGNAL MARKERS
• Cyan BUY — Confirmed 1-hour tactical entry.
• Purple 4H QUAL BUY — Confirmed 4-hour thesis with a 1-hour tactical entry.
• Pink EXIT — Confirmed tactical exit or protective trade-management event.
Signals are deliberately selective and will not appear on every symbol.
ADAPTIVE WAVE
The cyan and magenta wave provides a visual representation of the active VWAP structure and surrounding deviation zones.
The wave is designed to make changes in balance, direction, and structural support easier to identify without covering the underlying price action. Its width and position adapt to the market rather than remaining fixed to a single static distance.
DASHBOARD
The Alpha Forge dashboard provides a compact summary of the current operating state:
• STATUS — Whether the system is in a trade or standing aside.
• ROUTE — The timeframe path currently controlling the setup.
• PROFILE — The trade-management profile selected by the internal qualification process.
• REGIME — The detected market environment.
• SAMPLE — The amount of historical evidence available for the selected profile.
• POSITION — Current position state and active profile.
FORGE GUIDE
The Forge Guide translates the active system state into three practical sections:
• WAITING — What the system is currently waiting for.
• WATCH — The structure or protection currently being monitored.
• ACTION — The appropriate response for the present state.
The Guide is informational. It does not replace personal risk management or independent analysis.
RECOMMENDED USE
• Use standard candlesticks or bars.
• Use the 1-hour chart timeframe.
• Leave the source at its default HLC3 setting unless you are deliberately testing an alternative.
• The 4-hour analysis is handled internally; there is no need to change the chart to 4H.
• Wait for the candle to close before treating a marker as confirmed.
The indicator is primarily intended for liquid stocks and metals. It may also qualify selected forex markets, but it is deliberately selective and should not be expected to produce a route on every currency pair.
SIGNAL CONFIRMATION
BUY and EXIT events are confirmed only after the 1-hour chart candle closes.
The higher-timeframe route uses information from previously completed 4-hour candles. This prevents an unfinished 4-hour candle from being treated as confirmed evidence.
The live wave and dashboard may move while the current candle is forming. Final markers and alerts are only confirmed at candle close.
ALERTS
The script supports confirmed BUY and EXIT alerts.
For standard TradingView notifications, create alerts from the available BUY and EXIT conditions.
For dynamic webhook messages, select “Any alert() function call.” Create webhook alerts while the dashboard is FLAT whenever possible.
TradingView stores a snapshot of the script, chart, and settings when an alert is created. Alerts should therefore be recreated after changing the script, symbol, timeframe, or important inputs.
IMPORTANT QUALIFICATION NOTES
This is an indicator, not a TradingView strategy.
Its internal qualification process evaluates the historical information available on the loaded chart. Qualification can therefore vary with the symbol, market-data provider, and amount of chart history available.
The internal cost filter assumes 0.05% per side. It does not separately model spread, slippage, funding, swaps, or broker-specific commissions.
Historical qualification does not guarantee future performance. A qualified route identifies alignment with the model’s requirements; it is not a prediction or promise that a trade will be profitable.
Alpha Forge Adaptive VWAP Wave is intended as a market-structure and decision-support tool. It should be used alongside appropriate position sizing, risk controls, and independent analysis.
Indicator

fxberkantt old istek🇬🇧 English
ICT Killzones & Pivots plots the major ICT trading session (killzone) boxes — Asia, London, NY AM, NY Lunch, NY PM, and RTH — along with their high/low pivot lines, midpoints, hit-rate statistics, day/week/month levels, opening price lines, and custom timestamps.
This version restores the classic feature of displaying the session name directly inside each killzone box (e.g. "ASIA", "LNDN"), scaled and centered automatically as the box grows — just like the earlier release of this indicator. The session name, its text size, and its transparency can all be adjusted from the settings.
Original credit: © tradeforopp, licensed under MPL 2.0.
🇹🇷 Türkçe
ICT Killzones & Pivots , başlıca ICT işlem seanslarını (killzone) — Asya, Londra, NY Sabah, NY Öğle, NY Akşam ve RTH — kutu olarak çizer; bunlarla birlikte yüksek/düşük pivot çizgilerini, orta noktaları, isabet oranı istatistiklerini, gün/hafta/ay seviyelerini, açılış fiyat çizgilerini ve özel zaman damgalarını gösterir.
Bu sürüm, göstergenin eski versiyonundaki klasik özelliği geri getiriyor: seans isminin doğrudan killzone kutusunun içinde (örn. "ASIA", "LNDN") gösterilmesi. Yazı, kutu büyüdükçe otomatik olarak ortalanır. Seans isminin gösterilip gösterilmeyeceği, yazı boyutu ve şeffaflığı ayarlardan değiştirilebilir.
Orijinal hak sahibi: © tradeforopp, MPL 2.0 lisansı altında.
🇪🇸 Español
ICT Killzones & Pivots dibuja las principales sesiones de trading ICT (killzones) — Asia, Londres, NY AM, NY Lunch, NY PM y RTH — junto con sus líneas de pivote de máximo/mínimo, puntos medios, estadísticas de tasa de acierto, niveles diarios/semanales/mensuales, líneas de precio de apertura y marcas de tiempo personalizadas.
Esta versión recupera la función clásica de mostrar el nombre de la sesión directamente dentro de cada caja de killzone (ej. "ASIA", "LNDN"), centrado automáticamente a medida que la caja crece — tal como en la versión anterior de este indicador. El nombre de la sesión, su tamaño de texto y su transparencia se pueden ajustar desde la configuración.
Crédito original: © tradeforopp, bajo licencia MPL 2.0. Indicator

Indicator

Market Regime - Trend or RangeWHAT IT DOES
Market Regime — Trend or Range answers one question at a glance: is the current market TRENDING or RANGING? It combines three established, independent regime measures and requires a 2-of-3 majority vote before declaring a verdict, so a single noisy reading cannot flip the classification.
WHY THESE THREE COMPONENTS WORK TOGETHER
Each component measures a different aspect of market character, so their agreement is meaningful rather than redundant:
1) ADX (Wilder) measures directional strength. Vote: Trend above the ADX Trend Threshold (default 25), Range below the ADX Range Threshold (default 20), otherwise neutral.
2) Kaufman Efficiency Ratio measures how efficiently price travels: net change over the lookback divided by the sum of absolute bar-to-bar changes (default length 20). A high ratio means price moved directionally; a low ratio means it churned. Vote: Trend above 0.50, Range below 0.30.
3) Choppiness Index measures sideways versus directional behavior using the log ratio of summed true range to the total high-low range of the lookback (default length 14). Vote: Trend below 38.2, Range above 61.8.
The votes are summed into a score from -3 to +3. TREND requires +2 or more, RANGE requires -2 or less, anything else is MIXED. This 2-of-3 design is the purpose of the combination: ADX alone lags turns, the Efficiency Ratio alone is jumpy, and Choppiness alone ignores direction. Requiring agreement between at least two independent measures filters each one's weakness instead of merely displaying three indicators side by side. The script also derives a 0-100 strength meter by averaging normalized ADX, normalized Efficiency Ratio and inverted Choppiness.
WHAT APPEARS ON THE CHART
- Optional background tint: teal while TREND, orange while RANGE, none while MIXED.
- A dashboard table (corner selectable) showing the verdict, each component's current value with its own vote mark (up arrow = trend vote, down arrow = range vote, dot = neutral), the strength meter, the raw vote score, and a Playbook line that reads Trend tools, Fade tools, or Stand aside.
INPUTS AND DEFAULTS
ADX Length (14), ADX Trend Threshold (25), ADX Range Threshold (20), Efficiency Ratio Length (20), ER Trend Threshold (0.50), ER Range Threshold (0.30), Choppiness Length (14), plus visual toggles for the background tint and the dashboard position. Defaults are the classic reference values for each measure, not optimized settings.
HOW TO USE IT
Read it on your trading timeframe for the live regime, and optionally on a higher timeframe for the session's broader character. On TREND verdicts, continuation methods are generally more appropriate; on RANGE verdicts, mean-reversion and fade methods; on MIXED, caution or smaller size. It works on any symbol and timeframe and makes no claim of special performance on any market.
ALERTS
Two alert conditions are included and fire when the composite verdict changes: "Switched to TREND" and "Switched to RANGE".
BEHAVIOR AND LIMITATIONS
- All calculations run on the chart timeframe with no higher-timeframe requests, so nothing repaints from other timeframes. Values on the live bar update until that bar closes, then are fixed.
- A regime classifier describes current conditions. It does not predict future price and it is not a signal generator.
- Thresholds are configurable; changing them changes how strict each vote is.
This is an informational analysis tool for chart study, not financial advice. Past market behavior does not guarantee future results. Always apply your own risk management. Indicator

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 TradingView. 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 TradingView 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
TradingView 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

Target Trend ProEnhanced trend-following tool with automated entry signals, stop loss, three profit targets, filters, and live dashboard.
🎯 Target Trend Pro
An enhanced and expanded version of the original Target Trend concept by BigBeluga.
This indicator helps traders identify trend direction and manage trades visually with clear entry signals, stop loss, and three customizable take-profit levels — all displayed directly on the chart.
══════════════════════════════════════
🔵 KEY FEATURES
══════════════════════════════════════
• Adaptive SMA ± ATR bands for trend detection
• Automatic Long / Short entry triangles
• Three fixed Take Profit levels (ATR-based)
• Dynamic or fixed Stop Loss (with optional trailing)
• Live Dashboard showing:
- Entry, SL, TP1/TP2/TP3 with distance %
- Risk:Reward ratio
- ADX status
- Bars in trade
- Current trade status
• Filters:
- ADX Filter
- Higher Timeframe confirmation
- Volume Filter
• Clean visual management (lines, labels, fills)
• Full alert support (Entry + TP hits + SL hit)
══════════════════════════════════════
🔵 HOW IT WORKS
══════════════════════════════════════
1. Trend is detected when price crosses the adaptive SMA bands.
2. On a confirmed trend change, the indicator plots:
- Entry level
- Stop Loss
- Three Take Profit targets
3. Targets are calculated using ATR at the moment of the signal (fixed).
4. The dashboard updates in real time with trade progress.
5. Optional filters help reduce low-quality signals.
══════════════════════════════════════
🔵 SETTINGS OVERVIEW
══════════════════════════════════════
• Trend Length & ATR settings → Control sensitivity
• TP1 / TP2 / TP3 Multipliers → Customize target distances
• Trailing Stop → Optional dynamic stop loss
• ADX / HTF / Volume filters → Improve signal quality
• Display options → Dashboard position, line extension, etc.
══════════════════════════════════════
🔵 CREDITS
══════════════════════════════════════
Original concept: Target Trend by BigBeluga
This version is a heavily enhanced and expanded modification released for free under the same Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license.
Please keep credits if you share or modify this script.
══════════════════════════════════════
⚠️ DISCLAIMER
══════════════════════════════════════
This indicator is for educational and informational purposes only.
It does not constitute financial advice. Always do your own research and manage risk properly. Indicator

BABEL PRECISION BOTBABEL PRECISION BOT v2 — A+ EDITION is an advanced TradingView market-analysis indicator designed to identify high-confluence BUY and SELL opportunities rather than generating excessive signals.
It combines 50/200 EMA trend direction, higher-timeframe confirmation, RSI, ADX/DMI, volume expansion, market structure, BOS, CHOCH, liquidity sweeps, support and resistance, supply/demand zones, and automatic trend lines.
The indicator assigns an A+ setup score and only produces a BUY or SELL signal when enough conditions align. It also provides entry, Stop Loss, TP1, TP2 and TP3 levels using ATR-based risk management.
Indicator

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 TradingView. 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
