OPEN-SOURCE SCRIPT
Rolling Volume Boxes

█ OVERVIEW
Rolling Volume Boxes is an indicator that visualizes high-volume zones on the chart in the form of dynamic volume “boxes.” Each box splits volume into bullish and bearish parts, allowing you to assess the dominance of buyers or sellers.
Thanks to the pseudo-volume option, the indicator can also be used on markets where real volume data is unavailable, although results may slightly differ.
The indicator is also suitable for trend analysis and identifying signs of trend weakening – everything depends on box parameters such as their size, moving average length, and multiplier.
█ CONCEPT
The indicator was created as a universal tool offering a non-standard market perspective. It combines volume analysis with trend structure and dynamic support and resistance levels.
Boxes are built using a rolling window of a fixed number of candles defined by the Bars per Box parameter. For each completed window, the indicator calculates the average volume of the entire group of candles and compares it to the volume moving average multiplied by the selected multiplier. A box is created only when this condition is met, meaning that zones appear exclusively in areas where aggregated volume for the whole box is significantly above average. The volume filter is therefore applied to the complete structure, not to individual candles.
Boxes do not overlap. A new box can be formed only after the previous one has fully ended, which keeps the market structure clean and prevents stacking or repainting. Each box always represents a separate and independent volume event.
Inside every box, candle volume is split into bullish and bearish parts. Green candles assign volume to buyers, while red candles assign volume to sellers. This method does not use classic candle delta, but instead builds a clear picture of dominance inside the zone.
Additionally, a Weighted Center is calculated for each box. It represents the true volume equilibrium level within the zone and often acts as a dynamic reaction point for price.
█ FEATURES
Data source
The indicator can use:
- candle volume
- pseudo volume (candle body size)
Calculations
- volume moving average (SMA)
- volume aggregation into boxes
- bullish / bearish volume split
- Weighted Center calculation
Visualization
- volume boxes (bullish / bearish)
- box boundary lines (high / low), extended to the right and removed after breakout
- dashed Weighted Center line, removed after breakout or after a defined number of bars
- labels showing bullish and bearish percentages
- graphical breakout signals
Alerts
- Box Breakout Up
- Box Breakout Down
- Weighted Center Up
- Weighted Center Down
█ HOW TO USE
Adding the indicator
Paste the code into Pine Editor or search for “Rolling Volume Boxes.”
Main settings
- Bars per Box – number of candles per box
- SMA Length – volume moving average length
- Multiplier – zone detection sensitivity
- Use Pseudo Volume – enable pseudo volume
- Show Labels – percentage labels
Key elements are box boundary lines and the Weighted Center line. They are extended to the right, disappear automatically after price breaks them, and act as dynamic market reaction levels.
█ APPLICATION
High-volume zones
Box levels often later become natural support and resistance levels.
Consolidations and ranges
With larger boxes, their boundaries often define the price range. If no breakout occurs for several candles after a box is formed, the probability of sideways movement increases – range trading may be considered.
Breakout trading
Breaking the upper or lower box boundary may signal:
- trend continuation
- the start of a new impulse
Trend analysis
In a strong trend, the internal structure of boxes helps detect decreasing dominance of one side and increasingly balanced proportions, which often acts as an early warning of trend weakening.
Combining with other tools
The indicator works best together with:
- trend indicators
- price levels (pivots, S/R)
- momentum oscillators
Example
- price approaches resistance + momentum weakens
→ in this situation, it is worth considering whether to open a position in line with the dominant trend or, alternatively, wait for a potential trend reversal
█ NOTES
- on markets without volume data, enable pseudo volume
- not a standalone trading indicator
- best results are achieved when used in market context
This indicator may not work properly on certain markets, especially on indices, synthetic instruments and all assets where volume and candle data are aggregated or artificially constructed (e.g. market cap indices, CFD, composite tickers).
In such cases, volume does not reflect real market activity and candles are not based on actual transactions, which makes the boxes lose their analytical value and potentially become misleading.
Rolling Volume Boxes is an indicator that visualizes high-volume zones on the chart in the form of dynamic volume “boxes.” Each box splits volume into bullish and bearish parts, allowing you to assess the dominance of buyers or sellers.
Thanks to the pseudo-volume option, the indicator can also be used on markets where real volume data is unavailable, although results may slightly differ.
The indicator is also suitable for trend analysis and identifying signs of trend weakening – everything depends on box parameters such as their size, moving average length, and multiplier.
█ CONCEPT
The indicator was created as a universal tool offering a non-standard market perspective. It combines volume analysis with trend structure and dynamic support and resistance levels.
Boxes are built using a rolling window of a fixed number of candles defined by the Bars per Box parameter. For each completed window, the indicator calculates the average volume of the entire group of candles and compares it to the volume moving average multiplied by the selected multiplier. A box is created only when this condition is met, meaning that zones appear exclusively in areas where aggregated volume for the whole box is significantly above average. The volume filter is therefore applied to the complete structure, not to individual candles.
Boxes do not overlap. A new box can be formed only after the previous one has fully ended, which keeps the market structure clean and prevents stacking or repainting. Each box always represents a separate and independent volume event.
Inside every box, candle volume is split into bullish and bearish parts. Green candles assign volume to buyers, while red candles assign volume to sellers. This method does not use classic candle delta, but instead builds a clear picture of dominance inside the zone.
Additionally, a Weighted Center is calculated for each box. It represents the true volume equilibrium level within the zone and often acts as a dynamic reaction point for price.
█ FEATURES
Data source
The indicator can use:
- candle volume
- pseudo volume (candle body size)
Calculations
- volume moving average (SMA)
- volume aggregation into boxes
- bullish / bearish volume split
- Weighted Center calculation
Visualization
- volume boxes (bullish / bearish)
- box boundary lines (high / low), extended to the right and removed after breakout
- dashed Weighted Center line, removed after breakout or after a defined number of bars
- labels showing bullish and bearish percentages
- graphical breakout signals
Alerts
- Box Breakout Up
- Box Breakout Down
- Weighted Center Up
- Weighted Center Down
█ HOW TO USE
Adding the indicator
Paste the code into Pine Editor or search for “Rolling Volume Boxes.”
Main settings
- Bars per Box – number of candles per box
- SMA Length – volume moving average length
- Multiplier – zone detection sensitivity
- Use Pseudo Volume – enable pseudo volume
- Show Labels – percentage labels
Key elements are box boundary lines and the Weighted Center line. They are extended to the right, disappear automatically after price breaks them, and act as dynamic market reaction levels.
█ APPLICATION
High-volume zones
Box levels often later become natural support and resistance levels.
Consolidations and ranges
With larger boxes, their boundaries often define the price range. If no breakout occurs for several candles after a box is formed, the probability of sideways movement increases – range trading may be considered.
Breakout trading
Breaking the upper or lower box boundary may signal:
- trend continuation
- the start of a new impulse
Trend analysis
In a strong trend, the internal structure of boxes helps detect decreasing dominance of one side and increasingly balanced proportions, which often acts as an early warning of trend weakening.
Combining with other tools
The indicator works best together with:
- trend indicators
- price levels (pivots, S/R)
- momentum oscillators
Example
- price approaches resistance + momentum weakens
→ in this situation, it is worth considering whether to open a position in line with the dominant trend or, alternatively, wait for a potential trend reversal
█ NOTES
- on markets without volume data, enable pseudo volume
- not a standalone trading indicator
- best results are achieved when used in market context
This indicator may not work properly on certain markets, especially on indices, synthetic instruments and all assets where volume and candle data are aggregated or artificially constructed (e.g. market cap indices, CFD, composite tickers).
In such cases, volume does not reflect real market activity and candles are not based on actual transactions, which makes the boxes lose their analytical value and potentially become misleading.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.