OPEN-SOURCE SCRIPT
On-Balance Volume (OBV) — Background Trend

What OBV Means
OBV stands for On-Balance Volume.
It’s a volume-based indicator that helps you see whether money is flowing into or out of a stock or index.
Think of OBV as a “running total” of buying and selling pressure.
⚙️ How It Works
OBV starts at zero and then adds or subtracts each day’s trading volume based on the day’s closing price:
If today’s close is higher than yesterday’s → OBV goes up by that day’s volume.
If today’s close is lower → OBV goes down by that day’s volume.
If the price is unchanged → OBV doesn’t move.
Over time, this creates a line that moves up and down with volume pressure.
📈 What OBV Tells You
Rising OBV → Buying Pressure
More volume is happening on up days.
It means traders are accumulating shares.
Often a bullish signal.
Falling OBV → Selling Pressure
More volume is happening on down days.
It means traders are distributing (selling) shares.
Often a bearish signal.
Flat OBV → No clear direction
Volume is balanced.
The market is waiting for a breakout.
🧠 How Traders Use It
Trend Confirmation:
When price goes up and OBV goes up too → the move is healthy and supported by volume.
If price goes up but OBV stays flat or falls → the move might be weak or false.
Divergences:
If price makes a new high but OBV doesn’t → it’s a warning that the trend may reverse soon.
Signal Line Crossovers (like your chart):
You can smooth OBV with an EMA (moving average).
When OBV crosses above its EMA → possible buy signal.
When OBV crosses below → possible sell signal.
🟢 In Simple Terms
OBV tells you “is the smart money buying or selling?”
Green / rising = buyers in control.
Red / falling = sellers in control.
It’s a quick way to confirm if price trends are backed by real trading activity — not just short-term noise.
OBV stands for On-Balance Volume.
It’s a volume-based indicator that helps you see whether money is flowing into or out of a stock or index.
Think of OBV as a “running total” of buying and selling pressure.
⚙️ How It Works
OBV starts at zero and then adds or subtracts each day’s trading volume based on the day’s closing price:
If today’s close is higher than yesterday’s → OBV goes up by that day’s volume.
If today’s close is lower → OBV goes down by that day’s volume.
If the price is unchanged → OBV doesn’t move.
Over time, this creates a line that moves up and down with volume pressure.
📈 What OBV Tells You
Rising OBV → Buying Pressure
More volume is happening on up days.
It means traders are accumulating shares.
Often a bullish signal.
Falling OBV → Selling Pressure
More volume is happening on down days.
It means traders are distributing (selling) shares.
Often a bearish signal.
Flat OBV → No clear direction
Volume is balanced.
The market is waiting for a breakout.
🧠 How Traders Use It
Trend Confirmation:
When price goes up and OBV goes up too → the move is healthy and supported by volume.
If price goes up but OBV stays flat or falls → the move might be weak or false.
Divergences:
If price makes a new high but OBV doesn’t → it’s a warning that the trend may reverse soon.
Signal Line Crossovers (like your chart):
You can smooth OBV with an EMA (moving average).
When OBV crosses above its EMA → possible buy signal.
When OBV crosses below → possible sell signal.
🟢 In Simple Terms
OBV tells you “is the smart money buying or selling?”
Green / rising = buyers in control.
Red / falling = sellers in control.
It’s a quick way to confirm if price trends are backed by real trading activity — not just short-term noise.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.