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

開源腳本

在真正的TradingView精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?


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

免責聲明