Description
THE IDEA
A moving average that adapts to the development of a trend instead of forcing the trend into a fixed period.
THE PROBLEM
Most moving averages require a fixed lookback period.
But trends do not develop in fixed durations.
A short period reacts quickly, but can be easily disturbed by short-term movement.
A long period smooths more noise, but can lag badly when price moves strongly.
The problem is not choosing the βrightβ period.
The problem is that the period itself is fixed while the trend is constantly developing.
THE CORE CONCEPT: THE TREND SETS THE PERIOD. THE MA ADAPTS TO IT.
Traditional moving averages make the period the primary reference.
Supertrend Moving Average makes the trend structure the primary reference.
Instead of asking:
βWhich fixed MA period should I use?β
the indicator asks:
βHow has the current trend developed so far?β
The trend determines where the adaptive MA begins and how its effective length develops over time.
When a new trend begins, the MA is anchored to the structural extreme of the preceding trend and develops forward from that point. As the new trend continues, the effective period grows with the number of bars that have developed from the anchor.
The trend sets the structure. The MA adapts to it.
WHAT IT DOES
The indicator dynamically adapts its effective MA length according to the development of the current trend.
A newly identified trend begins with a shorter effective length, allowing the MA to respond more quickly.
As the trend continues, the effective length becomes longer, allowing the MA to become progressively smoother.
The MA is not simply calculated from a fixed number of recent bars. Its calculation develops from a structural anchor established by the preceding trend.
When the trend changes, the structural reference resets and a new adaptive measurement begins.
This creates a moving average that changes its behavior according to what the trend has already done.
It does not try to predict how long the next trend will last.
It adapts to the duration and structure that have already developed.
HOW IT WORKS
- Supertrend identifies the current trend and its structural transition.
- The indicator identifies the extreme close of the preceding trend.
- That structural extreme becomes the anchor for the adaptive MA.
- As the new trend develops, the number of bars from the anchor determines the MA's effective length.
- The MA recalculates using that developing length.
- When the trend changes, the structural reference resets and the process begins again.
The adaptive length can be combined with different moving-average calculation methods.
TWO VIEWS OF THE TREND
The indicator provides two Supertrend references:
Structural Supertrend
A broader trend reference designed to capture larger structural changes while being less sensitive to short-term price volatility.
Original Supertrend
A more reactive reference that responds more quickly to price movement and can reveal shorter-term momentum shifts within the broader trend.
The two views are not intended as automatic signals.
Their relationship provides additional context about how the trend is developing.
When both references move together, they provide a clearer view of directional alignment.
When they diverge, the difference can provide context for corrections, transitions, or shorter-term movement within the broader trend.
The Original Supertrend (dotted) is drawn only on bars where it differs from the Structural one, so divergence stands out. Each view can be shown or hidden independently.
MULTI-TIMEFRAME CONTEXT
The trend used to control the MA does not have to come from the current chart timeframe.
For example, a Daily trend can control an adaptive moving average displayed on an H1 chart.
This allows the higher-timeframe trend to define the measurement behavior while the lower timeframe provides a more detailed view of price development.
Multi-timeframe (MTF) covers three outputs, each independently switchable:
- Moving Average β the adaptive MA is driven by the HTF trend.
- Supertrend β Structural and Original Supertrend are calculated on HTF bars and mapped to the chart. They update on every tick while the HTF bar is still forming.
- Swing Points β swings and automatic S/R are calculated on HTF bars. Markers sit at the actual price extreme inside the HTF bar, and sweep, flip, and invalidation are evaluated when the HTF bar closes. S/R labels and line endpoints still update on every chart bar.
The Multi-timeframe parameter group contains Enable, Timeframe, and one switch each for Moving Average, Supertrend, and Swing Points. MTF is off by default; once enabled, all three outputs use the selected timeframe unless you switch them off individually.
The MTF timeframe can be higher than, equal to, or lower than the chart timeframe. When it is lower than or equal to the chart timeframe, each chart bar uses the last HTF bar inside it (the value at chart bar close), and swing markers sit on the chart bar that contains the open of the HTF bar.
Note: the HTF MA evaluates each HTF bar when it first appears, so it does not change while that bar is still forming.
AUTOMATIC HISTORY LOADING
The HTF MA needs enough chart history to rebuild the higher-timeframe trend. When the chart has too few bars, the indicator requests more history by itself and repeats until the requirement is met.
A warning on the chart ("Load N more bars") appears only as a last resort: when no more history is available, the last request added nothing, the request timed out, or the requirement is very large.
OPTIONAL SWING CONTEXT
The indicator can also display swing information such as:
- HH / HL / LH / LL
- Swing strength
- Swing zones and automatic Support/Resistance
- Swing polarity
- Swing relationships
These provide additional price geometry around the adaptive MA without changing its core calculation.
Swing Points and S/R toggle independently (S/R requires Swing Points). Your S/R choice is kept while Swing Points is off and applies again when you turn it back on.
OUTPUT DISPLAY
Choose exactly what is drawn: MA, Structural Supertrend, Original Supertrend, Swings, and Support/Resistance. By default MA, Structural, and Original are on; Swings and S/R are off.
- Hiding an output also skips its calculation. With MA off, all MA work (native and HTF, including loading HTF bars) is skipped; with Swings off, swing detection and rendering are skipped.
- The dotted Original Supertrend still appears only where it differs from the Structural one, even when the Structural line is hidden.
- Swing Offset ranges from -100 to -1 (default -1). Showing or hiding S/R is controlled by the S/R toggle.
ON-CHART CONTROLS
Change what you see without reopening the parameter dialog:
- Output Display β checkboxes for MA, Structural Supertrend, Original Supertrend, Swings, and Support/Resistance. At least one of MA, Structural Supertrend, Original Supertrend, or Swings stays checked.
- MTF β On/Off, HTF timeframe, and MTF Output (MA, Supertrend, Swings; at least one stays checked). Changes apply immediately, without reloading the indicator: the MA, Supertrend, and swings are rebuilt as needed.
- Swing controls β detection mode, label display, and S/R offset. When Swings is off they are hidden and swing and S/R objects are removed from the chart; the offset buttons appear only when both Swings and S/R are on.
- Reset button (βΊ) β restores every control, including MTF and swing controls, to the parameter dialog values.
- Saved settings β on-chart choices (including MTF and swing controls) are saved per symbol and Instance ID and restored next time. If you change a parameter in the dialog, that value takes priority over the saved one.
- Instance ID β use different IDs to keep separate settings for several instances on the same symbol.
- Toggling β turning MA on rebuilds it (native and HTF) and turning it off clears it. Toggling either Supertrend only refreshes its own output.
WHAT YOU CAN OBSERVE
The indicator is designed to make several things visible:
- Current trend direction
- Trend duration
- Changes in trend structure
- Pullbacks and corrections
- Continuation after corrections
- Higher-timeframe context
- Changes in price behavior around the adaptive mean
The MA is a measurement tool, not a standalone buy/sell system.
BUILT FOR ADAPTIVE MEASUREMENT
The purpose is not to find one perfect MA period.
It is to remove the assumption that one fixed period should remain appropriate throughout the life of a trend.
A new trend and a mature trend are different stages of the same movement.
The moving average adapts to that development instead of treating both stages the same way.
The goal is not to continually optimize a fixed MA period. The period develops automatically from the trend structure and the price movement that has already occurred.
KEY FEATURES
- Trend-structure-based adaptive MA
- Structural anchor based on the preceding trend's extreme close
- Effective MA length develops with the new trend
- Automatic structural reset when the trend changes
- Multiple MA calculation methods
- Structural Supertrend view
- Original Supertrend view
- Context between structural and reactive trend views
- Optional swing information and automatic S/R
- HH / HL / LH / LL classification
- Swing strength and zones
- Multi-timeframe for MA, Supertrend, and Swing Points, each independent
- HTF can be lower than, equal to, or higher than the chart timeframe
- Live HTF Supertrend while the HTF bar is forming
- Output Display and MTF controls directly on the chart
- Reset button, saved settings, and Instance ID
- Automatic chart history loading for the HTF MA
- Customizable display
GOOD TO KNOW
- The HTF MA evaluates each HTF bar once, when it first appears, so it does not change while that bar is still forming. HTF Supertrend does update live.
- The "Load N more bars" warning and automatic history loading apply to the HTF MA only.
- Swing spacing is a fixed pip value, so on HTF swings the marker offset may look small.
- Swing recalculation runs on the UI thread, so charts with very long history may freeze briefly when swings are recalculated.
- Swings trimmed from the 100-swing history keep their chart objects.
---
This indicator is a tool for market analysis and does not provide financial advice or guarantee trading results.
Summary
The indicator integrates dual Supertrend analyses: a Structural Supertrend that identifies major trend direction by filtering out noise and confirming genuine directional changes, and the Original Supertrend that highlights momentum shifts within the trend. Comparing these two provides context for distinguishing strong trend continuation from corrective movements.
Key features include:
- Adaptive anchor-based moving averages with options for Simple, Exponential, or Arnaud Legoux (ALMA) types.
- Multi-timeframe capability to apply higher timeframe Supertrend context on lower timeframe charts.
- Integrated swing detection with configurable modes and strength classification.
- Color-coded trend lines and swing markers for clear visual interpretation.
This tool is suited for trend and swing traders, multi-timeframe analysts, and discretionary traders seeking a structural framework to track trend development and market rhythm objectively. It emphasizes market structure and context over fixed signals, supporting clearer interpretation of price behavior.
Customer reviews
5 | 67 % | |
4 | 33 % | |
3 | 0 % | |
2 | 0 % | |
1 | 0 % |
