LaguerreVolume_v2

Download script
LaguerreVolume_v2

This script is a specialized technical analysis tool designed to measure and visualize market momentum by analyzing trading volume. Instead of simply looking at price action, it focuses on how much "effort" is being put into the market, helping traders identify the strength behind current trends.

Core Methodology

The logic operates by processing historical volume data through a multi-layered smoothing process. Rather than reacting impulsively to every single trade, the script uses a mathematical approach (based on Laguerre filters) to create a fluid, continuous flow of information.

It looks at three primary components:

  1. Volume Smoothing: The script takes the raw volume of each trading period and blends it with previous data points. This reduces "noise" and helps highlight the underlying trend of market activity.
  2. Comparative Momentum: It calculates the differences between several levels of these smoothed volume signals. By comparing these differences against one another, the tool can determine if the volume is accelerating, decelerating, or remaining steady.
  3. Relative Strength Calculation: Finally, it converts these comparative movements into a standardized percentage scale (ranging from 0 to 1). This allows you to see the relative strength of current momentum compared to recent history at a single glance.

How to Interpret the Results

The output is displayed as a continuous line on a separate window in your trading platform. Because the data is normalized:

  • High Values: Indicate that the volume momentum is strongly positive, suggesting high-conviction activity in the current direction.
  • Low Values: Indicate a shift toward negative momentum or a cooling off of the previous trend.
  • The Mid-Point: Helps traders identify "equilibrium," where neither side has a dominant volume advantage, often signaling a potential period of consolidation or a reversal.

Customization

The script includes two primary settings that allow users to tailor the logic to their specific trading style:

  • Gamma: This acts as a sensitivity slider. Adjusting this value changes how quickly the indicator reacts to new volume spikes versus maintaining its previous trend.
  • CountBars: This determines the historical "memory" of the script, defining how many past candles the tool considers when calculating the current momentum.
13 Views
0 Downloads
0 Favorites
LaguerreVolume_v2
//+-------------------------------------------------------------------------+
//| LaguerreVolume.mq4                                                      |
//| Emerald King, t_david                                                   |
//| http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators |
//+-------------------------------------------------------------------------+
#property link      "http://finance.groups.yahoo.com/group/MetaTrader_Experts_and_Indicators"
//----
#property indicator_separate_window
#property indicator_minimum -0.05
#property indicator_maximum 1.05
#property indicator_color1 Orange
#property indicator_level2 1.0
#property indicator_level3 0.75
#property indicator_level4 0.50
#property indicator_level5 0.25
#property indicator_level6 0.0
//---- input parameters
extern double gamma     =0.618;
extern int    CountBars =300;
//----
double L0  =0;
double L1  =0;
double L2  =0;
double L3  =0;
double L0A =0;
double L1A =0;
double L2A =0;
double L3A =0;
double LRSI=0;
double CU  =0;
double CD  =0;
double val1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
//----
   SetIndexBuffer(0,val1);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//---- TODO: add your code here
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   if (CountBars>Bars) CountBars=Bars;
   SetIndexDrawBegin(0,Bars-CountBars);
//----
   int i;
   int    counted_bars=IndicatorCounted();
//----
   i=CountBars-1;
   while(i>=0)
     {
      L0A=L0;
      L1A=L1;
      L2A=L2;
      L3A=L3;
      L0=((1 - gamma)*(Volume[i])) + (gamma*L0A);
      L1=- gamma *L0 + L0A + gamma *L1A;
      L2=- gamma *L1 + L1A + gamma *L2A;
      L3=- gamma *L2 + L2A + gamma *L3A;
      CU=0;
      CD=0;
//----
      if (L0>=L1) CU=L0 - L1; else CD=L1 - L0;
      if (L1>=L2) CU=CU + L1 - L2; else CD=CD + L2 - L1;
      if (L2>=L3) CU=CU + L2 - L3; else CD=CD + L3 - L2;
      if (CU + CD!=0) LRSI=CU/(CU + CD);
      val1[i]=LRSI;
      i--;
     }
   return(0);
  }
//+------------------------------------------------------------------+

Comments