OPEN-SOURCE SCRIPT
PulseWave + Divergence

Overview
PulseWave + Divergence is a momentum oscillator designed to optimize the classic RSI. Unlike traditional RSI, which can produce delayed or noisy signals, PulseWave offers a smoother and faster oscillator line that better responds to changes in market dynamics. By using a formula based on the difference between RSI and its moving average, the indicator generates fewer false signals, making it a suitable tool for day traders and swing traders in stock, forex, and cryptocurrency markets.
How It Works
Generating the Oscillator Line
The PulseWave oscillator line is calculated as follows:
RSI is calculated based on the selected data source (default: close price) and RSI length (default: 20 periods).
RSI is smoothed using a simple moving average (MA) with a selected length (default: 20 periods).
The oscillator value is the difference between the current RSI and its moving average: oscillator = RSI - MA(RSI).
This approach ensures high responsiveness to short-term momentum changes while reducing market noise. Unlike other oscillators, such as standard RSI or MACD, which rely on direct price values or more complex formulas, PulseWave focuses on the dynamics of the difference between RSI and its moving average. This allows it to better capture short-term trend changes while minimizing the impact of random price fluctuations. The oscillator line fluctuates around zero, making it easy to identify bullish trends (positive values) and bearish trends (negative values).
Divergences
The indicator optionally detects bullish and bearish divergences by comparing price extremes (swing highs/lows) with oscillator extremes within a defined pivot window (default: 5 candles left and right). Divergences are marked with "Bull" (bullish) and "Bear" (bearish) labels on the oscillator chart.
Signals
Depending on the selected signal type, PulseWave generates buy and sell signals based on:
Crosses of the overbought and oversold levels.
Crosses of the oscillator’s zero line.
A combination of both (option "Both").
Signals are displayed as triangles above or below the oscillator, making them easy to identify.
Input Parameters
RSI Length: Length of the RSI used in calculations (default: 20).
RSI MA Length: Length of the RSI moving average (default: 20).
Overbought/Oversold Level: Oscillator overbought and oversold levels (default: 12.0 and -12.0).
Pivot Length: Number of candles used to detect extremes for divergences (default: 5).
Signal Type: Type of signals to display ("Overbought/Oversold", "Zero Line", "Both", or "None").
Colors and Gradients: Full customization of line, gradient, and label colors.
How to Use
Adjust Parameters:
Increase RSI Length (e.g., to 30) for high-volatility markets to reduce noise.
Decrease Pivot Length (e.g., to 3) for faster divergence detection on short timeframes.
Interpret Signals:
Buy Signal: The oscillator crosses above the oversold level or zero line, especially with a bullish divergence.
Sell Signal: The oscillator crosses below the overbought level or zero line, especially with a bearish divergence.
Combine with Other Tools:
Use PulseWave alongside moving averages or support/resistance levels to confirm signals.
Monitor Divergences:
"Bull" and "Bear" labels indicate potential trend reversals. Set up alerts to receive notifications for divergences.
PulseWave + Divergence is a momentum oscillator designed to optimize the classic RSI. Unlike traditional RSI, which can produce delayed or noisy signals, PulseWave offers a smoother and faster oscillator line that better responds to changes in market dynamics. By using a formula based on the difference between RSI and its moving average, the indicator generates fewer false signals, making it a suitable tool for day traders and swing traders in stock, forex, and cryptocurrency markets.
How It Works
Generating the Oscillator Line
The PulseWave oscillator line is calculated as follows:
RSI is calculated based on the selected data source (default: close price) and RSI length (default: 20 periods).
RSI is smoothed using a simple moving average (MA) with a selected length (default: 20 periods).
The oscillator value is the difference between the current RSI and its moving average: oscillator = RSI - MA(RSI).
This approach ensures high responsiveness to short-term momentum changes while reducing market noise. Unlike other oscillators, such as standard RSI or MACD, which rely on direct price values or more complex formulas, PulseWave focuses on the dynamics of the difference between RSI and its moving average. This allows it to better capture short-term trend changes while minimizing the impact of random price fluctuations. The oscillator line fluctuates around zero, making it easy to identify bullish trends (positive values) and bearish trends (negative values).
Divergences
The indicator optionally detects bullish and bearish divergences by comparing price extremes (swing highs/lows) with oscillator extremes within a defined pivot window (default: 5 candles left and right). Divergences are marked with "Bull" (bullish) and "Bear" (bearish) labels on the oscillator chart.
Signals
Depending on the selected signal type, PulseWave generates buy and sell signals based on:
Crosses of the overbought and oversold levels.
Crosses of the oscillator’s zero line.
A combination of both (option "Both").
Signals are displayed as triangles above or below the oscillator, making them easy to identify.
Input Parameters
RSI Length: Length of the RSI used in calculations (default: 20).
RSI MA Length: Length of the RSI moving average (default: 20).
Overbought/Oversold Level: Oscillator overbought and oversold levels (default: 12.0 and -12.0).
Pivot Length: Number of candles used to detect extremes for divergences (default: 5).
Signal Type: Type of signals to display ("Overbought/Oversold", "Zero Line", "Both", or "None").
Colors and Gradients: Full customization of line, gradient, and label colors.
How to Use
Adjust Parameters:
Increase RSI Length (e.g., to 30) for high-volatility markets to reduce noise.
Decrease Pivot Length (e.g., to 3) for faster divergence detection on short timeframes.
Interpret Signals:
Buy Signal: The oscillator crosses above the oversold level or zero line, especially with a bullish divergence.
Sell Signal: The oscillator crosses below the overbought level or zero line, especially with a bearish divergence.
Combine with Other Tools:
Use PulseWave alongside moving averages or support/resistance levels to confirm signals.
Monitor Divergences:
"Bull" and "Bear" labels indicate potential trend reversals. Set up alerts to receive notifications for divergences.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.