OPEN-SOURCE SCRIPT
已更新 OBV Structure Oscillator [OBVSO]

# OBV Structure Oscillator [OBVSO]
## Description
**OBV Structure Oscillator [OBVSO]** is an extension of the classic On-Balance Volume Oscillator concept, designed to make **volume-pressure structure and directional changes** easier to read on a consistent scale.
Instead of displaying the raw OBV Oscillator, whose numerical scale can vary significantly depending on an instrument's volume characteristics, OBVSO transforms the oscillator into a bounded **0–100 range**, with **50 representing the neutral midpoint**.
### Calculation
OBVSO begins by calculating On-Balance Volume (OBV) and then creates an oscillator by comparing OBV with its EMA:
**OBV Oscillator = OBV − EMA(OBV)**
The resulting oscillator is then symmetrically normalized using its highest absolute amplitude over the selected *Normalization Lookback*.
The final result is bounded between:
* **50** = neutral oscillator level
* **Above 50** = relatively positive OBV pressure
* **Below 50** = relatively negative OBV pressure
* **70 and 30** = upper and lower structural reference zones
The 70/30 zones are not intended to represent conventional overbought/oversold signals or automatic reversal levels. They are primarily visual reference zones for evaluating the strength and structure of OBV movement.
### Display Smoothing
**Display Smoothing** applies an optional EMA to the OBVSO line displayed on the chart.
Its purpose is purely to improve visual readability when the normalized oscillator becomes excessively sharp or fragmented.
A value of **1** preserves the normalized OBV Oscillator without additional display smoothing.
### OBV Signal
OBVSO also includes an independent **OBV Signal** calculated directly from the normalized oscillator **before Display Smoothing is applied**.
This separates the two functions:
* **Display Smoothing** → improves visual readability of the oscillator structure.
* **OBV Signal** → provides a reference for the underlying directional trend of the oscillator.
Available OBV Signal smoothing methods:
* SMA
* EMA
* SMMA (RMA)
* WMA
* VWMA
The default setting is **SMA 13**.
Because the OBV Signal is calculated from the oscillator before Display Smoothing, increasing Display Smoothing does not create a double-smoothed signal.
### Visual Structure
OBVSO includes:
* Customizable positive and negative oscillator colors.
* Positive upper gradient.
* Negative lower gradient.
* Neutral midpoint at 50.
* 70/30 structural reference zones.
* Independent OBV Signal.
The indicator is primarily intended for **OBV structure analysis**, including changes in volume momentum, strengthening or weakening pressure, and oscillator structures such as higher lows, higher highs, lower highs, and lower lows.
OBVSO does not generate automatic buy or sell signals. Its readings are best interpreted together with price structure, trend, support/resistance, volume, or other confirmation tools.
## Credits
The core OBV Oscillator concept used in this indicator was inspired by **LazyBear's On Balance Volume Oscillator**, which evaluates OBV relative to a moving average of OBV.
Special thanks to **LazyBear** for sharing the original OBV Oscillator implementation as open-source code with the TradingView community.
OBVSO extends that concept with symmetric 0–100 normalization, a neutral midpoint at 50, bounded structural zones, independent display smoothing, configurable gradient visualization, and a separately calculated OBV trend signal.
---
# Release Notes — v1.0
**Initial Public Open-Source Release — OBV Structure Oscillator [OBVSO]**
* Built with Pine Script® v6.
* Uses the core OBV Oscillator concept inspired by LazyBear.
* Added symmetric normalization to a 0–100 scale.
* Added a neutral midpoint at 50.
* Added configurable Normalization Lookback.
* Added 70/30 structural reference zones.
* Added positive and negative gradient visualization.
* Added customizable positive and negative oscillator colors.
* Added EMA-based Display Smoothing for improved structural readability.
* Display Smoothing affects only the displayed oscillator line.
* Added an independent OBV Signal.
* OBV Signal is calculated from the normalized/bounded OBV Oscillator before Display Smoothing.
* Added SMA, EMA, SMMA (RMA), WMA, and VWMA signal options.
* Default OBV Signal is SMA 13.
* Added a separately configurable OBV Signal color.
* Reorganized the code into clearer settings, calculation, visualization, and smoothing-signal sections.
The primary goal of this release is to make OBV Oscillator structure easier to compare across periods while preserving the underlying behavior of the original OBV-based oscillator.
## Description
**OBV Structure Oscillator [OBVSO]** is an extension of the classic On-Balance Volume Oscillator concept, designed to make **volume-pressure structure and directional changes** easier to read on a consistent scale.
Instead of displaying the raw OBV Oscillator, whose numerical scale can vary significantly depending on an instrument's volume characteristics, OBVSO transforms the oscillator into a bounded **0–100 range**, with **50 representing the neutral midpoint**.
### Calculation
OBVSO begins by calculating On-Balance Volume (OBV) and then creates an oscillator by comparing OBV with its EMA:
**OBV Oscillator = OBV − EMA(OBV)**
The resulting oscillator is then symmetrically normalized using its highest absolute amplitude over the selected *Normalization Lookback*.
The final result is bounded between:
* **50** = neutral oscillator level
* **Above 50** = relatively positive OBV pressure
* **Below 50** = relatively negative OBV pressure
* **70 and 30** = upper and lower structural reference zones
The 70/30 zones are not intended to represent conventional overbought/oversold signals or automatic reversal levels. They are primarily visual reference zones for evaluating the strength and structure of OBV movement.
### Display Smoothing
**Display Smoothing** applies an optional EMA to the OBVSO line displayed on the chart.
Its purpose is purely to improve visual readability when the normalized oscillator becomes excessively sharp or fragmented.
A value of **1** preserves the normalized OBV Oscillator without additional display smoothing.
### OBV Signal
OBVSO also includes an independent **OBV Signal** calculated directly from the normalized oscillator **before Display Smoothing is applied**.
This separates the two functions:
* **Display Smoothing** → improves visual readability of the oscillator structure.
* **OBV Signal** → provides a reference for the underlying directional trend of the oscillator.
Available OBV Signal smoothing methods:
* SMA
* EMA
* SMMA (RMA)
* WMA
* VWMA
The default setting is **SMA 13**.
Because the OBV Signal is calculated from the oscillator before Display Smoothing, increasing Display Smoothing does not create a double-smoothed signal.
### Visual Structure
OBVSO includes:
* Customizable positive and negative oscillator colors.
* Positive upper gradient.
* Negative lower gradient.
* Neutral midpoint at 50.
* 70/30 structural reference zones.
* Independent OBV Signal.
The indicator is primarily intended for **OBV structure analysis**, including changes in volume momentum, strengthening or weakening pressure, and oscillator structures such as higher lows, higher highs, lower highs, and lower lows.
OBVSO does not generate automatic buy or sell signals. Its readings are best interpreted together with price structure, trend, support/resistance, volume, or other confirmation tools.
## Credits
The core OBV Oscillator concept used in this indicator was inspired by **LazyBear's On Balance Volume Oscillator**, which evaluates OBV relative to a moving average of OBV.
Special thanks to **LazyBear** for sharing the original OBV Oscillator implementation as open-source code with the TradingView community.
OBVSO extends that concept with symmetric 0–100 normalization, a neutral midpoint at 50, bounded structural zones, independent display smoothing, configurable gradient visualization, and a separately calculated OBV trend signal.
---
# Release Notes — v1.0
**Initial Public Open-Source Release — OBV Structure Oscillator [OBVSO]**
* Built with Pine Script® v6.
* Uses the core OBV Oscillator concept inspired by LazyBear.
* Added symmetric normalization to a 0–100 scale.
* Added a neutral midpoint at 50.
* Added configurable Normalization Lookback.
* Added 70/30 structural reference zones.
* Added positive and negative gradient visualization.
* Added customizable positive and negative oscillator colors.
* Added EMA-based Display Smoothing for improved structural readability.
* Display Smoothing affects only the displayed oscillator line.
* Added an independent OBV Signal.
* OBV Signal is calculated from the normalized/bounded OBV Oscillator before Display Smoothing.
* Added SMA, EMA, SMMA (RMA), WMA, and VWMA signal options.
* Default OBV Signal is SMA 13.
* Added a separately configurable OBV Signal color.
* Reorganized the code into clearer settings, calculation, visualization, and smoothing-signal sections.
The primary goal of this release is to make OBV Oscillator structure easier to compare across periods while preserving the underlying behavior of the original OBV-based oscillator.
發行說明
Updated the publication chart for a cleaner presentation.No changes to indicator calculations or behavior.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。