OPEN-SOURCE SCRIPT

Cumulative Volume Distribution Spread Intrabar with Bands

Updated Description:
This script, "Cumulative Volume Spread by Levels with Histogram", analyzes cumulative buying and selling pressure at various price levels of each bar, based on intra-bar data from a lower timeframe (like 1-second bars). It visualizes the results using lines, histograms, and color-filled areas.

Key Concepts:
Price Levels: The script splits each bar into four distinct levels:

High to max(open, close): The range from the highest price of the bar to the higher of the open or close prices.
Max(open, close) to midline: The range from the higher of the open or close to the midpoint of the bar.
Midline to min(open, close): The range from the midpoint to the lower of the open or close.
Min(open, close) to low: The range from the lower of the open or close to the lowest price of the bar.
Volume Pressures:

The script fetches volume data from a lower timeframe (default is 1-second bars) to capture intra-bar buying and selling pressure.
Buying Pressure: Calculated when the close is greater than the open.
Selling Pressure: Calculated when the close is less than the open.
Cumulative Pressures:

The script accumulates buy and sell volumes within each of the four price levels described above.
At the beginning of a new day, these cumulative values are reset.
Spread Calculation:

For each level, the script calculates the spread between cumulative buying and selling volumes (i.e., buy pressure minus sell pressure). A positive spread indicates more buying pressure, and a negative spread indicates more selling pressure.



The script calculates an Exponential Moving Average (EMA) of the spread changes for each section:
EMA Spread High to Max Open/Close
EMA Spread Max Open/Close to Midline
EMA Spread Midline to Min Open/Close
EMA Spread Min Open/Close to Low
Fill Between Levels:

The areas between the key price levels are filled based on whether the EMA of the spread is positive (green) or negative (red). This helps to visually indicate where buying or selling pressure is stronger.
Background Color:

The script determines an overall background color based on the relative strength of cumulative buying vs. selling pressure. If cumulative buying pressure is stronger across the levels, the background turns green; if selling pressure dominates, it turns red.
Cycles

오픈 소스 스크립트

진정한 TradingView 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항