Perfect Trading Entry Exit FinderA trading entry/exit finder that searches retained structural swings for positive terminal-to-terminal opportunities, anchors each qualifying entry and exit to the actual retained terminal extremes, and preserves the corresponding causal confirmation for direct timing and opportunity comparison. Results are search and review outputs, not a guarantee of profitability or future performance.
Name:
Perfect Trading Entry Exit Finder
Searchable Name:
Perfect Trading Entry Exit Finder
Technical Name:
Retained Terminal-to-Terminal Perfect Entry Exit and Causal Confirmation Finder
Short title:
Perfect Entry Exit
Summary
Perfect Trading Entry Exit Finder is an experimental finder for locating complete retained terminal-to-terminal opportunities while preserving the corresponding causal signal timing for comparison.
The retrospective Perfect terminals are the completed ideal entry and exit endpoints defined by the Perfect search, but those exact terminal entries or exits are only causally executable at those same bars when the corresponding causal confirmation actually becomes available there.
A BUY can confirm after the retained trough has already occurred.
A SELL can confirm after the retained peak has already occurred.
Multiple signal attempts can develop before a completed structural swing establishes the retained signal identity.
A signal can appear very close to the terminal or only after part of the move has already occurred.
An earlier signal can be superseded before the structural swing finishes.
A retained signal can also survive structurally while the move to the next opposite retained terminal still produces a non-positive result.
A strong terminal-to-terminal move can begin before the corresponding causal confirmation becomes available.
Perfect Trading Entry Exit Finder attempts to expose this difference directly.
Within this script, Perfect has a specific meaning.
A Perfect Opportunity is a completed retained opposite-terminal relationship whose directional terminal-to-terminal result is positive.
The first retained terminal becomes the:
PERFECT BUY
or PERFECT SELL
The next retained opposite terminal becomes the corresponding:
PERFECT EXIT
The interval between those retained terminals becomes:
PERFECT HOLD
The Perfect Entry, Hold, and Exit remain attached to the retained terminal structure.
The corresponding causal confirmation remains separately preserved.
That allows the finder to expose both:
the complete retained terminal-to-terminal opportunity
and
the portion represented from the actual causal confirmation
without redefining one as the other.
The finder can therefore expose:
Perfect Buy and Perfect Sell terminals
Perfect Exit terminals
Perfect Hold paths
complete terminal-to-terminal opportunity
corresponding causal confirmation
confirmation timing difference
Causal Result
Opportunity Capture
Confirmation Loss
false/non-perfect signal context
completed structural relationships
and the current unfinished search state
The primary search is based on completed retained structural relationships.
An additional preview mode can expose the currently implied unfinished result at the chart edge.
Because that newest structural state is incomplete, preview-only output can change as additional bars arrive.
How it works
Perfect Trading Entry Exit Finder combines a causal signal foundation with a completed terminal-to-terminal search.
The causal signal foundation preserves what could actually become available through the forward signal process.
The Perfect search evaluates the completed retained structural opportunity.
Those two reference systems remain separate.
That separation is deliberately engineered into the finder: the completed terminal result can be reviewed alongside the causal confirmation without allowing the later result to replace what was actually available through the causal process.
The completed terminal opportunity shows the full retained swing after structural finalization.
The causal confirmation shows where the corresponding signal became available through the causal process.
The finder brings those references together for direct review without treating one as the other.
Terminal opportunity and causal confirmation
A completed terminal opportunity and the signal timing actually available through causal confirmation can differ substantially.
Once a swing has reached structural finalization, its retained terminal can be identified precisely within the completed structure.
At that terminal itself, however, the signal that ultimately corresponds to the completed opportunity may not yet have confirmed.
Price can move before confirmation becomes available.
An earlier signal can fail or be superseded.
The opposite terminal can later reveal that a retained signal did not produce a positive completed opportunity.
The finder keeps these relationships visible.
The Perfect terminal remains the Perfect terminal.
The causal confirmation remains the causal confirmation.
This allows direct comparison between:
where the complete retained opportunity began
and
where the corresponding causal signal became available
without moving either reference point to make them appear equivalent.
Perfect search structure
The Perfect search evaluates structurally finalized retained opposite-terminal relationships.
For a BUY-side opportunity, the completed structure runs from a retained trough toward a retained opposite peak.
For a SELL-side opportunity, the completed structure runs from a retained peak toward a retained opposite trough.
The finder evaluates the complete retained swing rather than an isolated signal bar.
The first retained terminal supplies the Perfect Entry reference.
The later opposite retained terminal supplies the Perfect Exit reference.
A positive directional result qualifies the completed relationship as a Perfect Opportunity.
The terminal relationship defines the Perfect search.
Causal signal foundation
The Perfect results remain connected to an underlying causal signal process.
This matters because identifying the finalized Perfect terminal retrospectively does not make that exact terminal entry or exit causally executable when the terminal bar originally occurred.
The associated causal confirmation remains separately preserved.
That provides the causal comparison reference for the completed Perfect opportunity.
Structural resolution
Structural resolution determines when a retained swing reaches structural finalization and becomes available to the completed Perfect search.
The script provides selectable structural approaches for reviewing this relationship.
These approaches can produce differences in finalization timing and retained structural presentation.
They do not change the central definition of a Perfect Opportunity:
a structurally finalized retained entry terminal followed by its retained opposite terminal with a positive directional result.
Earliest Terminal
Earliest Terminal provides an alternative structural view emphasizing earlier retained terminal context.
Original Grouping
Original Grouping provides the script's primary grouped structural view.
Conditional Accelerated
Conditional Accelerated provides an alternative earlier-finalization structural view when its conditions are satisfied.
These modes affect structural finalization and retained terminal identity while preserving the same Perfect Opportunity definition.
Retained signal identity
More than one causal signal attempt can occur during a structural swing.
The completed finder result does not treat all of those attempts as equivalent.
A retained signal identity provides the connection between the causal signal process and the structurally finalized terminal result.
Other signal attempts can remain visible as superseded or false/non-perfect context.
Retained terminal association
The finder preserves two conceptually different references:
Terminal reference
the retained structural extreme belonging to the structurally finalized opportunity.
Causal reference
the corresponding signal confirmation that was actually available through the causal signal process.
These references describe different parts of the same completed opportunity.
Neither replaces the other.
Retained terminal chain
Structurally finalized retained terminals provide the sequence used by the Perfect search.
A newest retained terminal by itself does not yet provide a complete terminal-to-terminal opportunity.
A later opposite endpoint is needed before the completed pair can be evaluated.
This prevents the normal retrospective search from treating unfinished structure as though its later endpoint were already known.
Eligible terminal pair
A structurally finalized retained opposite-terminal relationship provides the potential Perfect Entry and Perfect Exit.
The directional terminal-to-terminal result determines whether that completed relationship qualifies as a Perfect Opportunity.
The Perfect endpoints remain the retained structural terminals.
The search does not redefine them using the causal confirmation or an arbitrary interior price.
Perfect Opportunity
A Perfect Opportunity is a qualifying structurally finalized retained opposite-terminal relationship with a positive directional terminal-to-terminal result.
For a BUY-side opportunity, the retained trough is followed by a higher retained opposite terminal.
For a SELL-side opportunity, the retained peak is followed by a lower retained opposite terminal.
A zero or negative completed directional result does not qualify as Perfect.
Perfect is therefore a search definition applied to structurally finalized retained structure.
It is separate from whether the causal confirmation captured all, some, or little of that move.
Perfect Entry
The Perfect Entry is the first retained terminal of a qualifying completed opportunity.
For a BUY-side opportunity, this becomes the Perfect Buy .
For a SELL-side opportunity, this becomes the Perfect Sell .
The marker remains anchored to the retained terminal used by the completed search.
It is not moved forward to the causal confirmation.
Perfect Exit
The Perfect Exit is the retained opposite terminal that completes the qualifying opportunity.
The finalized structural endpoint defines the exit.
The finder does not replace it with an arbitrary interior price simply because that price would have produced a larger temporary result.
This preserves a consistent terminal-to-terminal definition.
Perfect Hold
PERFECT HOLD spans the complete qualifying retained opportunity.
For a Perfect BUY, it represents the retained trough-to-opposite-peak movement.
For a Perfect SELL, it represents the retained peak-to-opposite-trough movement.
The displayed hold therefore represents the complete Perfect opportunity between the two retained endpoints.
Shared Perfect Exit and next Perfect Entry
One retained terminal can conceptually complete one opportunity and begin another.
For example, a retained peak can complete a BUY-side Perfect opportunity and also become the starting terminal of a later SELL-side opportunity.
Likewise, a retained trough can complete a SELL-side opportunity and begin a later BUY-side opportunity.
The chart can present these shared terminal relationships without changing the underlying Perfect definitions.
Causal confirmation comparison
The finder can display the causal confirmation associated with a Perfect terminal opportunity.
The causal reference shows where the corresponding surviving signal became available.
The Perfect reference remains at the structurally finalized retained terminal.
This produces a direct comparison between:
Perfect terminal opportunity
and
causal signal availability
without treating the Perfect terminal as though it were known causally at that point.
Terminal-to-confirmation delay
The finder measures the timing difference between the retained Perfect Entry terminal and its corresponding causal confirmation.
A same-bar relationship has no bar delay.
A later confirmation represents a later causal availability point.
The purpose of this measurement is to expose the timing gap between the completed Perfect benchmark and the signal timing actually represented by the causal process.
Perfect result
Perfect Result is the directional percentage result between the retained Perfect Entry and retained Perfect Exit of a qualifying opportunity.
It represents the full completed terminal-to-terminal opportunity identified by the finder.
Causal result
Causal Result uses the corresponding causal confirmation as the entry reference while preserving the same completed exit context.
This allows the causal result and Perfect result to be compared within the same completed opportunity.
The two measurements answer different questions and are not interchangeable.
Opportunity Capture
Opportunity Capture describes how much of the completed Perfect opportunity is represented by the corresponding causal result.
It provides a normalized comparison between:
the complete retained opportunity
and
the result represented from causal confirmation.
Its purpose is interpretation, not to redefine either reference.
Confirmation Loss
Confirmation Loss describes the difference between the Perfect Result and corresponding Causal Result.
It shows how much of the completed terminal-to-terminal movement was not represented from the causal confirmation reference.
Perfect Result, Causal Result, Opportunity Capture, and Confirmation Loss therefore provide different views of the same completed opportunity.
False / non-perfect context
The finder can expose causal signal activity that did not become part of a qualifying Perfect Opportunity.
This can include:
1. signal attempts that were later superseded
2. structurally finalized retained relationships whose directional result was not positive
These categories help distinguish the wider causal signal stream from the subset of completed relationships classified as Perfect.
Superseded attempts
Several causal signal attempts can occur while the underlying structure is still developing.
Not every attempt becomes the retained identity associated with the structurally finalized opportunity.
Non-retained attempts can remain visible as superseded context.
This allows users to see that the eventual Perfect terminal association does not imply every earlier causal signal was correct.
Retained non-positive pairs
Structural retention alone does not automatically create a Perfect Opportunity.
A structurally finalized retained relationship must still satisfy the Perfect Opportunity definition.
If the completed directional terminal-to-terminal result is zero or negative, it does not qualify as a Perfect Opportunity and remains non-perfect context.
Unmatched newest retained terminal
The newest retained terminal remains incomplete until a later opposite terminal provides the second endpoint needed for structural finalization of the terminal-to-terminal relationship.
The normal retrospective search therefore does not prematurely classify that newest terminal as Perfect or non-perfect.
The optional preview can temporarily expose what the unfinished structure currently implies.
That preview remains separate from structurally finalized retained history.
Finder modes
The script contains two search modes:
Retrospective
Repainting Preview
They use the same conceptual Perfect Entry/Exit definition.
Their difference is whether the newest unfinished chart-edge structure is temporarily included.
Retrospective
Retrospective uses structurally finalized retained relationships.
Its Perfect results are based on swings whose terminal relationship has already reached structural finalization.
This is the primary review mode.
Repainting Preview
Repainting Preview temporarily extends the same search concept to the unfinished chart-right structure.
It shows what the newest result currently looks like before structural finalization has occurred.
Because the latest structural state is unfinished, preview-only output can change as future bars arrive.
The preview therefore repaints by design.
It should not be interpreted as a permanent causal Perfect signal.
Permanent completed history and preview state
The finder keeps structurally finalized retained history separate from temporary preview completion.
Finalized retrospective results belong to the completed search.
Preview-only results belong to the unfinished chart-edge state.
This allows the finder to expose both:
structurally finalized Perfect Entry/Exit structure
and
the currently implied unfinished structure
without treating them as equivalent.
Perfect Entry / Exit display
The primary display can show:
Perfect Buy
Perfect Sell
Perfect Exit
Perfect Hold
terminal-to-terminal result
causal confirmation comparison
and supporting opportunity context
These visuals represent the underlying search result.
Display settings do not redefine what qualifies as a finalized Perfect Opportunity.
False-context display
False/non-perfect context can be displayed separately from Perfect results.
This allows the chart to show the broader causal signal activity around finalized opportunities without changing which retained terminal relationships qualify as Perfect.
Structural context
The finder retains structural context around the signals and finalized opportunities being reviewed.
This context can help distinguish finalized, unresolved, retained, or superseded relationships.
The Perfect Opportunity itself remains defined by the structurally finalized retained terminal relationship and its directional result.
Search reconstruction
The finder reconstructs the historical search context needed to display causal signal relationships, structurally finalized opportunities, and the current unfinished state.
The purpose is to preserve the distinction between causal signal timing and finalized terminal identity across loaded chart history.
Perfect Opportunity Rate
The finder calculates a Perfect Opportunity Rate describing how often eligible finalized retained terminal relationships satisfy the Perfect Opportunity definition.
Perfect Opportunity Rate is not a trading win rate.
It describes the completed search classification.
It does not establish the result of an executed strategy using causal entries, transaction costs, slippage, sizing, or external risk rules.
Search statistics
The finder provides summary statistics describing the finalized Perfect search, causal comparison, false/non-perfect context, and current search state.
These statistics are designed to help interpret the search result.
Status pages
The script includes a compact status interface for reviewing the current Perfect search, causal comparison, timing, and interpretation context.
The status display supports chart review without requiring every measurement to be placed directly on the chart.
Alerts and execution
Perfect Trading Entry Exit Finder is not an execution engine.
Retrospective Perfect terminal results identify the completed ideal entry and exit endpoints. Those exact terminal entries or exits are only causally executable at those same bars when the corresponding causal confirmation actually becomes available there.
The Perfect structure and causal confirmation are retained for search, review, and comparison.
When causal confirmation occurs later, the executable causal entry or exit occurs later; the retrospective Perfect terminal remains the completed ideal endpoint rather than an entry or exit that was available at that earlier terminal bar.
The optional preview also remains a search preview rather than an execution-ready Perfect signal source.
Finder behavior
Perfect Trading Entry Exit Finder combines causal signal identity with finalized terminal-to-terminal opportunity searching.
Its broad workflow is:
causal signal activity develops
retained structural relationships reach finalization
a completed terminal-to-terminal relationship becomes available for review
positive finalized relationships can qualify as Perfect Opportunities
Perfect Entry, Hold, and Exit remain attached to the retained terminal structure
and the corresponding causal confirmation remains separately available for comparison
The optional preview can temporarily extend the same search concept to the unfinished newest structure.
Features
Perfect terminal-to-terminal Entry/Exit finder
Perfect Buy identification
Perfect Sell identification
Perfect Exit identification
Perfect Hold paths
retained trough-to-peak opportunity review
retained peak-to-trough opportunity review
positive finalized opportunity classification
actual retained terminal anchoring
causal confirmation preservation
direct Perfect-versus-causal comparison
confirmation timing comparison
Perfect Result
Causal Result
Opportunity Capture
Confirmation Loss
false/non-perfect context
superseded signal context
unresolved newest-terminal handling
selectable structural views
finalized historical search mode
Repainting Preview
false-context visualization
Perfect Hold visualization
causal comparison markers
supporting search statistics
Perfect Opportunity Rate
compact review/status interface
review-focused standalone finder
completed ideal Perfect entry/exit endpoints compared directly with whether those exact endpoints were causally executable at the time
Strengths
Perfect Entry/Exit Search — directly finds qualifying finalized terminal-to-terminal opportunities rather than stopping at the original causal signal.
Terminal-to-Terminal Structure — Perfect Entry and Perfect Exit remain tied to retained structural endpoints.
Complete Swing Representation — Perfect Hold represents the full retained opportunity between those endpoints.
Causal Identity Preservation — keeps the corresponding causal confirmation connected to the finalized opportunity for comparison.
Direct Perfect-versus-Causal Comparison — shows both the complete retained opportunity and the result represented from causal confirmation.
Opportunity Capture Measurement — quantifies how much of the completed Perfect opportunity is represented by the causal result.
Confirmation Loss Measurement — measures the difference between Perfect and causal results.
No Arbitrary Exit Substitution — does not replace the retained opposite terminal with an arbitrary interior best price.
False-Context Separation — keeps superseded and non-positive finalized relationships distinct from qualifying Perfect Opportunities.
Unfinished-Terminal Discipline — normal retrospective results are not finalized until the necessary opposite structural endpoint exists.
Structural Choice — selectable structural views can be compared while preserving the same central Perfect concept.
Finalized-History Separation — finalized search results remain distinct from temporary chart-edge preview output.
Preview Capability — the currently implied unfinished Perfect structure can be inspected while remaining explicitly identified as repainting.
Search Diagnostics — timing, capture, confirmation loss, false context, and opportunity context remain measurable.
Weaknesses
Opposite-Terminal Requirement — the complete Perfect Entry/Exit opportunity is not known until the later retained opposite endpoint structurally finalizes the relationship.
Terminal Hindsight — the finalized retained terminal and causal confirmation are different reference systems and can occur at different times and prices.
Confirmation Delay — part of the complete terminal-to-terminal movement can occur before causal confirmation becomes available.
Superseded Signals — multiple causal attempts can occur before structural finalization establishes the retained relationship.
Non-Positive Retained Relationships — structural retention alone does not guarantee a positive Perfect Opportunity.
Perfect Definition Scope — Perfect refers specifically to the positive finalized terminal-to-terminal search definition.
No Interior Exit Optimization — the retained opposite terminal remains the Perfect Exit even if another temporary price would have produced a larger result.
Structural Dependence — different structural views can affect finalization timing and retained terminal presentation.
Causal-Signal Dependence — the comparison remains connected to an underlying causal signal process.
Preview Repainting — unfinished preview output can move, disappear, or change before structural finalization.
Perfect-Terminal Executability Is Conditional — a finalized Perfect terminal is the completed ideal entry or exit endpoint, but it is executable at that exact terminal bar only when the corresponding causal confirmation actually becomes available there.
Perfect Opportunity Rate Is Not Win Rate — it measures search classification rather than executed strategy performance.
No Execution Engine — the standalone finder does not turn Perfect search output into automated trading decisions.
No Full Strategy Return Calculation — it does not establish complete returns after sizing, transaction costs, slippage, and external trading rules.
Who it’s for
This tool is best suited for:
advanced PulseWire users
users investigating the Perfect Entry/Exit problem
users searching for complete retained terminal-to-terminal opportunities
users comparing causal signal timing with structurally finalized terminal structure
users studying how much of a move occurs before confirmation
users examining trough-to-peak and peak-to-trough opportunities
users comparing Perfect Result and Causal Result
users studying Opportunity Capture
users studying Confirmation Loss
users examining false and superseded signal activity
users studying structural finalization and retained terminal relationships
users who want entry and exit markers anchored to actual retained endpoints
users who do not want arbitrary interior prices substituted for Perfect Exit
users who want the complete hold path between retained terminals
users comparing finalized structural results with an unfinished preview
users developing or evaluating separate causal methods against an explicit Perfect benchmark
Who it’s not for
This tool is not best suited for:
users expecting Perfect terminal markers to be live causal signals
users expecting final retained extremes to be known at the exact moment they occur
users expecting every causal signal to survive structural finalization
users expecting every finalized retained terminal relationship to qualify as Perfect
users expecting Perfect Opportunity Rate to represent an executed trading win rate
users expecting unfinished preview results to remain fixed
users expecting preview-only terminal markers never to repaint
users looking for broker execution from retrospective Perfect markers
users looking for automated position management from Perfect results
users looking for a complete trading strategy
users expecting causal confirmation and Perfect terminal timing to always coincide
users expecting the finder to remove confirmation delay
users expecting a guarantee of profitability or future performance
Known limitations
The finder is better at:
finding finalized retained terminal-to-terminal opportunity structure
identifying positive finalized terminal relationships
preserving complete Perfect Entry/Hold/Exit geometry
anchoring results to retained structural extremes
linking Perfect opportunity identity with causal signal confirmation
comparing complete opportunity with causal availability
measuring confirmation delay
measuring Opportunity Capture
measuring Confirmation Loss
exposing superseded and non-perfect context
comparing finalized and unfinished search structure
and reviewing how causal signals relate to complete terminal swings
than it is at:
identifying the final retained terminal causally before structural finalization
eliminating delayed confirmation
eliminating false or superseded signals
guaranteeing that every retained relationship produces a positive result
turning Perfect terminal markers into operational entries
determining whether the newest unfinished preview terminal will remain final
or determining a complete future trading result
A Perfect Opportunity is defined by the structurally finalized retained terminal relationship.
The causal confirmation can represent all, some, or very little of the complete terminal-to-terminal movement.
That difference is part of what the finder exposes.
A large Perfect Result can therefore coexist with a much smaller Causal Result.
Opportunity Capture and Confirmation Loss describe that difference.
Likewise, a retained signal can remain structurally relevant while its finalized opposite-terminal result still fails the Perfect qualification.
The term Perfect therefore belongs to the finalized search definition.
It does not imply that the finalized terminal was causally available as a Perfect signal when it originally occurred.
The optional Repainting Preview introduces an additional limitation.
It evaluates unfinished chart-right structure before structural finalization.
Future bars can therefore change preview-only output.
Finalized retrospective results remain separate from that temporary preview.
Perfect result scope
The Perfect result represents the complete retained terminal-to-terminal directional opportunity of a qualifying structurally finalized relationship.
It can include:
Perfect Buy or Perfect Sell
Perfect Exit
Perfect Hold
retained entry and exit terminals
terminal-to-terminal result
corresponding causal confirmation
Causal Result
Opportunity Capture
Confirmation Loss
and false/non-perfect context
These measurements preserve the complete opportunity and causal signal result as separate but directly comparable references.
Final note
Perfect Trading Entry Exit Finder is an experimental finder for the entry-and-exit problem that remains when the complete terminal opportunity and the causal signal available during that opportunity are not the same thing.
Its central capability is the retained terminal-to-terminal search.
Positive structurally finalized terminal relationships can become Perfect Opportunities.
The corresponding:
Perfect Entry
Perfect Hold
and Perfect Exit
remain attached to the retained terminal structure.
The causal confirmation remains separately preserved.
This allows the finder to expose both:
the complete retained entry-to-exit opportunity
and
the result represented from the corresponding causal confirmation
inside the same finalized swing.
False, superseded, or non-perfect signal context remains separately visible.
The optional preview can extend the same search concept to unfinished chart-edge structure, with its repainting behavior kept separate from structurally finalized results.
Perfect Trading Entry Exit Finder therefore remains centered on the problem it attempts to address:
locating the complete retained terminal entry, hold, and opposite-terminal exit opportunity while preserving the causal signal that was actually available for comparison.
Profitability is not guaranteed.
Future performance is not guaranteed.
The finder reports the Perfect opportunity, its terminal structure, corresponding causal result, timing difference, capture, confirmation loss, and false/non-perfect context. The retrospective Perfect terminals are the completed ideal entry and exit endpoints, but those exact terminal entries or exits were only causally executable at the time when the corresponding causal confirmation actually occurred at those same terminal bars; otherwise the executable causal timing occurred elsewhere. Indicator

Indicator

Indicator

Indicator

VASA Multi-Timeframe Rating vFStop flipping between charts to check whether the higher timeframes agree. This puts three timeframes in one small table on your chart. For each one it reads trend (fast EMA vs slow EMA) and momentum (RSI above or below 50), then sums them into a plain rating: Bull, Lean bull, Mixed, Lean bear, or Bear.
What it does: • Three configurable timeframes (default 15m / 1h / 4h) • Trend and momentum column per timeframe • A fused rating cell, colour-coded • Reads higher timeframes without repainting — on the live bar it uses the last closed higher-TF bar, so the table doesn't flicker intrabar
How to use: look for agreement. When all three lean the same way, you're trading with the broader context instead of against it. When they disagree ("Mixed"), that's your signal to size down or stand aside. Change the three timeframes to match how you actually trade — a scalper might run 1m/5m/15m, a swing trader 1h/4h/1D.
Educational only — not financial advice. Trading involves substantial risk of loss.
Indicator

Indicator

Indicator

AlphaVault - Regime FilterTwo long-term trend filters and one rule: price above both is a bull regime, below both is
a bear regime, anything in between is neutral. It plots the filters, tints the background
by state, marks each change, and shows how long the current state has held.
NO REPAINTING. Both filters are read from the previous COMPLETED daily and weekly bar
(lookahead_off plus a one-bar offset), so the regime shown for a closed bar never changes
afterwards. This is worth verifying yourself on any indicator you did not write: scroll
back, note the state on an old bar, reload the chart, and check it is the same.
What it is for: deciding whether to be doing anything at all. Most trend systems lose the
majority of their money trying to trade against a long-term downtrend, and a neutral state
is genuinely common — roughly a fifth of all bars on BTC since 2018. Treating "no clear
regime" as a valid answer rather than a gap to be filled is most of the value here.
What it is not: an entry signal. It tells you which direction is permitted, not when to
act, and it will keep you out of some large moves that begin before the filters confirm.
It is deliberately slow. On BTC it changes state a handful of times a year.
Defaults are a 200-period SMA on daily closes and a 20-period EMA on weekly closes. Both
lengths are configurable, though the defaults are the ones worth arguing about — a filter
you re-tune until it looks good on the chart in front of you has stopped being a filter.
Alerts fire on a turn to bull, a turn to bear, or any change. Regime changes are rare by
construction; an alert that fires constantly is one you learn to ignore.
Open source. Read it, change it, take it apart. Indicator

Ribbon Concordance [RC Tools]RC Tools — Ribbon Concordance
─────────────────────────────────────────────────────────────
█ OVERVIEW
Most ribbon-of-moving-averages tools either average the ribbon or rely on simple crossovers. This one asks a different question: is the ribbon consistently ORDERED? A cleanly stacked ribbon signals real trend conviction; a tangled, crossing one signals chop — often before any single moving average has crossed another.
█ WHAT IT DOES
Plots a live moving-average ribbon directly on the price chart (choice of 7 MA types, up to 10 MAs), plus a rank-concordance score (-100 to +100) in its own pane. Classifies the ribbon into four bands — Strong Bullish, Weak Bullish, Weak Bearish, Strong Bearish — colours the chart background accordingly, and shows a table with the current band, how long price has been in it, and historical base rates (average forward return and win rate) for each band.
█ THE THEORY BEHIND IT
Ribbon tools usually throw away information about HOW consistently the ribbon is stacked, collapsing it to an average or a single crossover event. This tool instead measures rank concordance — a public, long-established statistical concept (related to Kendall's tau) that quantifies how well two orderings agree with each other. Applied to a moving-average ribbon: compare every pair of MAs, shorter-period against longer-period, and score whether their relative ordering is consistent with a clean trend. A ribbon where every shorter MA sits above every longer one (or below, for a downtrend) scores near the extreme; a tangled, crossing ribbon averages out near zero. This is a different statistical question than "is price above its moving average" or "how efficient was the recent price path" (see the Regime Classifier for that approach) — it is specifically about internal agreement across the whole ribbon at once.
█ HOW IT IS CALCULATED
1. Build a ribbon of N moving averages (configurable type and count), with periods increasing linearly from a base period by a fixed spacing.
2. For every pair of MAs (i, j) where i has a shorter period than j: score +1 if MA > MA (bullish-consistent ordering), -1 if reversed, 0 if tied.
3. Sum all pair scores and normalise by the number of pairs compared, scaled to -100..+100.
4. Optionally EMA-smooth the raw score, which is otherwise a somewhat steppy pairwise count, for a cleaner read.
Classification occurs ONLY on confirmed bar close — the band never flips mid-bar and reverses. The MA ribbon itself plots live, exactly like any moving average on any chart; that is normal behaviour, not repainting. Only the concordance score and its band classification are held to confirmed bars.
█ SETTINGS & CONFIGURATION
• Source, MA Type (SMA / EMA / WMA / RMA / HMA / DEMA / TEMA)
• Base Period and Period Spacing — set the shortest MA and the gap between each successive one
• Ribbon Size (3-10 MAs) — more MAs smooth the read but add lag from the longest one; fewer react faster but are noisier
• Score Smoothing Length — EMA smoothing on the raw concordance score (set to 1 for none)
• Strong Threshold — the score above which (or below its negative) a band counts as "Strong" rather than "Weak"
• Forward Return Window — the horizon used for the base-rate table
• Show MA Ribbon on Chart — toggle the ribbon overlay off if you only want the concordance pane
• Ribbon gradient colours (short end / long end) and band colours are fully configurable
█ HOW TO USE IT
Use it as a trend-conviction filter alongside your existing process. Strong Bullish/Bearish bands indicate a cleanly stacked ribbon — a higher-conviction environment for trend-following approaches. Weak bands, or frequent flips between Weak Bullish and Weak Bearish, indicate the ribbon is loosely ordered — more caution warranted for trend-following, and potentially a more favourable environment for mean-reversion approaches instead. Check the base-rate table's sample count before assuming any one band is systematically favourable.
Works on any asset and timeframe; ribbon size and spacing should be tuned to the timeframe you trade (a wide, long-spaced ribbon on a low timeframe will lag heavily).
█ LIMITATIONS
• This is a ribbon of moving averages — inherently lagging by construction. It confirms alignment after price has already moved, and this cannot be removed without curve-fitting.
• Near-zero or Weak readings are common in choppy, range-bound conditions and do NOT predict a breakout direction — they only describe the ribbon's current state of (dis)agreement.
• Ribbon size is a real trade-off: more MAs smooth the read but add lag from the longest included MA; fewer MAs react faster but are noisier.
• The concordance score and band update on confirmed bar close only. The ribbon MA lines themselves plot live, like any moving average — that is normal behaviour, not repainting.
• Historical base-rate stats need a meaningful sample count (check N) before being trusted, especially for less common bands.
• Four bands are a deliberate simplification of a continuous reality. Markets do not actually occupy discrete states.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any band does not indicate future results. Trade at your own risk.
Indicator

Regime-Conditional Correlation [RC Tools]RC Tools — Regime-Conditional Correlation
─────────────────────────────────────────────────────────────
█ OVERVIEW
Plain rolling correlation between two assets is well-covered ground. The angle here: correlation is not a constant — it changes with the market regime. This tool computes rolling correlation against a second symbol of your choice and buckets it by the same regime framework as the Regime Classifier, so you can see whether a correlation you're relying on actually holds up across market conditions, or only shows up in one of them.
█ WHAT IT DOES
Plots rolling correlation (Pearson, default 20-bar window) between the current chart's symbol and a compare symbol you choose. Colours the background by the current market regime (Trending — Expansion/Exhaustion, Ranging — Quiet/Volatile), using the identical directionality × volatility-percentile logic as the Regime Classifier. A table shows the current regime and correlation, plus the average correlation, its standard deviation, and the sample count for each of the four regimes historically.
█ THE THEORY BEHIND IT
A single "the correlation is 0.8" number hides a lot. Two assets can be tightly linked during calm trending markets and decouple completely during volatile chop — or vice versa. Regime-conditioning the correlation surfaces that structure instead of averaging it away. This matters directly for anything relying on a stable cross-asset relationship: hedges, pairs, or diversification assumptions that quietly break exactly when you need them most (in the volatile regime).
█ HOW IT IS CALCULATED
CORRELATION: standard Pearson correlation between the current symbol's close and the compare symbol's close (fetched via request.security on the same timeframe), over a rolling window (default 20 bars).
REGIME: identical to the Regime Classifier — Efficiency Ratio for directionality, percentile-ranked realised volatility for volatility state, crossed to give four states. Regime is measured on the CURRENT chart's own price action, not the compare symbol. See the Regime Classifier's description for the full methodology.
The correlation reading and the regime are both "as of now" — contemporaneous — so unlike the Regime Classifier's forward-return table, no forward-looking attribution is needed here: each confirmed bar's correlation is added directly to the running average for whichever regime was active on that same bar.
█ SETTINGS & CONFIGURATION
• Compare Symbol (default BTCUSD) — the second asset to correlate against
• Correlation Length (default 20 bars)
• Regime settings mirror the Regime Classifier exactly (Efficiency Ratio lookback, directionality threshold, realised vol lookback, percentile window, volatility percentile threshold) — keep these in sync if you run both indicators together
• Paint Main Chart Background — off by default; enable on only one of the two indicators if running both, to avoid overlapping backgrounds
█ HOW TO USE IT
Check whether a correlation you're relying on is regime-dependent before trusting it. Example: if a hedge shows strong negative correlation in Ranging — Quiet but the average correlation flips or weakens in Ranging — Volatile, that hedge may not protect you exactly when volatility spikes. Always check the sample count (N) per regime before drawing conclusions — a regime with few historical bars hasn't been tested enough to trust its average.
█ LIMITATIONS
• Correlation is measured over a short rolling window and is noisy by nature — it will swing even when the underlying relationship is stable.
• The compare symbol is fetched via request.security on the same timeframe; illiquid symbols, different exchange sessions, or timezone misalignment can introduce lag or missing values.
• Regime classification carries the same caveats as the Regime Classifier: it is backward-looking by construction, unstable near threshold boundaries, and needs substantial history to be reliable.
• Per-regime correlation statistics accumulate only from where the chart's loaded history begins — early sample counts are small and not yet statistically meaningful.
• This script does NOT repaint. All classification and correlation display values update on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past correlation between any two assets does not indicate future results. Trade at your own risk.
Indicator

Percentile Context [RC Tools]RC Tools — Percentile Context
─────────────────────────────────────────────────────────────
█ OVERVIEW
Not "is RSI over 70" — "where does today's reading actually sit in its own history?" This tool takes a metric of your choice (realised volatility, RSI, volume, rate of change, or any custom source you plug in) and ranks it as a percentile against its own trailing distribution. It's the statistical primitive underneath most technical analysis, made explicit instead of buried in a fixed threshold.
█ WHAT IT DOES
Plots a 0–100 percentile-rank line for the selected metric, flags "extreme" zones (default: below the 10th percentile or above the 90th), and shows a stats table with the current value, current percentile, all-time min/max seen on the chart, and how many bars it's been since the metric last hit either extreme.
█ THE THEORY BEHIND IT
Fixed thresholds ("RSI > 70 = overbought") assume a metric's meaningful range never changes. It does — across assets, and across time on the same asset. A percentile rank fixes this by asking a relative question instead of an absolute one: given everything this metric has done over its own trailing window, how unusual is today's reading? This is the same idea underneath the Regime Classifier's volatility-state measure, generalised to any metric.
█ HOW IT IS CALCULATED
The selected metric is computed per bar:
• Realised Volatility: stdev(log(close/close ), N)
• RSI: standard Wilder RSI
• Volume: raw bar volume
• Rate of Change %: (close − close ) / close × 100
• Custom Source: whatever series you plug into the source input (e.g. another indicator's plot)
The metric is then percentile-ranked against its own trailing window (default 750 bars ≈ 3 years on daily): what percentage of the last N readings were below today's value. Display values update ONLY on confirmed bar close — nothing here repaints.
█ SETTINGS & CONFIGURATION
• Metric (default Realised Volatility) — what gets ranked
• Custom Source — only used when Metric = Custom Source
• Realised Volatility / RSI / Rate of Change lookbacks (defaults 20 / 14 / 20)
• Percentile Ranking Window (default 750 bars) — longer = more stable, needs more history
• Low / High Extreme Thresholds (default 10 / 90)
• Paint Main Chart Background — off by default to avoid clashing with the Regime Classifier's background if you run both at once
█ HOW TO USE IT
Use it to calibrate how seriously to take a "normal" indicator reading. Example: RSI at 75 means something different on a stock that's rarely above 60 than on one that regularly touches 85 — the percentile rank makes that comparison explicit for the SAME asset over time. Also useful for volatility context ahead of position sizing: current realised vol at the 95th percentile is a different risk environment than the same absolute vol reading at the 40th percentile.
Works on any asset and timeframe with sufficient history for the percentile window.
█ LIMITATIONS
• Percentile rank describes the past relative to itself — it says nothing about direction or what happens next. A metric at its 99th percentile can stay there.
• Needs substantial history for a stable ranking. On short-history assets, treat the percentile as unreliable.
• "Extreme" is relative to the metric's OWN range. A percentile extreme on a low-volatility asset is not directly comparable in absolute terms to one on a high-volatility asset — that's the point of the tool, but it means percentiles aren't comparable across symbols.
• All-time min/max and "bars since" stats are only as long as the chart's available history, not a fixed universal record.
• This script does NOT repaint. Display values update on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any metric does not indicate future results. Trade at your own risk.
Indicator

XG Boost Lite: Reversals | GainzAlgoWe are excited to release this indicator, which uses our brand-new Arbor library for gradient boosting! This engine brings true, high-performance machine learning natively into Pine Script v6, bypassing the need for external webhooks or API layers. By utilizing iterative, tree-based models on your chart, XGBoost Lite: Reversals adapts directly to the historical structure of the asset you are trading, identifying precise pivot exhaustion points with high statistical conviction.
🧠 Understanding Gradient Boosting & XGBoost
To trade successfully with machine learning, it helps to understand exactly what is happening beneath the hood of the asset's data.The Core TheoryGradient Boosting is a powerful machine learning technique used for regression and classification tasks. Unlike deep learning networks that process data through abstract node layers, gradient boosting relies on an ensemble of simple decision trees, often called "weak learners" or "stumps".
The training process works sequentially:
The Initial Guess: The model makes a basic baseline prediction.Calculating the Error (Residuals): It checks where its prediction missed the actual historical market outcome.
Correcting the Mistakes: A new decision tree is built specifically to predict those errors (the gradient of the loss function).
Iterative Learning: The model repeats this process for several rounds. Each new tree focuses entirely on correcting the flaws of the previous ones, scaling its adjustments by a Learning Rate to maintain stability.
What Makes XGBoost Special?
XGBoost (Extreme Gradient Boosting) optimizes this framework for speed, scalability, and performance. It applies strict regularization techniques to minimize overfitting, ensuring the model doesn't just "memorize" past market noise but instead learns genuine structural behaviors.By evaluating multiple market features simultaneously, it estimates the probability of a specific event occurring.
🛠️ About the Indicator
XGBoost Lite: Reversals is a machine learning-driven technical indicator designed to catch exhaustion and reversal setups.
The Machine Learning Pipeline
Dual Engines: The script fits four separate models simultaneously—a classifier and a regressor for Longs, and a classifier and a regressor for Shorts.
Dynamic Retraining: Rather than remaining static, the model automatically flushes its memory and retrains its internal mathematical weights every n bars to adapt to evolving market regimes.
Strict Non-Repainting Execution: A critical upgrade in this framework forces features and calculations to compute and lock strictly on bar close. Signals, dynamic entry points, and risk metrics are only printed once the triggering candle is finalized, ensuring what you see on the historical chart matches real-time execution perfectly.
The Core Features Evaluated
The model processes a combination of multi-dimensional market inputs to generate a unified prediction:
RSI (14): Evaluates traditional momentum expansion and contraction.
Relative Volume (20): Evaluates institutional engagement by dividing current volume against its 20-period SMA.
Z-Score (20): Measures how far the current price has deviated from its statistical mean.
ADX (14): Gauges the overall strength of the macro trend to prevent trading directly into a runaway freight train.
📊 How to Use the Indicator
The Real-Time Dashboard: When applied to your chart, the indicator renders an advanced Feature Importance Scatter Plot in the right-hand margin.
Distribution Scatter: The horizontal bars plot the historical density of successful signals. Darker, tightly packed nodes represent highly concentrated, high-probability clusters discovered by the algorithm.
Visualizing Signals
When a market pivot is detected (e.g., a structural swing low or high) and the classifier hits your target confirmation probability, a signal arrow prints on the chart displaying the mathematical certainty ($e.g., 74.2\%$) of the reversal.
⚙️ The Settings Inputs
The indicator’s interface is neatly categorized into three primary functional groups:
⚙️ XGBoost Model Settings:
Training Lookback (Bars): (Default: 250) The historical window used to feed the training arrays. Max capped at 300 to remain computational within Pine Script limits.
Retrain Frequency: (Default: 50) Determines how often (in bars) the model recalibrates its trees. Boosting Rounds: (Default: 20) The number of sequential trees (stumps) trained per model. Higher numbers capture deeper complexities but risk overfitting.
Learning Rate: (Default: 0.3) The step size applied to each boosting round to prevent the model from learning too quickly. Min Probability for Signal: (Default: 0.65) The minimum confidence threshold ($65\%$) required from the classification model to trigger an active trade.
ADX Length / Minimum Filter: (Default: 14 / 20.0) Prevents counter-trend signals if the prevailing macro trend is too strong.
🛡️ Target & Risk Management
SL Wick Buffer ×ATR: (Default: 0.25) Sets how much breathing room is given below a swing low wick or above a swing high wick, scaled by ATR.
TP1 ×Risk (R-multiple): (Default: 1.0) Targets a clean 1:1 Risk-to-Reward ratio for the initial profit take.
TP3 Min ×Risk (Floor): (Default: 2.0) The minimum target floor for the machine learning regression objective.
Break-Even After TP1: (Default: True) Automatically moves the Stop Loss to the exact entry price the moment TP1 is captured, eliminating risk on the remainder of the trade.
📈 How to Trade the Indicator
Trading with the machine learning model requires blending quantitative probabilities with standard structural execution:
The Entry: Wait for a Bullish (Neon Purple) or Bearish (Neon Pink) arrow to finalize on a closed candle. The percentage printed indicates the model's confidence.
Placing Risk: The system automatically draws a solid line anchoring your Stop Loss tightly to the local structural wick pivot, applying an ATR buffer to account for minor noise.
Scaling Targets:
Target 1 (TP1): Landed at a symmetrical 1:1 distance. When hit, the indicator dynamically updates your Stop Loss to your entry line, locking in a "scratch-or-better" runner.
Target 2 (TP2): Represents the mathematical midpoint between your baseline risk and the macro ML objective.
Target 3 (TP3): Driven directly by the XGBoost Regression Model. The regressor estimates the potential mathematical expansion based on current market features—if volatility is expanding, TP3 will automatically stretch further to ride major trend changes.
📊 Deep Dive: The Feature Importance & Scatter Plot Dashboard
The dashboard rendered on the right side of the chart acts as the "brain" of the indicator. It provides real-time transparency into exactly how the machine learning model is weighing data and evaluating current market conditions.
Feature Importance Bars (The Relative Weights): The horizontal progress bars display the mathematical percentage weight allocated to each of the four indicators processed during the model's most recent training cycle. These values change dynamically every time the model triggers a retraining block (default: every 50 bars) as it adapts to shifting market conditions. For example, if the market moves into a heavy trending phase, you will notice metrics like the ADX or Z-Score capture a higher percentage of the model's attention, whereas the RSI will frequently become the dominant driver if the asset is range-bound.
The Holographic Scatter Plot (Historical Feature Density): Layered over the progress bars is an advanced distribution scatter plot consisting of individual circular glyphs (○, ◉, ●) that plot a rolling record of the last 30 historical signal points. The horizontal position of each dot shows exactly where the feature value landed relative to its historical extremes (0 on the far left, 1 on the far right). The script introduces a subtle vertical "jitter" to separate these dots so you can visually identify high-density clusters where successful reversal setups frequently occur, while the shifting style of the glyphs flags tightly packed clusters of solid nodes (●) to indicate highly concentrated mathematical sweet spots discovered by the XGBoost classifier.
Indicator

Regime Classifier [RC Tools]RC Tools — Regime Classifier
─────────────────────────────────────────────────────────────
█ OVERVIEW
Most indicators assume a single market condition and quietly fail in another. This tool doesn't generate signals — it tells you which of four market regimes you are currently in, so you can judge whether your existing tools are operating in conditions that suit them. It is a context tool, not a decision tool.
█ WHAT IT DOES
Classifies each confirmed bar into one of four states and colours the chart background accordingly:
• Trending — Expansion: directional, volatility rising
• Trending — Exhaustion: directional, volatility compressing
• Ranging — Quiet: no direction, low volatility
• Ranging — Volatile: no direction, high volatility (chop)
A table (top-right by default, repositionable) shows the current regime, how long price has been in it, and historical base rates — the average forward return and win rate seen after each regime, going back over the chart's full history.
█ THE THEORY BEHIND IT
Market behaviour is not stationary. A trend-following tool that performs well in directional expansion will bleed in volatile chop; a mean-reversion tool does the reverse. Rather than attempting to fix any single indicator, this tool identifies which environment you are in, using two independent dimensions — directionality and volatility state — that measure genuinely different properties of price behaviour rather than two correlated views of the same one.
█ HOW IT IS CALCULATED
DIRECTIONALITY — Efficiency Ratio over N bars:
ER = |close − close | ÷ Σ|close − close |
Bounded 0–1. A value near 1 means price travelled almost directly from A to B (trending); near 0 means it wandered (ranging). No fitted parameters beyond the lookback. The Efficiency Ratio was introduced by Perry Kaufman as the core input to his Adaptive Moving Average (KAMA); it is used here purely as a directionality measure, independent of any moving average.
VOLATILITY STATE — realised volatility, percentile-ranked:
RV = stdev(log(close/close ), N)
RV is then ranked as a percentile against its own trailing distribution (default: 750 bars, ≈3 years on daily). An absolute volatility threshold is meaningless across assets — percentile ranking makes the classification behave identically on BTC, gold and equities with no parameter tuning.
The two dimensions are crossed to yield the four states. Classification occurs ONLY on confirmed bar close — the background never updates mid-bar and then flips back.
The base-rate table works by recording, for every historical bar, the forward N-bar return and whether it was positive, attributed back to whichever regime was active N bars earlier. Only fully-elapsed, already-known returns are used — nothing is looked up ahead of the current bar.
█ SETTINGS & CONFIGURATION
• Efficiency Ratio Lookback (default 20) — shorter = more responsive, noisier
• Realised Volatility Lookback (default 20)
• Percentile Ranking Window (default 750 bars ≈ 3 years daily) — longer = more stable, needs more history
• Directionality Threshold (default 0.35) — the ER above which price is considered trending
• Volatility Percentile Threshold (default 50) — the split between low and high volatility states
• Forward Return Window (default 20 bars) — the horizon used for the base-rate table
• Table position and background colours are fully configurable; the main-chart background painting can be toggled off if you only want the diagnostic pane
█ HOW TO USE IT
Use it as a filter on your existing process, not as an entry trigger. Example: if you run a breakout system, check whether it has historically performed in Ranging — Volatile; if not, consider standing aside when the background flags that state. Example: a mean-reversion system will typically show its worst results in Trending — Expansion.
Works on any asset and timeframe with sufficient history for the percentile window. Best used on daily and above, where regime persistence is greatest.
█ LIMITATIONS
This tool classifies the PRESENT. It does not predict the future, and any use of it as a forecast is a misuse.
• Regime identification is backward-looking by construction. The tool will confirm a regime change several bars AFTER it occurred. This lag cannot be removed without curve-fitting or repainting, and has not been.
• Classification is unstable near threshold boundaries; expect flickering between states when ER or volatility percentile sit close to the cut-offs.
• The percentile ranking requires substantial history. On assets with short histories, the ranking is unreliable and the tool should not be trusted.
• The base-rate table's early entries are built on fewer samples than its later ones — treat statistics as provisional until a state has accumulated a meaningful sample count.
• Four states is a deliberate simplification of a continuous reality. Markets do not actually occupy discrete regimes.
• This script does NOT repaint. All classification is computed on confirmed bar close only.
█ DISCLAIMER
For educational and informational purposes only. Nothing here is financial advice. Past behaviour of any market regime does not indicate future results. Trade at your own risk.
Indicator

Indicator

ATR Bands (MA Distance)ATR Bands (MA Distance) plots volatility-based bands at a multiple of ATR away from a selected moving average.
Unlike percentage envelopes or standard deviation bands, this indicator measures distance from the moving average using ATR, representing the market’s normal “breathing range” rather than statistical probability.
Key Features
The center line is a selectable moving average (EMA, SMA, RMA/Wilder, or WMA).
Upper and lower bands are calculated as:
Moving Average ± ATR × Multiplier
Band width automatically adapts to changing market volatility.
Designed for consistent use across different markets and timeframes without parameter re-optimization.
Non-repainting: all values are calculated only from confirmed historical bars.
Intended Use
ATR Bands (MA Distance) is best used as a context and preparation tool , not as a direct entry or exit signal.
Typical use cases include:
Identifying areas where price is extended relative to its recent volatility.
Visualizing normal vs. stretched price distance from the moving average.
Supporting range-based analysis or trade preparation when combined with other indicators (e.g., oscillators).
Important Notes / How NOT to Use
This indicator does NOT generate buy or sell signals by itself .
Touching or crossing a band does not imply an automatic reversal.
In strong trending markets, price may stay outside the bands for extended periods.
ATR Bands should not be interpreted as overbought/oversold levels on their own.
This indicator does NOT repaint. Once a bar is closed, its values will not change.
For best results:
Use ATR Bands as a preparation zone, then wait for confirmation from your own entry logic.
Disable or ignore band-based mean-reversion ideas during strong trend conditions.
Concept Summary (Short)
ATR Bands (MA Distance) visualize how far price has moved from its moving average in terms of volatility, without repainting and without relying on percentage deviation or statistical assumptions.
Optional Short Description (Preview)
Volatility-based, non-repainting ATR bands plotted at a distance from a moving average.
Designed for market context and trade preparation — not standalone signals. Indicator

Market State Intelligence [Interakktive]Market State Intelligence (MSI) is a diagnostic market-context indicator that reveals how the market is behaving — not where price "should" go.
MSI does not generate buy/sell signals. Instead, it classifies market conditions into clear behavioural regimes by continuously measuring:
- DRIVE (directional effort)
- OPPOSITION (absorption / resistance)
- STABILITY (structural persistence)
MSI is designed to answer three practical questions:
- What state is the market in right now?
- Is energy building, releasing, or decaying?
- Is participation aligned with price, or opposing it?
█ WHAT MSI DOES
MSI operates as a real-time regime classification engine that processes each closed bar through three independent measurement systems:
DRIVE — Directional Effort (0–100)
- Displacement efficiency (net progress vs total path)
- Range expansion quality (actual range vs expected ATR range)
- Body dominance (body vs candle range)
OPPOSITION — Absorption / Resistance (0–100)
- Wick pressure (rejection relative to attempt)
- Effort–result gap (high effort, low progress)
- Reversal density (counter-moves frequency)
STABILITY — Persistence (0–100)
- Condition persistence (how long conditions hold)
- Variance score (flip frequency)
- Follow-through consistency (reaction continuity)
These three forces feed a deterministic classifier with hysteresis (anti-flicker) to identify five regimes:
COMPRESSION — low drive, low opposition, higher stability (pressure building, direction unclear)
EXPANSION — high drive, low opposition (directional energy release)
TREND — medium-high drive, higher stability, low-medium opposition (healthy continuation)
DISTRIBUTION — medium drive, high opposition (effort absorbed; progress blocked)
TRANSITION — rapidly rising opposition, low stability (regime breakdown / uncertainty)
█ WHAT MSI DOES NOT DO
- No buy/sell signals, entries/exits, or performance claims
- No prediction of future direction
- No repainting: calculations use closed-bar data only
MSI is a market state layer intended to support your execution framework.
█ VISUAL SYSTEM
MSI uses a layered visual grammar designed to remain readable on live charts:
Regime Ribbon
A thin horizontal band showing the current regime via colour. Ribbon opacity reflects regime confidence (stronger confidence = more visible).
Pressure Envelope (core visual)
A soft corridor around price that expands with Drive and becomes more visible as Opposition increases. This visualises "pressure thickness" around current action (not a volatility band for entries).
Structural Memory
Faint background stains appear where regimes previously failed (e.g., expansion collapsing into absorption). These are behavioural context zones showing where market intention was rejected — not support/resistance.
Regime Change Markers (optional)
Subtle labels appear when regimes transition after confirmation. Useful for replay and education.
Effort Halo (optional)
Candle highlighting when Opposition materially exceeds Drive, indicating absorption/inefficiency.
█ HUD PANEL
The HUD displays:
- Current regime name + colour indicator
- A context gate showing whether conditions are aligned with long-bias or short-bias context (not an entry/exit system)
█ REGIME LEGEND
When enabled, displays:
- A one-line definition of the current regime
- Live Drive / Opposition / Stability values for interpretation
█ TIME-TO-DECISION METER
A visual pressure gauge that tends to fill during Compression (energy building) and drain during Expansion (energy releasing). It is a state-tracking meter, not a timing tool.
█ SETTINGS
MSI — Settings
- Preset Mode: Scalper / Swing / Position
- Analysis Mode (Minimal): ON = subtle visuals, OFF = full intensity
- Regime Ribbon, Structural Memory, HUD Panel, Time-to-Decision Meter, Effort Halo
MSI — Visual Options
- Show Regime Changes: Labels when regime transitions occur
- Show Regime Legend: Definition and live values display
- Panel Position: Move the entire panel anywhere on chart
MSI — Advanced (Tuning)
- Sensitivity (0.5–2.0)
- Smoothing (0.5–2.0)
- Memory Decay (0.5–2.0)
- Visual Intensity (Low / Medium / High)
█ PRESETS EXPLAINED
Scalper
Higher sensitivity + lower smoothing + faster memory decay. Best for 1m–15m monitoring.
Swing (default)
Balanced behaviour. Best for 15m–4H analysis.
Position
Lower sensitivity + higher smoothing + slower memory decay. Best for 4H–1D macro context.
█ STRUCTURAL MEMORY
When a regime fails (example: Expansion → Distribution), MSI creates a memory imprint:
- Fixed stain window (preset dependent)
- Strength decays over time
- Limited to a maximum number of imprints to reduce chart clutter
These zones represent behavioural rejection, not levels.
█ SUITABLE MARKETS
MSI is designed for Forex, Crypto, Indices, Stocks, and Commodities.
Works from intraday to Daily, with particularly strong readability on 15m–4H.
█ DISCLAIMER
This indicator is for educational and informational purposes only. It does not constitute financial advice, trading recommendations, or solicitation. Trading involves substantial risk. Always use proper risk management and make independent decisions. Indicator
