PROTECTED SOURCE SCRIPT

OBV OSCILLATOR [DIGGERDOG]

OBV OSCILLATOR [DIGGERDOG]

This Pine Script for TradingView titled "OBV OSCILLATOR [DIGGERDOG]" is designed to plot the On-Balance Volume (OBV) Oscillator with both a smoothed and an unsmoothed version, allowing you to visualize trends in volume flow. It also highlights bullish and bearish zones with background colors and shows key levels on the chart.

Here’s a breakdown of the script’s functionality:

### **Inputs:**
- **OBV Normalization Period** (`obvLength`): Default is 14 periods for the calculation of the highest and lowest OBV values.
- **OBV Smoothing** (`obvSmoothing`): Default is 9 periods, applying a moving average to smooth the OBV values.
- **OBV Upper Limit** (`obvUpperLimit`): Default is 50, used to determine bullish zones.
- **OBV Lower Limit** (`obvLowerLimit`): Default is 50, used to determine bearish zones.

### **Calculations:**
- **OBV (On-Balance Volume):**
- The script calculates cumulative OBV using the formula `ta.cum(close > close[1] ? volume : close < close[1] ? -volume : 0)`.

- **OBV Oscillator:**
- The OBV is normalized by calculating its position between the highest and lowest OBV values over the given period (`obvLength`).
- Formula: `obvOscillator = 100 * (obv - obvMin) / (obvMax - obvMin)`, which scales the OBV between 0 and 100.

- **Smoothed OBV:**
- The OBV is further smoothed using a simple moving average (SMA) over the `obvSmoothing` period.
- A separate OBV Oscillator is then calculated for the smoothed OBV using the same normalization formula.

### **Visuals:**
- **OBV Oscillator and Smoothed OBV:**
- The unsmoothed OBV Oscillator is plotted in **blue**.
- The smoothed OBV Oscillator is plotted in **red** with some transparency for easier differentiation.

- **Background Color:**
- The background turns **light green** when the OBV Oscillator is above the upper limit (bullish).
- The background turns **light red** when the OBV Oscillator is below the lower limit (bearish).

- **Key Levels:**
- A **gray dotted line** represents the middle value (50).
- **Green and red dotted lines** represent the upper and lower OBV limits, respectively.

### **Usage:**
- Use the OBV Oscillator to identify strong trends based on volume flow.
- The smoothed OBV Oscillator helps filter out noise and offers a more stable trend signal.
- The background color changes provide quick visual cues for bullish and bearish conditions.

If you need further modifications or explanation, feel free to ask!
Oscillators

受保护脚本

该脚本是闭源发布的,您可以自由使用它。您可以收藏它以在图表上使用。您无法查看或修改其源代码。

想在图表上使用此脚本?

免责声明