Author: Copyright � 2006, Alex Sidd (Executer)
ExVol

This specialized trading indicator is designed to analyze market momentum by measuring the net difference between "upward" and "downward" price movements over a specific rolling timeframe. Rather than looking at standard volume (which measures the number of shares or contracts traded), this tool focuses on Price Action Volume—essentially calculating the "intensity" of the market's movement in one direction versus the other.

How it Works

The logic operates by scanning a user-defined period of recent price bars (the default being 15). For every point in time, the script performs the following operations:

  • Directional Identification: It examines each individual candle within that period to determine if the price moved up or down.
  • Value Calculation: If a candle closed higher than it opened, it calculates the "positive" distance of that move. If it closed lower, it calculates the "negative" distance.
  • Net Momentum Tracking: It subtracts the total negative movement from the total positive movement to find the "Net Volume." This tells you who is currently in control of the market—the buyers or the sellers.
  • Visual Representation: The results are then scaled and displayed as a histogram on a separate window at the bottom of your chart.

Key Visual Features

The indicator distinguishes between market sentiment using three primary components:

  1. Positive Momentum (Blue Histogram): When the net movement is upward (buyers are stronger), the blue bars represent the strength of that push.
  2. Negative Momentum (Red Histogram): When the net movement is downward (sellers are stronger), the red bars represent the magnitude of that drop.
  3. Volume Buffer: This acts as the underlying calculation layer that tracks the overall balance of the price action.

Practical Application

Instead of just seeing a "flat" volume line, this tool allows you to visualize the dominance of a trend. A large blue bar indicates significant buying pressure over the specified period, while a large red bar highlights aggressive selling pressure. It effectively filters out "noise" by looking at a group of candles simultaneously, helping traders see the broader strength behind a price move rather than just reacting to single, isolated candles.

Miscellaneous
Implements a curve of type %1
14 Views
0 Downloads
0 Favorites
ExVol
//+------------------------------------------------------------------+
//|                                                        ExVol.mq4 |
//|                           Copyright © 2006, Alex Sidd (Executer) |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, Alex Sidd (Executer)"
#property link      "mailto:work_st@mail.ru"
//----
#property indicator_separate_window
#property indicator_minimum -100
#property indicator_maximum 100
#property indicator_buffers 3
#property  indicator_color1  Black
#property  indicator_color2  Blue
#property  indicator_color3  Red
//---- input parameters
extern int ExPeriod = 15;
//---- buffers
double VolBuffer[];
double PosBuffer[];
double NegBuffer[];
//+------------------------------------------------------------------+
//| initialization function                                          |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
   IndicatorBuffers(3);
   SetIndexStyle(0, DRAW_NONE);
   SetIndexBuffer(0, VolBuffer);
   SetIndexStyle(1, DRAW_HISTOGRAM);
   SetIndexBuffer(1, PosBuffer);
   SetIndexStyle(2, DRAW_HISTOGRAM);
   SetIndexBuffer(2, NegBuffer);
   SetIndexDrawBegin(0, ExPeriod);
   SetIndexDrawBegin(1, ExPeriod);
   SetIndexDrawBegin(2, ExPeriod);
//----   
   SetIndexLabel(1, NULL);
   SetIndexLabel(2, NULL);
//----
   short_name = "ExVol(" + ExPeriod + ")";
   IndicatorShortName(short_name);
   SetIndexLabel(0, short_name);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Executer Vol Indicator                                           |
//+------------------------------------------------------------------+
int start()
  {
   int    i, counted_bars = IndicatorCounted();
   double negative = 0, positive = 0;
//----
   if(Bars <= ExPeriod) 
       return(0);
   if(counted_bars < 1)
       for(i = 1; i <= ExPeriod; i++) 
           VolBuffer[Bars-i] = 0.0;
//----
   i = Bars - ExPeriod - 1;
   if(counted_bars >= ExPeriod) 
       i = Bars - counted_bars - 1;
   while(i >= 0)
     {
       negative = 0;
       positive = 0;
       if(i < Bars - ExPeriod - 1)
         {
           int k = i + ExPeriod;
           while(k >= i)
             {
               if(Open[k] < Close[k]) 
                   positive += (Close[k] - Open[k]);
               if(Open[k] > Close[k]) 
                   negative += (Open[k] - Close[k]);
               if(Open[k] == Close[k]) 
                 {
                   negative += 0;
                   positive += 0;
                 }
               k--;
             }
         }
       if((positive - negative) > 0) 
           PosBuffer[i] = (positive - negative)*3000;
       if((positive - negative) < 0) 
           NegBuffer[i] = (positive - negative)*3000;
       VolBuffer[i] = (positive - negative)*3000;
       i--;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments