FX Sniper's T3 CCI_001
Download scriptThis tool is designed to provide traders with a refined view of market momentum by combining two distinct technical analysis methods into a single visual display. By merging the characteristics of the CCI (Commodity Channel Index) with a specialized smoothing filter known as the T3 moving average, it aims to offer a cleaner, more reliable signal than standard indicators often do.
Core Logic and Mechanism
The script functions through a three-step process to translate raw market data into actionable visual information:
1. Foundation (Standard Momentum) The indicator first looks at the "Typical Price" of the asset over a specific period (defined by the CCI Period). This tells the system how much the current price deviates from its average. Essentially, it identifies whether the market is currently "overbought," "oversold," or moving with significant strength.
2. Refinement (The T3 Smoothing Filter) Raw momentum data can often be "noisy," meaning it can jump around erratically due to small, insignificant price fluctuations. To solve this, the script applies a sophisticated mathematical formula known as the T3 filter.
- Unlike standard moving averages that can cause significant lag (delaying your reaction to a price move), the T3 logic is designed to remain responsive while smoothing out the jagged edges of the data.
- It uses a series of weighted calculations to "clean" the momentum signal, ensuring that only meaningful trends are highlighted.
3. Visual Separation (Upward vs. Downward Momentum) Finally, the script takes this smoothed momentum value and splits it into two distinct visual components based on whether the movement is positive or negative:
- Positive Momentum: When the calculated value is above zero, it is displayed as an upward-pointing visual.
- Negative Momentum: When the calculated value falls below zero, it is captured as a downward-pointing visual.
Summary for the User
Instead of looking at a cluttered price chart, this script provides a dedicated window that acts as a "momentum speedometer." It filters out the market noise using the T3 logic and shows you the strength of the current trend. When the indicator moves significantly in one direction, it suggests strong momentum is present; when it hovers near zero, it suggests the market is consolidating or lacks a clear trend.
//+------------------------------------------------------------------+
//| T3 CCI.mq4 |
//| FX Sniper |
//| |
//+------------------------------------------------------------------+
#property copyright "FX Sniper: T3-CCI :-)"
#property link "http://dunno.com :-)/"
#property indicator_separate_window
#property indicator_buffers 3
#property indicator_color1 Blue
#property indicator_color2 Lime
#property indicator_color3 Red
extern int CCI_Period = 14;
extern int T3_Period = 5;
extern double b = 0.618;
double e1,e2,e3,e4,e5,e6;
double c1,c2,c3,c4;
double n,w1,w2,b2,b3;
double cci[];
double cciHup[];
double cciHdn[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators setting
IndicatorBuffers(8);
SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,2);
SetIndexStyle(1,DRAW_HISTOGRAM,0,1);
SetIndexStyle(2,DRAW_HISTOGRAM,0,1);
IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS));
IndicatorShortName("FX Sniper's T3-CCI: "+CCI_Period);
SetIndexBuffer(0,cci);
SetIndexBuffer(1,cciHup);
SetIndexBuffer(2,cciHdn);
SetIndexLabel(0,"T3-CCI");
//---- variable reset
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=T3_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;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
//---- indicator calculation
//for(int i=limit; i>=0; i--)
for(int i=Bars-1; i>=0; i--)
{
cci[i]= iCCI(NULL,0,CCI_Period, PRICE_TYPICAL ,i);
e1 = w1*cci[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;
cci[i] = c1*e6 + c2*e5 + c3*e4 + c4*e3;
if (cci[i] >= 0 )
cciHup[i] = cci[i];
else
cciHup[i] = 0;
if (cci[i] < 0 )
cciHdn[i] = cci[i];
else
cciHdn[i]=0;
}
//----
return(0);
}
//+------------------------------------------------------------------+
Comments