OPEN-SOURCE SCRIPT
Buying and Selling Pressure with Delta Volume

Script Name
"Buying and Selling Pressure with Delta Volume"
Purpose
The script is designed to analyse and visualise buying and selling pressure for each candle on a trading chart. It estimates the volume attributed to buying and selling within each candle and calculates the delta volume, which is the difference between buying and selling volume. This can help traders understand market dynamics and the balance of power between buyers and sellers.
Components
Volume Data:
The script uses the volume data from the current chart's timeframe.
Candle Spread:
The spread is calculated as the difference between the high and low prices of each candle.
Handling Doji Candles:
If the spread is zero (which can happen with Doji candles), it sets the spread to na (not available) to prevent division by zero errors.
Buying and Selling Pressure:
Buying Pressure: Estimated as the proportion of the candle's volume attributed to the price moving up from the low to the close.
Selling Pressure: Estimated as the proportion of the candle's volume attributed to the price moving down from the high to the close.
Delta Volume:
The difference between buying pressure and selling pressure, representing the net buying or selling volume for each candle.
Plotting
Buying Pressure:
Plotted as green histogram bars.
Selling Pressure:
Plotted as red histogram bars.
Delta Volume:
Plotted as blue histogram bars and a blue line, indicating the difference between buying and selling pressure.
A horizontal line at zero (grey colour) is added to help visualise positive and negative delta volume.
"Buying and Selling Pressure with Delta Volume"
Purpose
The script is designed to analyse and visualise buying and selling pressure for each candle on a trading chart. It estimates the volume attributed to buying and selling within each candle and calculates the delta volume, which is the difference between buying and selling volume. This can help traders understand market dynamics and the balance of power between buyers and sellers.
Components
Volume Data:
The script uses the volume data from the current chart's timeframe.
Candle Spread:
The spread is calculated as the difference between the high and low prices of each candle.
Handling Doji Candles:
If the spread is zero (which can happen with Doji candles), it sets the spread to na (not available) to prevent division by zero errors.
Buying and Selling Pressure:
Buying Pressure: Estimated as the proportion of the candle's volume attributed to the price moving up from the low to the close.
Selling Pressure: Estimated as the proportion of the candle's volume attributed to the price moving down from the high to the close.
Delta Volume:
The difference between buying pressure and selling pressure, representing the net buying or selling volume for each candle.
Plotting
Buying Pressure:
Plotted as green histogram bars.
Selling Pressure:
Plotted as red histogram bars.
Delta Volume:
Plotted as blue histogram bars and a blue line, indicating the difference between buying and selling pressure.
A horizontal line at zero (grey colour) is added to help visualise positive and negative delta volume.
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.