OPEN-SOURCE SCRIPT
All-Markets Movement Extremes Tool

A causal all-markets movement tool for identifying retained terminal PEAK/TROUGH extremes and exposing the earliest available confirmation of those extrema after the required price structure develops.
Name:
All-Markets Movement Extremes Tool
Searchable Name:
All-Markets Movement Extremes Tool
Technical Name:
All-Markets Non-Repainting Terminal-to-Causal Directional Movement Extremes Tool
Short title:
Movement Extremes
Summary
All-Markets Movement Extremes Tool identifies terminal peaks and troughs within developing directional movement and preserves the causal confirmation that makes each retained extreme available.
The central difficulty is that a completed extreme and the generated signal capable of establishing that extreme are not necessarily available at the same time.
A trough can already exist before enough upward structure has developed to confirm that the downward movement terminated there.
A peak can already exist before enough downward structure has developed to confirm that the upward movement terminated there.
Price can therefore move meaningfully away from the terminal before the corresponding confirmation becomes available.
The tool is built around that separation.
During an active directional leg, the current extreme remains provisional and can be replaced by a newer same-side high or low.
Once the required opposite structure confirms, the retained extreme becomes:
The terminal marker remains attached to the retained movement extreme.
The causal confirmation remains attached to the later bar where that extreme became confirmable.
This keeps two important references visible at the same time:
where the directional movement terminated
and
where the corresponding confirmation became available
The confirmed PEAK/TROUGH stream can therefore provide context for directional-movement trading, filtering, confirmation, and broader trading decisions, while the stream itself represents confirmed movement extremes and their causal availability rather than a complete standalone buy/sell signal.
The result is a directional-movement tool that provides:
Terminal extremes
The script follows an active directional leg and retains its strongest extreme.
During an upward leg, the highest retained high remains the potential terminal PEAK.
During a downward leg, the lowest retained low remains the potential terminal TROUGH.
A newer same-side extreme can replace the previous candidate while that directional movement remains active.
The extreme becomes confirmed only after the required opposite structure develops.
This prevents a temporary move away from a high or low from automatically being treated as the completed terminal.
Causal confirmation
Every confirmed terminal has two important locations.
Terminal
The retained PEAK or TROUGH belonging to the completed directional movement.
Causal confirmation
The later confirmed-bar event where enough completed structure exists to establish that terminal.
The terminal shows where the completed movement ended.
The causal confirmation shows when the script could establish that terminal through its forward process.
Those two points can be close together or separated by several bars.
The optional Causal Confirmation Comparison makes that difference visible directly on the chart.
Earliest available confirmation
The tool attempts to expose a retained terminal on the first confirmed transition that satisfies its active structural requirements.
That does not move the historical terminal forward.
The PEAK or TROUGH remains attached to the completed movement extreme, while the causal marker remains attached to the later confirmation event.
This is what allows the tool to preserve both the final movement location and its actual causal availability.
Directional movement
The PEAK/TROUGH sequence forms a continuing directional structure.
A confirmed TROUGH establishes the completed low of the preceding downward movement.
A confirmed PEAK establishes the completed high of the preceding upward movement.
Consecutive opposite terminals describe the completed movement between retained extrema.
The tool can display those relationships with HOLD paths and directional backgrounds so the broader directional movement remains visible rather than reducing the chart to isolated labels.
Directional-movement trading context
The confirmed extremes and their causal transitions provide directional-movement context that can be examined alongside confirmation rules, filtering, entry/exit context, or other market-state methods.
The value of the output is the movement structure it establishes:
terminal extreme → causal confirmation → directional movement context
That structure remains available for broader trading-related evaluation without changing what the PEAK/TROUGH stream itself represents.
Movement cycles
Consecutive opposite confirmed extrema form completed directional cycles.
The tool keeps two reference systems available.
Terminal-to-terminal
The completed movement between retained extrema.
Confirmation-to-confirmation
The corresponding directional movement between the causal confirmation points.
These measurements can differ substantially because part of the terminal movement can occur before confirmation becomes available.
Last capture / confirm gap
The Movement Cycle page shows Last capture / confirm gap for the most recent completed cycle.
The capture value compares the latest completed terminal-to-terminal directional result with the corresponding confirmation-to-confirmation result when the terminal movement is positive.
The confirm gap shows the difference between those two completed-cycle results.
Together, they provide a compact comparison between the retained movement extremes and the corresponding causal confirmation references.
Unconfirmed context
Not every developing extreme becomes the retained terminal.
An earlier high can be superseded by a higher high.
An earlier low can be superseded by a lower low.
When enabled, the tool can expose this context separately from the confirmed PEAK/TROUGH sequence.
The optional Minimum Reversal Filter can also reject structural transitions that do not meet the selected movement requirement.
Current movement
For the latest confirmed extreme, the tool can compare:
This provides a current directional reference after the extreme has been established.
Status pages
The tool includes four compact status pages:
Summary provides the broad state of confirmed extrema and completed movement cycles.
Movement Cycle focuses on the latest terminal, its confirmation, current movement, and the previous completed cycle.
Timing focuses on terminal-to-confirmation separation and structural timing.
Guide provides a compact interpretation of the active PEAK/TROUGH framework.
Alerts
Optional alerts are available for confirmed PEAK and TROUGH events.
The alert occurs when the causal confirmation becomes available.
The terminal remains attached to the retained movement extreme, while the alert reflects the later confirmation event.
This preserves the difference between terminal location and causal availability.
Features
Strengths
Terminal Extreme Preservation — the completed PEAK/TROUGH remains anchored to the retained movement endpoint.
Causal Availability — the corresponding confirmation remains separately visible where it actually became available.
Directional Context — the output describes continuing directional movement rather than isolated bar labels.
All-Markets Use — the framework can be applied across different markets because it is based on directional price structure.
Early Causal Exposure — the tool attempts to establish the retained terminal on the first qualifying confirmed transition.
Terminal-versus-Causal Comparison — completed movement and causally available movement remain directly comparable.
Broader Trading Context — the confirmed extrema provide directional, confirmation, filtering, and entry/exit context while retaining their underlying movement-extreme meaning.
Weaknesses
Confirmation Delay — the terminal can exist before enough opposite structure develops to confirm it.
Movement Before Confirmation — part of the next directional movement can occur before the causal confirmation becomes available.
Superseded Extremes — developing terminal candidates can be replaced by newer same-side extremes.
Standalone Trade Outcome Variability — confirmed PEAK/TROUGH extremes can remain structurally reliable movement references while the result of directly trading every confirmation as its own buy/sell action can vary substantially across market conditions.
Structural Dependence — confirmation timing depends on the selected structural requirements.
No Complete Trade Management — position sizing, risk management, stop placement, profit targets, and wider trade-management logic are separate from the movement-extreme output.
Who it’s for
This tool is suited for users interested in:
It is especially relevant when the question is not only:
“Where did the movement terminate?”
but also:
“When did that terminal become causally available?”
Known limitations
The final retained extreme cannot be confirmed until enough opposite structure has developed.
Some movement can therefore occur before confirmation.
Some developing terminal candidates can be superseded.
Some confirmation-to-confirmation cycles can be non-positive.
The distinction between the terminal and the causal confirmation is therefore explicitly preserved as part of the tool's output.
Final note
All-Markets Movement Extremes Tool identifies retained terminal PEAK/TROUGH extremes and exposes the causal confirmation of those extrema.
The terminal remains attached to the completed movement extreme.
The causal confirmation remains attached to the point where the required structure becomes available.
The relationship between those two references provides directional movement context for confirmation, filtering, cycle comparison, and broader trading-related evaluation.
Name:
All-Markets Movement Extremes Tool
Searchable Name:
All-Markets Movement Extremes Tool
Technical Name:
All-Markets Non-Repainting Terminal-to-Causal Directional Movement Extremes Tool
Short title:
Movement Extremes
Summary
All-Markets Movement Extremes Tool identifies terminal peaks and troughs within developing directional movement and preserves the causal confirmation that makes each retained extreme available.
The central difficulty is that a completed extreme and the generated signal capable of establishing that extreme are not necessarily available at the same time.
A trough can already exist before enough upward structure has developed to confirm that the downward movement terminated there.
A peak can already exist before enough downward structure has developed to confirm that the upward movement terminated there.
Price can therefore move meaningfully away from the terminal before the corresponding confirmation becomes available.
The tool is built around that separation.
During an active directional leg, the current extreme remains provisional and can be replaced by a newer same-side high or low.
Once the required opposite structure confirms, the retained extreme becomes:
- TROUGH for the completed low of the prior downward movement
- PEAK for the completed high of the prior upward movement
The terminal marker remains attached to the retained movement extreme.
The causal confirmation remains attached to the later bar where that extreme became confirmable.
This keeps two important references visible at the same time:
where the directional movement terminated
and
where the corresponding confirmation became available
The confirmed PEAK/TROUGH stream can therefore provide context for directional-movement trading, filtering, confirmation, and broader trading decisions, while the stream itself represents confirmed movement extremes and their causal availability rather than a complete standalone buy/sell signal.
The result is a directional-movement tool that provides:
- movement direction and transition context
- terminal peak/trough identification
- directional-movement trading context
- confirmation and filtering context
- entry/exit context
- movement-cycle review
- and comparison of completed movement with what became causally available
Terminal extremes
The script follows an active directional leg and retains its strongest extreme.
During an upward leg, the highest retained high remains the potential terminal PEAK.
During a downward leg, the lowest retained low remains the potential terminal TROUGH.
A newer same-side extreme can replace the previous candidate while that directional movement remains active.
The extreme becomes confirmed only after the required opposite structure develops.
This prevents a temporary move away from a high or low from automatically being treated as the completed terminal.
Causal confirmation
Every confirmed terminal has two important locations.
Terminal
The retained PEAK or TROUGH belonging to the completed directional movement.
Causal confirmation
The later confirmed-bar event where enough completed structure exists to establish that terminal.
The terminal shows where the completed movement ended.
The causal confirmation shows when the script could establish that terminal through its forward process.
Those two points can be close together or separated by several bars.
The optional Causal Confirmation Comparison makes that difference visible directly on the chart.
Earliest available confirmation
The tool attempts to expose a retained terminal on the first confirmed transition that satisfies its active structural requirements.
That does not move the historical terminal forward.
The PEAK or TROUGH remains attached to the completed movement extreme, while the causal marker remains attached to the later confirmation event.
This is what allows the tool to preserve both the final movement location and its actual causal availability.
Directional movement
The PEAK/TROUGH sequence forms a continuing directional structure.
A confirmed TROUGH establishes the completed low of the preceding downward movement.
A confirmed PEAK establishes the completed high of the preceding upward movement.
Consecutive opposite terminals describe the completed movement between retained extrema.
The tool can display those relationships with HOLD paths and directional backgrounds so the broader directional movement remains visible rather than reducing the chart to isolated labels.
Directional-movement trading context
The confirmed extremes and their causal transitions provide directional-movement context that can be examined alongside confirmation rules, filtering, entry/exit context, or other market-state methods.
The value of the output is the movement structure it establishes:
terminal extreme → causal confirmation → directional movement context
That structure remains available for broader trading-related evaluation without changing what the PEAK/TROUGH stream itself represents.
Movement cycles
Consecutive opposite confirmed extrema form completed directional cycles.
The tool keeps two reference systems available.
Terminal-to-terminal
The completed movement between retained extrema.
Confirmation-to-confirmation
The corresponding directional movement between the causal confirmation points.
These measurements can differ substantially because part of the terminal movement can occur before confirmation becomes available.
Last capture / confirm gap
The Movement Cycle page shows Last capture / confirm gap for the most recent completed cycle.
The capture value compares the latest completed terminal-to-terminal directional result with the corresponding confirmation-to-confirmation result when the terminal movement is positive.
The confirm gap shows the difference between those two completed-cycle results.
Together, they provide a compact comparison between the retained movement extremes and the corresponding causal confirmation references.
Unconfirmed context
Not every developing extreme becomes the retained terminal.
An earlier high can be superseded by a higher high.
An earlier low can be superseded by a lower low.
When enabled, the tool can expose this context separately from the confirmed PEAK/TROUGH sequence.
The optional Minimum Reversal Filter can also reject structural transitions that do not meet the selected movement requirement.
Current movement
For the latest confirmed extreme, the tool can compare:
- terminal price
- confirmation close
- current price
- terminal-to-confirm move
- price change from confirmation to current
- directional move from confirmation to current
- best move after confirmation
- and bars since confirmation
This provides a current directional reference after the extreme has been established.
Status pages
The tool includes four compact status pages:
- Summary
- Movement Cycle
- Timing
- Guide
Summary provides the broad state of confirmed extrema and completed movement cycles.
Movement Cycle focuses on the latest terminal, its confirmation, current movement, and the previous completed cycle.
Timing focuses on terminal-to-confirmation separation and structural timing.
Guide provides a compact interpretation of the active PEAK/TROUGH framework.
Alerts
Optional alerts are available for confirmed PEAK and TROUGH events.
The alert occurs when the causal confirmation becomes available.
The terminal remains attached to the retained movement extreme, while the alert reflects the later confirmation event.
This preserves the difference between terminal location and causal availability.
Features
- all-markets directional movement framework
- retained terminal PEAK identification
- retained terminal TROUGH identification
- causal confirmed-bar operation
- terminal-versus-confirmation separation
- Causal Confirmation Comparison
- Confirmed Hold Path
- Confirmed Hold Background
- movement-cycle tracking
- terminal-to-current directional movement
- confirm-to-current directional movement
- best move after confirm
- Last capture / confirm gap
- Unconfirmed Extreme Context
- Minimum Reversal Filter
- compact Summary, Movement Cycle, Timing, and Guide pages
- confirmed PEAK/TROUGH alerts
Strengths
Terminal Extreme Preservation — the completed PEAK/TROUGH remains anchored to the retained movement endpoint.
Causal Availability — the corresponding confirmation remains separately visible where it actually became available.
Directional Context — the output describes continuing directional movement rather than isolated bar labels.
All-Markets Use — the framework can be applied across different markets because it is based on directional price structure.
Early Causal Exposure — the tool attempts to establish the retained terminal on the first qualifying confirmed transition.
Terminal-versus-Causal Comparison — completed movement and causally available movement remain directly comparable.
Broader Trading Context — the confirmed extrema provide directional, confirmation, filtering, and entry/exit context while retaining their underlying movement-extreme meaning.
Weaknesses
Confirmation Delay — the terminal can exist before enough opposite structure develops to confirm it.
Movement Before Confirmation — part of the next directional movement can occur before the causal confirmation becomes available.
Superseded Extremes — developing terminal candidates can be replaced by newer same-side extremes.
Standalone Trade Outcome Variability — confirmed PEAK/TROUGH extremes can remain structurally reliable movement references while the result of directly trading every confirmation as its own buy/sell action can vary substantially across market conditions.
Structural Dependence — confirmation timing depends on the selected structural requirements.
No Complete Trade Management — position sizing, risk management, stop placement, profit targets, and wider trade-management logic are separate from the movement-extreme output.
Who it’s for
This tool is suited for users interested in:
- terminal market peaks and troughs
- directional movement trading
- movement-transition confirmation
- structural filtering
- entry/exit context
- causal versus completed movement
- terminal-to-terminal cycles
- confirmation timing
- Last capture / confirm gap
- and incorporating confirmed extrema into broader trading methods
It is especially relevant when the question is not only:
“Where did the movement terminate?”
but also:
“When did that terminal become causally available?”
Known limitations
The final retained extreme cannot be confirmed until enough opposite structure has developed.
Some movement can therefore occur before confirmation.
Some developing terminal candidates can be superseded.
Some confirmation-to-confirmation cycles can be non-positive.
The distinction between the terminal and the causal confirmation is therefore explicitly preserved as part of the tool's output.
Final note
All-Markets Movement Extremes Tool identifies retained terminal PEAK/TROUGH extremes and exposes the causal confirmation of those extrema.
The terminal remains attached to the completed movement extreme.
The causal confirmation remains attached to the point where the required structure becomes available.
The relationship between those two references provides directional movement context for confirmation, filtering, cycle comparison, and broader trading-related evaluation.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.