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

This custom indicator is designed to track and visualize market "mass" or momentum within a specific timeframe on your trading charts. Rather than looking at individual price ticks in isolation, it analyzes the relationship between historical high and low points over a moving window to provide a smoother representation of market behavior.

How the Logic Works

The script operates by examining a rolling set of price bars (determined by the user-defined period). For every point on the chart, the indicator performs the following sequence:

  • Identifying Extremes: It scans back through the recent history to identify the highest high and the lowest low reached during that specific timeframe. This captures the total "range" or volatility of the price action in that window.
  • Calculating Market Range: By finding these two extremes, the tool calculates the distance between the peak and the valley. This distance is then weighted significantly to represent the underlying strength or intensity of the market's movement.
  • Smoothing the Data: To ensure the resulting line isn't erratic or jagged, the script applies a normalization process. It takes the current calculated value and blends it with the values of previous bars. This acts as a smoothing filter, helping to remove "noise" and highlight the underlying trend of the market mass.
  • Visual Output: The final result is plotted as a continuous line in a separate window below your main price chart.

Key Objectives

The primary goal of this logic is to provide a visual representation of market intensity. By focusing on the extremes (the highest highs and lowest lows) and smoothing them out over time, it allows traders to see the "weight" of the price movement more clearly than they might by looking at standard candles alone. It helps in identifying significant shifts in momentum by highlighting where the price is expanding or contracting relative to its recent history.

Miscellaneous
Implements a curve of type %1
19 Views
0 Downloads
0 Favorites
ExMass_v2
//+------------------------------------------------------------------+
//|                                                     ExMassv2.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_buffers 1
#property  indicator_color1  Black
//---- input parameters
extern int ExPeriod = 8;
extern int Normalize = 3;
double pos;
//---- buffers
double MassBuffer[];
//+------------------------------------------------------------------+
//| initialization function                                          |
//+------------------------------------------------------------------+
int init()
  {
   string short_name;
   IndicatorBuffers(1);
   SetIndexStyle(0, DRAW_LINE);
   SetIndexBuffer(0, MassBuffer);
   SetIndexDrawBegin(0, ExPeriod);
   short_name="ExMass";
   IndicatorShortName(short_name);
   SetIndexLabel(0, short_name);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Exexuter Mass Indicator                                          |
//+------------------------------------------------------------------+
int start()
  {
   int    i, counted_bars = IndicatorCounted();
   double negative, positive;
//----
   if(Bars <= ExPeriod) 
       return(0);
   if(counted_bars < 1)
       for(i = 1; i <= ExPeriod; i++) 
           MassBuffer[Bars-i] = 0.0;
//----
   i = Bars - ExPeriod - 1;
   if(counted_bars >= ExPeriod) 
       i = Bars - counted_bars - 1;
   while(i >= 0)
     {
       negative = 1000;
       positive = 0;
       if(i < Bars - ExPeriod - 1)
         {
           int k = i + ExPeriod;
           while(k >= i)
             {
               if(High[k] > positive) 
                   positive = High[k];
               if(Low[k] < negative) 
                   negative = Low[k];
               k--;
             }
         }
       double poss = 0;
       if(Normalize <1) 
           Normalize = 1;
       if(Normalize > 1000) 
           Normalize = 1000;
       for(int j = 1; j != Normalize; j++)
         {
           poss += MassBuffer[i+j];     
         }
       pos = (poss + ((positive - negative)*3000)) / Normalize;
       MassBuffer[i] = pos;
       i--;
     }
//----
   return(0);
  }
//+------------------------------------------------------------------+

Comments