Purpose: This enhanced indicator combines Supertrend and MACD to signal potential trend changes. In addition, it now includes several extra filters for more reliable signals:
Multi-Timeframe (MTF) Confirmation: Checks a higher timeframe’s trend.
ADX (Momentum) Filter: Ensures the market is trending strongly.
Dynamic Factor Adjustment: Adapts the Supertrend sensitivity to current volatility.
Volume Filter: Verifies that current volume is above average.
Each filter can be enabled or disabled according to your preference.
How It Works: The Supertrend calculates dynamic support/resistance levels based on ATR and an adjustable factor, while MACD identifies momentum shifts via its crossovers. The additional filters then confirm whether the conditions meet your criteria for a trend change. If all enabled filters align, the indicator plots a shape and triggers an alert.
2. Supertrend Component with Dynamic Factor Base Factor & ATR Period: The Supertrend uses these inputs to compute its dynamic bands.
Dynamic Factor Toggle: When enabled, the factor is adjusted by comparing the current ATR to its simple moving average. This makes the indicator adapt to higher or lower volatility conditions, helping to reduce false signals.
3. MACD Component Parameters: Standard MACD settings (Fast MA, Slow MA, Signal Smoothing) determine the responsiveness of the MACD line. Crossovers between the MACD line and its signal line indicate potential trend reversals.
4. Multi-Timeframe (MTF) Filter Function: If enabled, the indicator uses a higher timeframe’s simple moving average (SMA) to confirm the prevailing trend.
Bullish Confirmation: The current close is above the higher timeframe SMA.
Bearish Confirmation: The current close is below the higher timeframe SMA.
5. ADX Filter (Momentum) Custom Calculation: Since the built-in ta.adx function may not be available, a custom ADX is calculated. This involves:
Determining positive and negative directional movements (DMs).
Smoothing these values to obtain +DI and -DI.
Calculating the DX and then smoothing it to yield the ADX.
Threshold: Only signals where the ADX exceeds the set threshold (default 20) are considered valid, ensuring that the market is trending strongly enough.
6. Volume Filter Function: Checks if the current volume exceeds the average volume (SMA) multiplied by a specified factor. This helps confirm that a price move is supported by sufficient trading activity.
7. Combined Signal Logic & Alerts Final Signal: A bullish signal is generated when:
MACD shows a bullish crossover,
Supertrend indicates an uptrend,
And all enabled filters (MTF, ADX, volume) confirm the signal.
The bearish signal is generated similarly in the opposite direction.
Alerts: Alert conditions are set so that TradingView can notify you via pop-up, email, or SMS when these combined conditions are met.
8. User Adjustments Toggle Filters: Use the on/off switches for MTF, ADX, and Volume filters as needed.
Parameter Tuning: Adjust the ATR period, base factor, higher timeframe settings, ADX period/threshold, and volume multiplier to match your trading style and market conditions.
Backtesting: Always backtest your settings to ensure that they perform well with your strategy.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
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.
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Untuk akses pantas pada carta, tambah skrip ini kepada kegemaran anda — ketahui lebih lanjut di sini.
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.