This indicator is designed to provide traders with a smoothed visualization of market trading volume. By analyzing how much activity is occurring in the market, it helps filter out "noise" and highlights underlying trends in trading intensity rather than just price movement alone.
Core Logic and Mechanism
The script operates by applying a sophisticated multi-layered smoothing process to the raw volume data. Here is a breakdown of how it functions:
1. Volume Averaging Strategy Instead of looking at a single moment’s volume, the tool calculates a moving average. It takes the current trading volume and blends it with previous values. This ensures that sudden, isolated spikes in activity don't cause erratic jumps in the visual output, allowing for a much cleaner view of sustained market interest.
2. The T3 Smoothing Method The indicator utilizes the "T3" smoothing logic, which is known for being significantly more responsive and stable than standard moving averages. It achieves this through a recursive mathematical process where the volume data is passed through multiple stages of calculation (represented as a chain of variables). Each stage captures a different "layer" of the data, which are then combined to create a final result that maintains the integrity of the original trend while removing unnecessary jagged edges.
3. Custom Weighting and Sensitivity The script uses specific coefficients to determine how much weight to give to recent data versus older data. By using these mathematical constants, the indicator balances two competing needs:
- Responsiveness: Ensuring the line moves quickly enough to react to new market information.
- Stability: Preventing the line from reacting too aggressively to minor fluctuations.
How it appears on your chart
The result is a solid red line plotted in a separate window below your main price chart. By observing this line, you can gauge the "momentum" of the market. When the line rises significantly, it suggests increasing participation from traders; when it flattens or drops, it indicates a cooling period in market activity. This serves as a secondary confirmation tool to help verify whether a price move is being backed by significant volume or if it lacks conviction.
//+------------------------------------------------------------------+
//|T3.mq4 MojoFX , Moving_Volume_Average transport_david , |
//| |
//| http://groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/ |
//+------------------------------------------------------------------+
#property copyright "MojoFX - Conversion only, Volume transport_david"
#property link "http://groups.yahoo.com/group/MetaTrader_Experts_and_Indicators/"
#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Red
extern int MA_Period = 48;
extern double b = 0.618;
double MapBuffer[];
double e1,e2,e3,e4,e5,e6;
double c1,c2,c3,c4;
double n,w1,w2,b2,b3;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators setting
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1,Red);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
IndicatorShortName("T3 Moving Volume Average"+MA_Period);
SetIndexBuffer(0,MapBuffer);
//---- variable reset
e1=0; e2=0; e3=0; e4=0; e5=0; e6=0;
c1=0; c2=0; c3=0; c4=0;
n=0;
w1=0; w2=0;
b2=0; b3=0;
b2=b*b;
b3=b2*b;
c1=-b3;
c2=(3*(b2+b3));
c3=-3*(2*b2+b+b3);
c4=(1+3*b+b3+3*b2);
n=MA_Period;
if (n<1) n=1;
n = 1 + 0.5*(n-1);
w1 = 2 / (n + 1);
w2 = 1 - w1;
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit=Bars;
//---- indicator calculation
for(int i=limit; i>=0; i--)
{
e1 = w1*Volume[i] + w2*e1;
e2 = w1*e1 + w2*e2;
e3 = w1*e2 + w2*e3;
e4 = w1*e3 + w2*e4;
e5 = w1*e4 + w2*e5;
e6 = w1*e5 + w2*e6;
MapBuffer[i]=c1*e6 + c2*e5 + c3*e4 + c4*e3;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments