PROTECTED SOURCE SCRIPT
ZenAlgo - Swing Volume Profile

ZenAlgo - Swing Volume Profile
ZenAlgo - Swing Volume Profile builds a volume profile around the current swing instead of around a fixed session or a manually selected visible range. The script first defines an A to B swing, then uses that price and time range as the container for volume, value area, delta, Fibonacci mapping, labels, dashboards, and alerts.
The indicator can anchor the swing automatically or from manually selected times. In automatic mode it looks for larger pivot highs and pivot lows, keeps track of the latest external swing structure, and connects the relevant swing endpoints with a dashed A to B line. In manual mode the user selects the start and end times; the script then uses the candle close direction between those anchors to decide whether the high/low wicks should be used as the swing endpoints. This gives the profile a defined market leg instead of calculating from an arbitrary lookback.
Swing Anchoring And Grid
The A to B line is the reference grid for the rest of the script. A rising swing and a falling swing are handled symmetrically: the same grid ratio can be used to label levels, match volume levels to Fibonacci areas, and decide whether a level is near an entry, take-profit, Golden Pocket, or extension zone.
The script also marks the swing points and shows basic swing context such as direction, bar count, percentage move, ATR-sized move, and current distance from the B point. These labels are descriptive. They do not decide trades by themselves; they identify the exact range used for the following profile calculations.
Swing Volume Profile
Inside the selected swing range, the script divides the full price span into configurable rows. For each candle in the swing, it distributes that candle's volume across the price rows touched by the candle. If a candle only partly overlaps a row, only the proportional part of its volume is added to that row. This creates a swing-specific volume distribution rather than a profile based only on bar closes.
From this distribution the script identifies:
This is useful because the same swing can contain different information than a session profile or visible range profile. A fixed session can mix unrelated moves, while a swing profile isolates where participation occurred during the specific leg the user is evaluating.
Static And Developing Profiles
The main profile is static for the completed A to B swing. It answers where volume accumulated during that swing. The developing profile starts from point B and updates through the current bar. It answers how volume is forming after the swing endpoint.
Using both profiles together is the main reason the script is more than a collection of separate tools. The static profile provides the accepted levels from the completed swing, while the developing profile shows whether current trading is building acceptance, rejection, or new concentration after B. When static and developing levels appear near each other, the script can merge labels and show a confluence count instead of forcing the user to compare several independent drawings manually.
Value Area, Bias, And Touch State
The script compares the current close with POC, VAH, VAL, and VA Mid to display a simple bias state. Price above the value area is marked as premium, price below it as discount, and price inside the value area is classified according to its position relative to POC and the value-area midpoint.
Labels can include whether a level is fresh, tapped, or near. A level is treated as fresh when price has not traded through it since the B anchor, tapped when it has already been crossed, and near when the current close is within an ATR-based distance. This helps separate untouched levels from levels that have already been tested.
Ditch Zones
The script searches inside the value area for the largest low-volume pocket whose normalized volume is below the configured sensitivity. This zone is labeled as Ditch on the static profile and dDitch on the developing profile.
The idea behind this calculation is that a value area is not always uniform. A low-volume pocket inside it can show a price area where trading activity was relatively thin compared with nearby rows. The script marks the pocket, its midpoint, and a quality label based on the size of the pocket relative to the value area. It can also label a rejection when price touches the zone and closes outside it.
Delta Context
The script estimates directional volume from candle bodies and candle ranges. For each candle, the contribution is positive when the candle closes above its open, negative when it closes below its open, and scaled by how large the body is compared with the full candle range.
Using that estimate, the script reports delta for:
These three readings are combined into descriptive states such as trend confirmed, losing momentum, potential divergence, or flow reversal. The reason for comparing these segments is that the completed swing and the post-swing reaction can tell different stories. A swing can have strong directional flow during A to B, while the movement after B can confirm it, weaken it, or move against it.
Fibonacci Mapping
When enabled, Fibonacci levels are drawn from the same A to B swing. The script includes common retracement levels, a highlighted Golden Pocket between 0.618 and 0.65, and an extension target zone between 1.272 and 1.618.
The Fibonacci levels are not separate from the volume profile. Profile labels can snap to nearby Fibonacci target names, and the Golden Pocket can change color when the profile POC or value area overlaps it. This connects price-ratio structure with actual volume concentration from the same swing.
Smart Row, Magnet, And Playbook Labels
The optional smart row summarizes the current profile state in a table. It can show bias, distance from POC, value-area location and width, Ditch distance, a magnet score, a playbook context, touch state, and swing health.
The magnet score ranks the currently most relevant profile level among POC, VAH, VAL, VA Mid, and Ditch. The score considers distance from current price, base level importance, fresh or used state, and whether the level is close to a volume-profile or Fibonacci target label. This is a ranking of chart context, not a forecast.
The playbook label is built from the value area position, POC, Ditch rejection, and post-B delta. It can describe contexts such as reclaim, fade, pullback, Ditch rejection, balance, or waiting for reversal. These labels are intended to make the current state easier to read; they are not entry signals by themselves.
Alerts
The script includes alert conditions for:
Alerts use the script's own level calculations and ATR-based proximity checks. They should be treated as notifications that price is interacting with a calculated area, not as complete trading instructions.
How To Interpret The Values
How To Use The Indicator
Added Value Over Separate Free Tools
The script combines swing anchoring, swing-specific volume distribution, static profile, developing profile, value-area levels, low-volume pockets, estimated delta, Fibonacci mapping, merged confluence labels, touch state, dashboard context, and alerts around one shared A to B grid.
The added value is the shared reference frame. A standalone volume profile, Fibonacci tool, delta label, or support/resistance drawing can each describe one part of the chart, but they usually do not know whether their levels come from the same swing. Here, the calculations are tied to the same anchors, so profile levels, Fibonacci levels, delta segments, Ditch zones, and playbook labels can be compared directly.
Limitations
ZenAlgo - Swing Volume Profile builds a volume profile around the current swing instead of around a fixed session or a manually selected visible range. The script first defines an A to B swing, then uses that price and time range as the container for volume, value area, delta, Fibonacci mapping, labels, dashboards, and alerts.
The indicator can anchor the swing automatically or from manually selected times. In automatic mode it looks for larger pivot highs and pivot lows, keeps track of the latest external swing structure, and connects the relevant swing endpoints with a dashed A to B line. In manual mode the user selects the start and end times; the script then uses the candle close direction between those anchors to decide whether the high/low wicks should be used as the swing endpoints. This gives the profile a defined market leg instead of calculating from an arbitrary lookback.
Swing Anchoring And Grid
The A to B line is the reference grid for the rest of the script. A rising swing and a falling swing are handled symmetrically: the same grid ratio can be used to label levels, match volume levels to Fibonacci areas, and decide whether a level is near an entry, take-profit, Golden Pocket, or extension zone.
The script also marks the swing points and shows basic swing context such as direction, bar count, percentage move, ATR-sized move, and current distance from the B point. These labels are descriptive. They do not decide trades by themselves; they identify the exact range used for the following profile calculations.
Swing Volume Profile
Inside the selected swing range, the script divides the full price span into configurable rows. For each candle in the swing, it distributes that candle's volume across the price rows touched by the candle. If a candle only partly overlaps a row, only the proportional part of its volume is added to that row. This creates a swing-specific volume distribution rather than a profile based only on bar closes.
From this distribution the script identifies:
- POC: the row with the largest accumulated volume inside the swing.
- VAH and VAL: the upper and lower boundaries of the chosen value area percentage around the POC.
- VA Mid: the midpoint of the value area.
- Optional HVN and LVN levels: local high-volume and low-volume nodes based on the relative volume of neighboring rows.
- Optional VA range projections: distance levels above and below the value area expressed as value-area range multiples.
This is useful because the same swing can contain different information than a session profile or visible range profile. A fixed session can mix unrelated moves, while a swing profile isolates where participation occurred during the specific leg the user is evaluating.
Static And Developing Profiles
The main profile is static for the completed A to B swing. It answers where volume accumulated during that swing. The developing profile starts from point B and updates through the current bar. It answers how volume is forming after the swing endpoint.
Using both profiles together is the main reason the script is more than a collection of separate tools. The static profile provides the accepted levels from the completed swing, while the developing profile shows whether current trading is building acceptance, rejection, or new concentration after B. When static and developing levels appear near each other, the script can merge labels and show a confluence count instead of forcing the user to compare several independent drawings manually.
Value Area, Bias, And Touch State
The script compares the current close with POC, VAH, VAL, and VA Mid to display a simple bias state. Price above the value area is marked as premium, price below it as discount, and price inside the value area is classified according to its position relative to POC and the value-area midpoint.
Labels can include whether a level is fresh, tapped, or near. A level is treated as fresh when price has not traded through it since the B anchor, tapped when it has already been crossed, and near when the current close is within an ATR-based distance. This helps separate untouched levels from levels that have already been tested.
Ditch Zones
The script searches inside the value area for the largest low-volume pocket whose normalized volume is below the configured sensitivity. This zone is labeled as Ditch on the static profile and dDitch on the developing profile.
The idea behind this calculation is that a value area is not always uniform. A low-volume pocket inside it can show a price area where trading activity was relatively thin compared with nearby rows. The script marks the pocket, its midpoint, and a quality label based on the size of the pocket relative to the value area. It can also label a rejection when price touches the zone and closes outside it.
Delta Context
The script estimates directional volume from candle bodies and candle ranges. For each candle, the contribution is positive when the candle closes above its open, negative when it closes below its open, and scaled by how large the body is compared with the full candle range.
Using that estimate, the script reports delta for:
- A to B: directional flow during the completed swing.
- B to now: directional flow after the swing endpoint.
- A to now: the combined flow from the original anchor to the current bar.
These three readings are combined into descriptive states such as trend confirmed, losing momentum, potential divergence, or flow reversal. The reason for comparing these segments is that the completed swing and the post-swing reaction can tell different stories. A swing can have strong directional flow during A to B, while the movement after B can confirm it, weaken it, or move against it.
Fibonacci Mapping
When enabled, Fibonacci levels are drawn from the same A to B swing. The script includes common retracement levels, a highlighted Golden Pocket between 0.618 and 0.65, and an extension target zone between 1.272 and 1.618.
The Fibonacci levels are not separate from the volume profile. Profile labels can snap to nearby Fibonacci target names, and the Golden Pocket can change color when the profile POC or value area overlaps it. This connects price-ratio structure with actual volume concentration from the same swing.
Smart Row, Magnet, And Playbook Labels
The optional smart row summarizes the current profile state in a table. It can show bias, distance from POC, value-area location and width, Ditch distance, a magnet score, a playbook context, touch state, and swing health.
The magnet score ranks the currently most relevant profile level among POC, VAH, VAL, VA Mid, and Ditch. The score considers distance from current price, base level importance, fresh or used state, and whether the level is close to a volume-profile or Fibonacci target label. This is a ranking of chart context, not a forecast.
The playbook label is built from the value area position, POC, Ditch rejection, and post-B delta. It can describe contexts such as reclaim, fade, pullback, Ditch rejection, balance, or waiting for reversal. These labels are intended to make the current state easier to read; they are not entry signals by themselves.
Alerts
The script includes alert conditions for:
- Static and developing Ditch rejection up or down.
- Price near core profile levels such as POC, value area, or Ditch.
- Price near a volume-profile or Fibonacci target level.
- Strong confluence when multiple profile levels merge in the same area.
- Long or short playbook context active near the selected best profile level.
Alerts use the script's own level calculations and ATR-based proximity checks. They should be treated as notifications that price is interacting with a calculated area, not as complete trading instructions.
How To Interpret The Values
- POC marks the price row with the highest swing volume.
- VAH and VAL frame the selected value area percentage around POC.
- VA Mid marks the middle of that value area.
- HVN marks a local high-volume node when enabled.
- LVN marks a local low-volume node when enabled.
- Ditch marks the largest low-volume pocket detected inside the value area.
- dPOC, dVAH, dVAL, and dDitch describe the developing profile from B to the current bar.
- +DPOC and -DPOC mark the strongest positive and negative estimated delta rows.
- C2, C3, and stronger confluence labels show how many calculated levels were merged near the same grid ratio.
- Fresh, tapped, and near describe whether price has interacted with a level since the B anchor.
How To Use The Indicator
- Start by checking whether the A to B swing matches the move you want to study. Use manual anchors when the automatic swing does not match your intended analysis range.
- Use POC, VAH, VAL, VA Mid, Ditch, and developing levels as areas for observation rather than exact single-price commands.
- Compare static levels from A to B with developing levels after B. Alignment can highlight repeated acceptance areas, while separation can show that current trading is building value elsewhere.
- Use delta states to check whether the post-B flow agrees with or contradicts the completed swing.
- Enable Fibonacci only when you want profile levels to be compared with swing-ratio levels from the same anchors.
- Use presets to control chart density. Clean is for a reduced view, Full exposes more profile components, Scalp keeps the display focused, and Manual lets the user choose individual components.
- Use alerts as prompts to inspect price action around a calculated area, preferably with the market structure, timeframe, and risk plan already defined.
Added Value Over Separate Free Tools
The script combines swing anchoring, swing-specific volume distribution, static profile, developing profile, value-area levels, low-volume pockets, estimated delta, Fibonacci mapping, merged confluence labels, touch state, dashboard context, and alerts around one shared A to B grid.
The added value is the shared reference frame. A standalone volume profile, Fibonacci tool, delta label, or support/resistance drawing can each describe one part of the chart, but they usually do not know whether their levels come from the same swing. Here, the calculations are tied to the same anchors, so profile levels, Fibonacci levels, delta segments, Ditch zones, and playbook labels can be compared directly.
Limitations
- Volume quality depends on the symbol and data feed. Markets with incomplete or synthetic volume can produce less reliable profile and delta context.
- The delta calculation is an estimate based on candle direction and body size, not true bid/ask order-flow data.
- Automatic swing anchors are pivot-based and can lag until a pivot is confirmed. Manual anchors may be better when the desired swing is subjective.
- Very small ranges, gaps, unusual candles, or low-liquidity charts can make row distribution and low-volume pockets less meaningful.
- High row counts and many enabled visual components can make the chart dense, especially on lower timeframes.
- The script describes volume and price-location context. It does not guarantee profitable trades, does not predict future price, and should not be used without independent risk management.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
The ZenAlgo team
zenalgo.com
discord.zenalgo.com
zenalgo.com
discord.zenalgo.com
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Protected script
This script is published as closed-source. However, you can use it freely and without any limitations – learn more here.
The ZenAlgo team
zenalgo.com
discord.zenalgo.com
zenalgo.com
discord.zenalgo.com
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.