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 de código abierto

Siguiendo fielmente el espíritu de TradingView, el autor de este script lo ha publicado en código abierto, permitiendo que otros traders puedan entenderlo y verificarlo. ¡Olé por el autor! Puede utilizarlo de forma gratuita, pero tenga en cuenta que la reutilización de este código en la publicación se rige por las Normas internas. Puede añadir este script a sus favoritos y usarlo en un gráfico.

¿Quiere utilizar este script en un gráfico?


-=Gentleman Goat=- Download the TradingView Input Optimizer at tradingtools.software/optimizer
Discord: discord.gg/pGHHRczpbu
También en:

Exención de responsabilidad