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.
В истинном духе TradingView автор этого скрипта опубликовал его с открытым исходным кодом, чтобы трейдеры могли понять, как он работает, и проверить на практике. Вы можете воспользоваться им бесплатно, но повторное использование этого кода в публикации регулируется Правилами поведения. Вы можете добавить этот скрипт в избранное и использовать его на графике.
Все виды контента, которые вы можете увидеть на TradingView, не являются финансовыми, инвестиционными, торговыми или любыми другими рекомендациями. Мы не предоставляем советы по покупке и продаже активов. Подробнее — в Условиях использования TradingView.