Buy Sell Volume
Buy/Sell Volume Indicator with Pair Divergence for MT5
version "1.1"
Description
The Enhanced Buy/Sell Volume Indicator is a custom technical indicator designed for MetaTrader 5 (MT5) to analyze and visualize buy and sell tick volumes in a separate window. It provides traders with insights into market dynamics by highlighting volume dominance, balance, and divergence patterns. The indicator uses tick volume data to estimate buying and selling pressure, offering a detailed view of market sentiment and potential reversals.
Key Features and Capabilities
- Buy and Sell Volume Visualization:
- Displays buy and sell volumes as histograms in a separate indicator window.
- Buy volumes are shown as positive histograms, and sell volumes as negative histograms, making it easy to compare their relative strength.
- Customizable histogram width and colors for buy (default: MediumSeaGreen) and sell (default: MediumSlateBlue) volumes.
- Dominance Detection:
- Identifies periods of significant buying or selling dominance when the volume of one side exceeds a user-defined threshold (default: 80%).
- Dominant bars are marked with arrows (colored red by default) above or below the histogram for closed candles, indicating strong market direction.
- Balance Analysis:
- Detects periods of market balance where buy and sell volumes are closely matched, based on deviation from a moving average of buy volume percentage.
- A user-defined balance threshold (default: 5%) determines when volumes are considered balanced.
- Balanced bars are highlighted with a distinct histogram color (default: Orange), signaling potential consolidation or indecision.
- Pair Divergence Detection:
- Identifies bullish and bearish divergences between price movements and volume trends:
- Bullish Divergence: Occurs when the price falls or stagnates (close ≤ open) while buy volume increases, suggesting potential upward reversal.
- Bearish Divergence: Occurs when the price rises or stagnates (close ≥ open) while sell volume increases, indicating potential downward reversal.
- Divergent bars (current and previous) are highlighted with a unique color (default: Yellow) to emphasize these patterns.
- Dynamic Scaling:
- Automatically adjusts the indicator’s vertical scale based on the maximum and minimum volume values over a user-defined period (default: 800 bars).
- A scale multiplier (default: 1.2) ensures sufficient visual space for volume fluctuations, preventing the histogram from appearing cramped.
- Customizable Parameters:
- Histogram Width: Adjust the thickness of histogram bars (default: 2).
- Scale Period: Set the lookback period for dynamic scaling (default: 800).
- Scale Multiplier: Control the vertical range of the indicator window (default: 1.2).
- Dominance Threshold: Define the percentage threshold for dominance detection (default: 80%).
- Balance Period: Set the period for calculating the moving average of buy volume percentage (default: 40).
- Balance Threshold: Specify the maximum deviation for balance detection (default: 5%).
- Colors: Customize colors for buy/sell volumes, dominance markers, balance histograms, and divergence highlights.
How It Works
- Volume Calculation: The indicator estimates buy and sell volumes based on tick volume and price movement:
- If the price range (high - low) is zero, volumes are split equally (50/50).
- For upward price movement (close > open), buy volume is weighted higher (60-90% based on the price change relative to the range).
- For downward price movement (close < open), sell volume is weighted higher.
- If the price is unchanged (close = open), volumes are split equally.
- Dominance: Calculated as the percentage of buy or sell volume relative to total volume, with markers added when exceeding the threshold.
- Balance: Compares the current buy volume percentage to its moving average over the balance period, marking bars where deviation is minimal.
- Divergence: Analyzes price and volume trends between consecutive bars to detect mismatches that may indicate reversals.
- Scaling: Adjusts the indicator window’s range dynamically to ensure clear visualization of volume data.
Use Cases
- Trend Confirmation: Use dominance markers to confirm strong buying or selling pressure in trending markets.
- Reversal Signals: Identify potential reversals through bullish or bearish divergence patterns.
- Consolidation Detection: Spot periods of market indecision with balance highlights, useful for range-bound strategies.
- Volume Analysis: Gain insights into market sentiment by comparing buy and sell volume strengths.
Practical Notes
- The indicator works best on instruments with high tick volume data, such as forex pairs or major indices.
- Divergence signals are most reliable when confirmed with other technical tools (e.g., support/resistance levels, RSI).
- Adjust input parameters to suit specific timeframes or trading styles (e.g., shorter balance periods for scalping).
- The indicator only places dominance markers on closed candles to avoid repainting.
Limitations
- Relies on tick volume, which may not reflect actual traded volume in some markets.
- Divergence detection is based on a simple two-bar comparison, which may require additional confirmation.
- Performance may vary on low-liquidity instruments or during low-volume periods.
This indicator is a powerful tool for traders seeking to understand volume-driven market dynamics, offering a blend of volume analysis, dominance detection, balance identification, and divergence signals in a single, customizable package.