OPEN-SOURCE SCRIPT

Adaptive Pivot Zones MTF

4 087
█ OVERVIEW
Adaptive Pivot Zones MTF is a multi-timeframe trend analysis indicator based on dynamic zones calculated using pivot highs and pivot lows.

Instead of representing the trend with a single line, the indicator creates three levels inside the range between the last confirmed pivot low and pivot high. These levels form a dynamic zone whose position and width adapt to the current market structure.

The core of the indicator is the relationship between price and this zone. Depending on the selected mode, a trend change occurs either after price breaks the middle line of the zone or only after price exits the entire zone. This allows the user to choose between earlier direction changes or stronger confirmation of the move.

The indicator is designed as an MTF system. In addition to the current timeframe, two higher timeframes are analyzed. These can be selected automatically in proportion to the current TF or set manually. This helps assess whether a trend change on the lower timeframe is aligned with the broader market direction.

The central element of the signal system is Multi-Timeframe Agreement. Each trend change can be evaluated based on the agreement of 1, 2, or all 3 monitored timeframes. The higher the agreement, the stronger the directional confirmation the user receives.

The indicator also integrates automatic Entry, Stop Loss, and three Take Profit levels based on ATR or a fixed risk percentage. This combines market direction analysis with a visual representation of the potential Risk/Reward setup.

The result is a complete trend analysis system that combines dynamic pivot zones, multi-timeframe analysis, trend agreement confirmation, and automatic position management levels.

█ CONCEPTS
Pivot Zone
Pivot Zone is the foundation of the entire indicator and is used to determine the current market state.
The indicator uses confirmed pivot highs and pivot lows to define the current price range. Then, three levels are calculated inside this range according to the set values of Pivot Level 1, Pivot Level 2, and Pivot Level 3.
These levels form a dynamic zone that can be treated as an equilibrium area between the most recent significant market extremes.
Pivot Zone answers the question:
Where is the current market decision zone located?

Pivot Length
Pivot Length determines how many bars are required on each side to confirm a pivot high or pivot low.
A lower value results in more frequent pivot detection and faster adaptation of the zones to price changes, but it also increases the number of less significant pivots.
A higher value requires a more developed structure to confirm a pivot, so zones appear less often but represent more meaningful market points.
Smoothing Length additionally allows the calculated pivot levels to be smoothed.

Pivot Levels
The three pivot levels define the exact position of the zone inside the range between pivot low and pivot high.
Pivot Level 1 defines the first level of the zone, Pivot Level 2 its middle line, and Pivot Level 3 the third level.
The default setting of 0.3 / 0.5 / 0.7 creates three levels placed symmetrically around the middle of the range, but the user can adjust them freely.
The middle line has a special role because it can be used as the primary level that determines a trend change.

Trend State
Trend State determines whether the market is currently in a bullish or bearish state.
In Full Band mode, price must break above the upper boundary of the entire zone to become bullish, or below the lower boundary to become bearish.
In Mid Line mode, the direction changes as soon as price crosses the middle line of the zone.
This allows the sensitivity of the indicator to be adjusted to the analysis style:
• Mid Line → earlier direction changes
• Full Band → stronger confirmation of a zone breakout
An optional Neutral mode also allows a neutral state to be displayed when price is exactly at the decision level.

Multi-Timeframe Analysis
Adaptive Pivot Zones MTF analyzes not only the current timeframe but also two higher timeframes.
TF1 and TF2 can be selected automatically based on the current timeframe. The system proportionally chooses higher intervals so that the MTF structure can be applied across different market scales without the need to manually set each TF.
Alternatively, the user can switch MTF Mode to Manual and define Higher TF 1 and Higher TF 2 independently.
Multi-Timeframe Analysis answers the question:
Is the direction on my timeframe aligned with the higher market context?

TF1 & TF2 Zones
In addition to the current zone, the indicator can also display pivot channels from TF1 and TF2.
Each higher timeframe has its own zone with an upper and lower boundary and an optional middle line. The channel color changes according to the current trend of that timeframe.
Higher timeframe zones can be used as additional context, showing where the current price is located relative to the broader structure.

MTF Agreement
MTF Agreement determines the number of timeframes that confirm the same trend direction.
The system analyzes three timeframes:
• Current TF → current timeframe
• TF1 → first higher timeframe
• TF2 → second higher timeframe
As a result, a trend change can receive confirmation from 1, 2, or 3 timeframes.
For example:
• 1 TF → change visible only on the current timeframe
• 2 TF → current timeframe + one of the higher timeframes confirms the same direction
• 3 TF → all three timeframes indicate the same direction
It is the number of agreeing timeframes that decides which signals can be displayed.

█ FEATURES
Current TF Settings
• Pivot Length – number of bars required on each side to confirm a pivot high / pivot low.
• Smoothing Length – length of the SMA that smooths the pivot lines. A value of 1 means no smoothing.
• Pivot Level 1 / 2 / 3 – coefficients (0.0–1.0) that determine the position of the three lines inside the pivot low – pivot high range.
• Paint Bars (Mid Pivot) – colors the candles according to the current trend state of the current timeframe.

Current TF Style
• Line Width – thickness of the current timeframe pivot lines.
• Line Transparency – transparency of the pivot lines.
• Gradient Transparency – transparency of the gradient fill between the lines.

Current TF Colors
• Bullish Color / Bearish Color – colors of the lines and fill in bullish / bearish state.
• Use Neutral Color – enables a third, neutral state.
• Neutral Color – color used in the neutral state.

MTF Settings
• MTF Mode – Automatic (automatic selection of TF1 and TF2) or Manual.
• Higher TF 1 / Higher TF 2 – manual selection of higher timeframes (active only in Manual mode).

TF1 Style & Colors
• Show TF1 (lines + channel) – displays the upper and lower TF1 channel lines together with the fill.
• Show TF1 Mid Line – additionally shows the middle line of the TF1 zone.
• TF1 Line Width / Transparency / Gradient Transparency – appearance settings for the TF1 channel.
• TF1 Bullish / Bearish Color – colors of the TF1 channel depending on the trend.

TF2 Style & Colors
• Show TF2 (lines + channel) – displays the upper and lower TF2 channel lines together with the fill.
• Show TF2 Mid Line – additionally shows the middle line of the TF2 zone.
• TF2 Line Width / Transparency / Gradient Transparency – appearance settings for the TF2 channel.
• TF2 Bullish / Bearish Color – colors of the TF2 channel depending on the trend.

Signals
• Trend Change Based On – Mid Line (earlier signals) or Full Band (stronger confirmation).
• Show Buy/Sell Labels – displays signal labels on the chart.
• Show Label When 1 / 2 / 3 TF Agree – controls at what number of agreeing timeframes the signal is shown.
• Buy / Sell Label Color and Label Size – appearance of the signal labels.

TP/SL
• Show TP/SL Levels – draws Entry, Stop Loss, and Take Profit levels on an active signal that meets the TF agreement criteria.
• SL = ATR – when enabled, the SL distance is calculated based on ATR. When disabled, a fixed percentage is used.
• ATR Period for TP/SL – ATR period used for calculations.
• ATR Multiplier for SL / SL % from Entry – parameters that define the Stop Loss distance.
• RR for TP1 / TP2 / TP3 – Risk:Reward ratios for the three Take Profit levels.
• Show SL / TP1 / TP2 / TP3 Level – individual enabling of each level.

MTF Table
• Show Multi-Timeframe Table – displays a table with the trend state on the selected timeframes.
• Table Position / Text Size – position and text size of the table.
• Bull / Bear / Background / Header Colors – table color scheme.
• Show + TF (for each row) – individual enabling and selection of timeframes displayed in the table (5m, 15m, 30m, 1h, 2h, 4h, 8h, 12h, 1D, 1W, 2W).

█ APPLICATIONS
Trend direction analysis with MTF context
The indicator allows you to assess whether a direction change on the current timeframe is supported by higher timeframes. Signals with 2 or 3 TF confirmation have significantly higher informational value than signals visible only on the current chart.

Filtering signals from other indicators
It can be used as a classic trend indicator to filter signals from other indicators.

Risk and potential reward management
Automatic Entry, SL, and three TP levels allow you to immediately see the Risk/Reward setup on every trend change that meets the agreement criteria. This makes it easier to quickly decide on position size and targets.

█ NOTES
• Full Band mode generates fewer signals but with stronger confirmation of a full zone breakout. Mid Line mode reacts faster.
• The Multi-Timeframe table shows the current trend state on the selected timeframes and serves as quick context, not as an independent signal system.
• The indicator works best when combined with market structure analysis, key support/resistance levels, and other indicators such as momentum or volume.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.