OPEN-SOURCE SCRIPT

Nadaraya-Watson: Envelope (Non-Repainting) With MacD

Unlock advanced technical analysis with the Nadaraya-Watson: Envelope (Non-Repainting) With MACD indicator.

Combining the robust smoothing capabilities of the Nadaraya-Watson estimator with the momentum insights of the MACD (Moving Average Convergence Divergence), this powerful tool offers precise trend detection, dynamic envelope boundaries, and actionable crossover signals—all while ensuring non-repainting reliability.

Key Features
  1. Nadaraya-Watson Estimator: Provides a smooth trend line (yhat_close) that effectively filters out market noise.
    Dynamic Envelopes: Utilizes ATR-based upper and lower boundaries that adapt to market volatility. MACD Integration: Incorporates customizable MACD settings to assess market momentum.
    Crossover Signals: Displays green crosses when the MACD signal line crosses above zero and red crosses when it crosses below zero.
    Non-Repainting: Ensures all signals are based on confirmed historical data, providing reliable and consistent indicators.
    Customizable Aesthetics: Offers extensive color and style options to match your charting preferences.


How to Use
  1. Trend Identification:
     - Observe the Nadaraya-Watson Estimator (yhat_close) to determine the underlying trend direction.
     - Use the envelope boundaries to identify potential support and resistance levels based on market volatility. Momentum Confirmation:
     - Analyze the MACD line, signal line, and histogram to assess market momentum and potential trend reversals.
     - Look for changes in the MACD histogram to identify strengthening or weakening momentum. Crossover Signals:
     - Green Cross (✗): Consider bullish trades when the MACD signal line crosses above zero, especially if the price is above the Nadaraya-Watson trend line.
     - Red Cross (✗): Consider bearish trades when the MACD signal line crosses below zero, especially if the price is below the Nadaraya-Watson trend line. Envelope Interaction:
     - Monitor price interactions with the upper and lower envelope boundaries to identify potential breakout or reversal opportunities.


Customization Options
  1. Kernel Settings: Adjust lookback window (h), relative weighting (alpha), and regression start bar (x_0) to tailor the estimator to different market conditions.
    MACD Settings: Modify fast and slow lengths, signal smoothing periods, and choose between SMA or EMA for moving averages.
    Envelope ATR Settings: Customize ATR length (atr_length) and near/far ATR factors (nearFactor & farFactor) to control envelope sensitivity.
    Color Settings: Select from a range of colors for trend lines, envelopes, and MACD components to enhance visual clarity.


I find that this works very well if you increase the 'timeframe' for the indicator to a higher time frame. Give this indicator a try!
Average True Range (ATR)Bands and ChannelsMoving Average Convergence / Divergence (MACD)nadarayawatson

Script open-source

Dans le plus pur esprit TradingView, l'auteur de ce script l'a publié en open-source, afin que les traders puissent le comprendre et le vérifier. Bravo à l'auteur! Vous pouvez l'utiliser gratuitement, mais la réutilisation de ce code dans une publication est régie par nos Règles. Vous pouvez le mettre en favori pour l'utiliser sur un graphique.

Vous voulez utiliser ce script sur un graphique ?


-=Gentleman Goat=- Download the TradingView Input Optimizer at tradingtools.software/optimizer
Discord: discord.gg/pGHHRczpbu
Aussi sur:

Clause de non-responsabilité