INVITE-ONLY SCRIPT
ที่อัปเดต:

ZenAlgo - Avenger

729
The ZenAlgo - Avenger indicator provides a multi-layered view of market behavior by combining volume delta analytics, trend-following EMAs, average price comparison, and price-volume profiling into a unified overlay. It is designed to visually assist traders in identifying areas of interest, momentum shifts, and potential reversals using cumulative data from both spot and perpetual markets.

Volume Delta Calculation
This indicator computes delta as the difference between estimated buy and sell volumes using volume data from multiple centralized exchanges. It distinguishes between spot and perpetual volumes, combining them into total volume.

To estimate buying and selling volume from raw volume data, candle structure is broken down into body and wicks. The body is interpreted as the core directional movement (buy/sell), while the wicks are treated as uncertain or counteraction. This segmentation helps infer the likely share of buying and selling within each bar.

The delta is calculated per bar and then aggregated over a lookback period (default 14 bars) to generate a cumulative delta. This approach provides a smoothed value of volume pressure trends over time.

A moving average is applied to the delta values (using selectable MA types like EMA or SMA) to define signal crossovers and suppress noise.

Delta Visualization
To contextualize delta within price action, the delta is scaled dynamically (by ATR or user-defined value) and plotted as a band around the closing price. Positive delta expands upward from price, negative delta downward. This provides a visual overlay that reflects net market pressure in context with price movement.

In cases of extreme delta (threshold set at 80% of recent maximum), the indicator marks spike bars using symbols to indicate significant directional pressure.

Identification of Noteworthy Conditions
The indicator highlights points on the chart where specific conditions are met based on the interaction between volume delta and its moving average. These conditions may align with moments of market pressure imbalance and directional movement, but they are not to be interpreted as trade signals in isolation.

Instead, these chart markers serve as visual flags for potential interest. They are intended to draw the user’s attention to scenarios where:
  • The delta crosses above or below its moving average, suggesting a potential shift in volume pressure.
  • The cumulative delta supports the direction of this crossover.

Optional filters can further restrict these markings to periods where:
  • The short-term trend (as inferred from EMA slope) supports the direction.
  • Volume is elevated relative to a recent average.

A user-defined cooldown period prevents multiple markings within short succession to avoid clutter.

It is essential to underscore that these markers do not constitute buy or sell advice. Their role is diagnostic, helping the trader to identify potential moments of interest which should be analyzed in conjunction with broader context, such as trend structure, price action, support/resistance levels, or external market data.

EMA Structure
Six EMAs with fixed lengths (13 to 56) are plotted and colored dynamically based on the most recent crossover between the fastest and slowest (EMA1 and EMA6). These EMAs help visualize short- to mid-term trends. The crossover itself is marked with symbols, with vertical offset based on ATR to maintain chart readability.

Average Line (AVG)
The indicator also calculates an average price based on a fixed window (100 bars). This is not a standard moving average but rather a raw average of recent prices stored in a circular buffer. The average is plotted, and its relative distance to the current price is labeled as a percentage. This feature serves as a simplified representation of fair value or mean reversion anchor.

EMA6 vs AVG Cross
Another layer of point of interest detection involves EMA6 crossing the AVG line. This crossover is only considered valid if EMA6 shows slope consistency in the crossing direction. These events are marked using symbols and offset vertically to avoid overlapping price action.

Divergence Detection
The script detects both regular and hidden divergences between price and delta:
  • Regular divergences are defined when price makes a higher high or lower low, while delta fails to confirm (makes a lower high or higher low).
  • Hidden divergences occur when price retraces (lower high or higher low), but delta moves against this retracement, indicating underlying strength or weakness.

Divergence points are labeled with "R" (regular) or "H" (hidden) and appear at local pivot highs or lows. The number of visible divergence labels can be limited for chart clarity.

POC and nPOC Calculations
The script includes a simplified volume profile implementation, calculating:
  • POC (Point of Control): the price level with the highest volume for the given period.
  • nPOC (non-tested POC): historical POCs that have not yet been revisited by price.

Price levels are bucketed into rows (user-defined), and volume per bucket is tracked to identify the POC. Upon a new period (e.g., day, week), a horizontal POC line is drawn. Once tested by price, the line’s appearance changes (color fades, label shrinks), helping users distinguish between untouched and touched levels.

Limits are enforced on the number of retained POCs and their maximum distance from current bars to optimize performance and chart readability.

Exchange Aggregation
Volume data is aggregated across major exchanges. This ensures that the delta calculation captures a broader market picture beyond a single venue, reducing exchange-specific noise.

How to Interpret Values
  • Delta Band: Wide bands indicate strong directional imbalance. Narrow bands suggest indecision or low volume.
  • EMA Crossover Symbols: Appear on directional shifts in moving averages. Multiple EMAs reinforcing the same slope typically indicate stronger trend.
  • AVG Line: Represents average price over recent history. Large deviations can indicate overextension or potential mean reversion.
  • Divergences: Regular ones may point to weakening momentum; hidden ones can suggest continuation despite corrective price action.
  • POC / nPOC: Key volume-based support/resistance levels. Untested nPOCs can act as magnets for price retests.


How to Best Use This Indicator
  • Use in conjunction with trend context (e.g., higher timeframe EMAs) to avoid counter-trend indications.
  • Treat delta spikes as caution zones—especially if they occur at known support/resistance.
  • Watch for divergences as early warning signs before price reverses.
  • Use POC/nPOC as target levels, especially if aligned with delta signals.
  • Apply volume and trend filters to reduce noise on shorter timeframes.


Added Value
  • Multi-exchange volume aggregation makes the delta calculation more robust.
  • Real-time cumulative delta overlaid directly on the price chart provides immediate context.
  • Points of interest on chart are conservative and filterable, intended to reduce false positives.
  • The combination of delta, trend-following EMAs, fair value line, and volume profile data is rarely found in one overlay script.
  • POC/nPOC visualization based on real traded volume helps identify high-interest zones for future price interaction.


Why Is It Worth Paying For
While free alternatives may provide partial insights (e.g., basic delta or single EMA crossovers), this indicator integrates multiple domains—delta, divergence, average price, trend overlays, and profile levels—into a coherent, optimized chart tool. The value lies not just in having these tools, but in how they are synchronized and visualized.

Furthermore, sourcing and synchronizing volume data from multiple exchanges for delta estimation is not straightforward in Pine Script and adds to the indicator's complexity and utility.

Disclaimers and Limitations
  • Delta estimation is based on candle structure and assumes wick/body distribution reflects buyer/seller activity, which may not always be precise.
  • Multi-exchange volume data relies on availability via TradingView’s request.security() function; if exchange data is missing or delayed, results may be incomplete.
  • Divergences do not guarantee reversals—should be used as part of a broader analysis framework.
  • On illiquid instruments or exotic pairs, the value of delta and volume-based analytics may be reduced due to unreliable volume.
เอกสารเผยแพร่
Structural & Input Adjustments
  • Simplified or Hardcoded Settings: Several user inputs (e.g., height_mode, osc_height, atr_length, and signal filter toggles like use_trend_filter, use_volume_filter) are now hardcoded instead of exposed as inputs. What this means for users: You won’t be able to tweak these from the UI; the script now enforces a consistent internal behavior for certain mechanisms like delta scaling and noise filtering.
  • Reduced Exchange Volume Sources: The original version aggregates volume from 10 exchanges. The updated version only uses 2 (BINANCE + current). Implication: Aggregated delta and volume computations may behave differently due to smaller source data.

Visual Adjustments on Chart
  • Delta Band Background Now Disabled by Default: The delta overlay band remains available, but it is now off by default (show_delta_background = false). Visual difference: Users will not see the delta zone on the chart unless they explicitly turn it on.
  • EMA6/AVG Crossover Marker Size Adjusted: The crossover shapes for EMA6 crossing the AVG line now use size.normal instead of the previously larger size.large. Visual impact: These triangle/circle markers are now smaller and more consistent with other shapes on the chart.
  • AVG Label Offset Changed: The horizontal offset for the AVG line’s label was reduced from 40 to 10, meaning the label now appears much closer to the latest bar. Visual change: AVG label and dotted line appear less pushed to the right side of the chart.
  • Removed Volume/Delta Spike Diamonds: The prominent diamond-shaped spike markers that highlighted strong delta bars have been commented out (disabled). Effect: Users will no longer see these volume/delta "spike" warnings above/below bars.

Functional Changes & Logic Tweaks
  • Noise Filters (Trend, Volume) Are Now Disabled by Default: Filters that previously required user input are now forced off. Outcome: Delta-based shapes are plotted without requiring additional conditions like volume surge or trend slope. May lead to more frequent plotting of shapes.
  • Crossover Style and Color Logic Maintained: The logic for plotting EMA and AVG crossovers using symbols (triangles, circles, or squares) remains unchanged but has a slightly refined offset calculation and simplified condition chaining.

Backend & Performance Optimization
  • Max Bars Back Increased: max_bars_back was raised from 500 to 5000, allowing the script to reference deeper price history. Purpose: Improves performance of indicators relying on longer historical context like delta summation, AVG lines, and POC profiles.
  • Expanded Volume Profile Logic: The updated version contains additional POC and nPOC logic, including dynamic label updating, count tracking of tests, and time-based filtering using max_distance. User impact: More refined handling of volume profile lines that appear based on historical session volume.

New Additions
  • Fair Value Gap (FVG) Overlay (PVSRA-inspired): The updated script introduces a toggleable section for displaying FVG zones, based on configurable modes like PVSRA FVGs Only, optional use of Heikin Ashi candles, and custom colors. Visual change: Users now see colored zones marking FVGs if enabled.
  • Heikin Ashi and Multi-Timeframe Handling: Heikin Ashi values are calculated directly in the script and optionally overridden for FVG and PVSRA logic. User benefit: Candles and volume structures can reflect HA smoothing, helpful for more consistent detection of momentum breaks.

Removed or Inactive Features
  • Alert Table Removed: The small table that previously showed Buy Volume, Sell Volume, and Delta at the chart's corner is no longer present in the updated version. Note: There is no longer an on-screen numeric summary of delta metrics.
  • Reduced Exchange Volume Aggregation: The original implementation used 10 hardcoded exchanges for volume delta; now it only aggregates from 1–2. Impact: This may influence delta behavior in assets where secondary exchange volume used to play a larger role.
เอกสารเผยแพร่
Added Setting: Include/Exclude Candle Wicks in Fair Value Gap Calculation

A new option has been introduced that lets you decide whether candle wicks should be considered in fair value gap calculations.

Recommendation:
  • For Heikin Ashi candles, it is generally better to ignore wicks.
  • For standard (classic) candles, it is usually better to include wicks.
เอกสารเผยแพร่
1. Fair Value Gap (FVG)
  • Visual changes: FVGs can now fade as price moves away from their midpoint. Users can choose fade strength (linear / exponential), minimum and maximum opacity, optional midpoint line, and optional “FVG” label.
  • Automatic cleanup: Gaps can auto-delete when either a candle’s close fully fills them or when a wick fills at least 50 % — both conditions are user-controlled.
  • Creation options: Choose between All FVGs or only PVSRA-filtered FVGs (where the middle candle meets specific volume-based criteria). You can also ignore wicks when detecting gaps.
  • Meaning: The chart stays visually relevant — older or filled gaps fade or disappear, highlighting only those still active in context.
  • How it works: Gaps are identified between bars n and n-2, optionally ignoring wicks. Fading is distance-based, and deletion checks occur every bar update.


2. Unified “Show Last” Visibility Control
  • A single Show Last Bars setting is now available for nearly all elements: EMAs, AVG line, crossover markers, VWAP line and crosses, and SMC (BOS/CHoCH) drawings.
  • Purpose: Limits the number of visible bars to your chosen recent window, keeping charts clear without losing current context.
  • Effect: Historical drawings beyond the selected range are hidden or removed automatically.
เอกสารเผยแพร่
This version of Avenger expands the market structure layer around volume distribution and value areas. The Fair Value Gap and PVSRA components remain functionally consistent, while the volume profile logic has been significantly extended. The main change is the introduction of developing and completed value area structures, together with their naked counterparts, allowing users to observe how volume based reference levels form, evolve, and get interacted with over time.

Developing Daily Structures (New)

Developing POC (dPOC)

A new developing Point of Control is drawn on intraday charts for the current trading day.

What changes visually
  • A horizontal line appears during the day and updates as new candles form.
  • The line represents where the highest traded volume currently accumulates.
  • The line extends a fixed distance into the future to remain visible.

What it represents
  • The evolving price level where the most activity has occurred so far during the day.
  • Unlike historical POC lines, this level is not fixed until the day completes.

How it is calculated
  • Volume is continuously aggregated across price bins from the start of the day.
  • The price level with the highest accumulated volume is recalculated whenever the day’s range expands.

Developing Value Area High and Low (dVAH / dVAL)

Alongside the developing POC, developing Value Area boundaries are now available.

What changes visually
  • Two additional horizontal lines appear above and below the developing POC.
  • These lines adjust during the session as volume distribution evolves.

What they represent
  • The upper and lower boundaries that contain a user defined percentage of total traded volume for the current day.
  • These levels remain dynamic until the daily session ends.

How they are calculated
  • Starting from the developing POC, volume is expanded outward until the configured percentage of total volume is covered.
  • The boundaries update when volume distribution or daily range changes.

Completed Period Value Areas (Extended)

Periodic VAH and VAL

Completed Value Area High and Low levels are now drawn for each finished profile period.

What changes visually
  • In addition to POC lines, completed VAH and VAL lines are drawn.
  • These lines extend forward in the same way as historical POC lines.

What they represent
  • The finalized value area boundaries of a completed profile period.
  • These levels provide context for where most trading activity was concentrated during that period.

How they are calculated
  • After a profile period closes, volume is aggregated across its entire range.
  • The value area is derived by expanding from the POC until the target volume percentage is reached.

Naked Levels Expansion

Naked VAH and VAL (New)

Previously only naked POC levels were available. This version adds naked Value Area High and Low levels.

What changes visually
  • When a period completes, dotted horizontal lines appear at VAH and VAL.
  • Each level is accompanied by a label that tracks its status.

What they represent
  • Value area boundaries that have not yet been revisited by price after their creation.
  • These levels remain active until price trades through them.

How they behave
  • Once price touches a naked level, it visually fades and is marked as tested.
  • A touch counter is displayed to indicate how many times the level has been interacted with.
  • Old or distant levels are automatically removed based on user defined limits.

Fair Value Gap Behavior (Refined Consistency)

The Fair Value Gap logic remains conceptually unchanged but is now aligned more strictly with the rest of the structure logic.

Observed behavior
  • Gaps are still created using a three candle structure.
  • Optional midlines and labels behave the same as before.
  • Opacity continues to fade based on distance from current price.
  • Gaps are removed when price closes beyond the gap or when wicks fill a defined portion of it.

What this means for users
  • No change in how gaps are identified or displayed.
  • Visual behavior is consistent with the updated deletion and fading rules applied elsewhere in the indicator.

Structural and Scope Changes

Removal of Unrelated Components

Components unrelated to market structure and volume distribution have been removed from Avenger.

The indicator now focuses exclusively on:
  • Fair Value Gaps
  • PVSRA candle classification
  • Volume profile derived reference levels

This reduces visual overlap and keeps all plotted elements tied to volume and structure.

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน