INVITE-ONLY SCRIPT

ZenAlgo - Bender

149
This script combines several volume-based methodologies into a single chart overlay to help traders analyze market participation and volume distribution. It aggregates volume from multiple sources—spot and perpetual markets across different exchanges—and processes it to display various insights directly on the chart.

The script provides a detailed view of both individual-bar volume and broader aggregated trends. It calculates certain values, plots different shapes and overlays, and includes an optional informational table. However, it does not offer financial signals or predict future price movements. Instead, it presents multiple volume and range-related highlights for educational or analytical observations.

Below is a detailed breakdown of the core elements in this script:

Core Data Calculation and Aggregation
To build a comprehensive volume picture, the script retrieves volume data from multiple predefined exchanges for both Spot and Perpetual pairs. The volume for each bar is processed in Aggregated mode, meaning it combines data across selected sources to produce a single composite volume value.

The script applies average-based aggregation to calculate the final volume figures. The total volume is then used as the basis for further calculations, such as buy/sell volume decomposition and Delta analysis.

Buy/Sell Volume Decomposition
Each bar’s total volume is separated into an estimated buy portion and a sell portion. This decomposition uses logic that considers wick length, body size, and whether the bar closed higher or lower than it opened. The script assigns fractions of the total volume to the upper wick, lower wick, and body, then multiplies these by the total aggregated volume to estimate buy and sell volumes.

This breakdown is calculated separately for spot-only volume, perp-only volume, and their aggregated sums, allowing traders to analyze how much of each bar’s volume is estimated as "buy" or "sell."

Delta and Cumulative Delta
The script computes a Delta (buy volume minus sell volume) for each bar. A positive Delta suggests more buying during that bar, while a negative Delta suggests more selling.

It also computes Cumulative Delta, summing this Delta over 14 bars (a fixed period). This allows users to observe how short-term buy/sell imbalances accumulate over time.

Visual Bar Coloring (PVSRA Logic)
The script includes logic based on PVSRA (Price Volume Support Resistance Analysis), which examines average volume over a recent lookback period to determine whether a bar meets certain "climax" or "above-average" thresholds.

Bars are categorized as:
  • Climax Up or Climax Down: If a bar meets strong volume and range conditions, it is identified as a high-activity bar.
  • Neutral Colors: Bars that do not meet the threshold are identified as standard volume bars.


Table Summaries
The script includes an optional Spot vs. Perpetual volume table that provides:
  • Aggregated Spot vs. Perpetual buy/sell volumes
  • The net difference between buying and selling
  • The total sum across all included sources
  • Percentage breakdown of buying vs. selling


A separate multi-timeframe table calculates volume-related metrics for fixed timeframes (15, 60, and 240 minutes), allowing traders to compare their current timeframe with broader trends.

Highlighted Shapes and Diamonds
The script places shape markers above or below bars when certain conditions are met, including:
  • Dots (circles): Representing a significant increase in net Delta compared to the previous bar.
  • Diamonds: Markers that appear when volume-based conditions align with predefined thresholds. These vary in size and include an optional "Hardcore Mode", which applies stricter filtering.
  • Crossover Triangles: These appear when the internally computed Delta MA (a moving average of Delta) crosses above or below a predefined EMA.


These markers highlight notable changes in volume, Delta, or price action but do not constitute predictive trading signals.

Delta Averages and Overlaid EMAs
The script plots a histogram of the current net Delta (buy minus sell). Additionally, a Delta Moving Average (Delta MA) is used for tracking trends. The Delta MA is plotted alongside predefined Exponential Moving Averages (EMAs), such as:
  • A Delta MA calculated using an exponential moving average (EMA) over 21 bars.
  • A set of predefined EMAs (lengths such as 3, 5, 7, 10, 13, 16, 21, 25, etc.) plotted to visualize momentum changes.
  • Areas between these EMAs can be filled with translucent shading to highlight momentum shifts.


Comparing the Delta MA to the overlaid EMAs helps track changes in Delta momentum over time.

Interpreting the Elements
When using this script, consider the following:
  • Volume Aggregation: The script aggregates volume across multiple Spot and Perpetual sources to provide a broad market view.
  • Delta and Cumulative Delta: The Delta histogram may spike positively or negatively, highlighting areas of potential buying or selling pressure.
  • Table Data: If enabled, the tables display buy/sell volume splits for Spot and Perpetual markets, along with multi-timeframe comparisons.
  • EMA Overlays on Delta: The stacked EMAs help visualize short-term vs. longer-term Delta changes.
  • Shape Markers: Dots, diamonds, and triangles emphasize notable shifts in volume or Delta but do not imply recommendations for action.


Usage Tips
  • Toggle "Hardcore Mode" to apply stricter filtering to highlight conditions.
  • Enable or disable the Spot vs. Perpetual Table to see if the breakdown of volume sources is useful.
  • Use the multi-timeframe table to compare intraday data with broader trends.
  • If the chart appears too cluttered, toggle off features like PVSRA color tints or some EMAs to focus on specific elements.


Final Thoughts
This script integrates multiple volume-based calculations, range analysis, aggregated volume from predefined tickers, and various moving averages for Delta. Its visual layers—color-coded bars, histograms, shape markers, and tables—offer a rich perspective on market activity.

Users can analyze these elements across any timeframe or market combination they prefer. The script does not provide buy/sell signals or make predictions—it is purely an analytical tool for understanding volume-based market dynamics.

Traders should interpret these visual elements according to their own strategy and trading approach.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.