PROTECTED SOURCE SCRIPT
Telah dikemas kini

Aqua MTF Trend Oscillator

30
——————————————————————————————————————————————————————————
The Aqua Multi-Timeframe (MTF) Trend Oscillator is a comprehensive momentum and trend analysis tool designed to synthesize
complex market dynamics into a single, intuitive oscillator. It moves beyond single-timeframe analysis by aggregating
trend information from up to five distinct, user-configurable sources—spanning different timeframes, symbols, and
moving average types.

--- CORE CONCEPT ---
The strength and direction of a trend are rarely uniform across all market perspectives. This indicator's core
principle is to quantify and weigh the trend's character from multiple angles simultaneously. By blending these
perspectives, it generates a composite score that reflects the overall "consensus" of trend momentum, providing
a more robust view than any single moving average could offer alone.

--- METHODOLOGY ---
The indicator's power lies in its sophisticated, multi-step normalization process for each analysis slot:

1. **MA Calculation:** A standard moving average (e.g., EMA, SMA) is calculated for the specified source, symbol, and timeframe.
2. **Volatility-Normalized Distance:** It first measures the deviation of price from its moving average in terms
of Average True Range (ATR) units. This volatility-normalization step is crucial for comparing trend strength
across different timeframes or instruments, as it measures distance in a context-aware manner.
3. **Magnitude Squashing:** This ATR-based distance is then passed through a hyperbolic tangent (`tanh`) squashing
function. This elegantly transforms the potentially unbounded measurement into a standardized score oscillating
between -1 (maximum bearish magnitude) and +1 (maximum bullish magnitude). This prevents extreme outliers in one
timeframe from disproportionately skewing the final result.
4. **Weighted Aggregation:** Each of these normalized (-1 to +1) scores is then combined based on a user-defined
weight. The weighted average of all enabled slots produces the final composite score.
5. **Final Scaling & Smoothing:** The composite score is scaled to oscillate between -100 and +100. An optional
final smoothing pass can be applied to this master line to reduce noise and clarify the overall trend.

All higher-timeframe calculations are performed correctly within their native context to ensure the indicator is
non-repainting and provides a stable, reliable output on the chart.

--- KEY FEATURES ---
• **Five Independent Analysis Slots:** Fully customize up to five sources, each with its own symbol, timeframe, MA type, period, and weight.
• **Advanced Normalization:** Utilizes ATR and the hyperbolic tangent function for robust, comparable trend magnitude scores.
• **Correct MTF Calculation:** Employs best practices for non-repainting data requests, ensuring historical and real-time results are consistent.
• **Weighted Composite Score:** Assign importance to different timeframes to tailor the oscillator to your specific analytical needs.
• **Optional Master Smoothing:** Apply a final MA to the composite score line for enhanced clarity and signal filtering.
• **Clear Visualization:** A simple, color-coded oscillator line shows the final trend score, while individual component trends can also be plotted.

--- HOW TO INTERPRET ---
• **Zero Line Cross:** A cross above 0 indicates that the weighted balance of trend components has shifted to bullish. A cross below 0 signals a shift to bearish.
• **Oscillator Magnitude:** Values approaching +100 suggest a strong, broad-based uptrend consensus. Values nearing -100 indicate a strong downtrend consensus.
• **Slope:** The slope of the oscillator line indicates the accelerating or decelerating nature of the aggregate trend momentum.
• **Divergence:** As with any oscillator, watch for divergences between price action and the oscillator, which can signal a potential exhaustion of the prevailing trend.

Author: Aquaritek
——————————————————————————————————————————————————————————
Nota Keluaran
Just updating the chart image
Nota Keluaran
Add validation for input timeframes

Implements a validation check to ensure that user-selected timeframes for all enabled MTF (Multi-Timeframe) slots are not lower than the current chart's timeframe.

Penafian

Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.