Author: FX Sniper: T3-CCI :-)
CCI 8

The FX Sniper's T3 CCI is a specialized technical analysis tool designed to help traders identify momentum and price trends with greater precision. It operates by taking a standard market momentum indicator—the Commodity Channel Index (CCI)—and layering it with a sophisticated smoothing mathematical filter known as the "T3" moving average.

Core Logic & Mechanics

The script functions through a multi-step processing flow to transform raw market data into visual signals:

1. Initial Data Collection The tool begins by calculating the standard Commodity Channel Index (CCI). This represents the current price relative to its recent average, helping to determine whether an asset is overbought, oversold, or moving with strength.

2. The T3 Smoothing Filter Rather than displaying the raw CCI (which can be "noisy" and jump around erratically), the script passes the data through a Triple-Three (T3) calculation. This specific mathematical logic is designed to reduce market noise while maintaining the integrity of the price trend. It creates a much smoother line that reacts quickly to significant changes without getting distracted by minor, insignificant price fluctuations.

3. Weighted Calculation The script utilizes specific weighting coefficients (based on customizable periods and constants). These weights ensure that the smoothed line accurately reflects the most relevant recent price action, balancing responsiveness with stability.

4. Visual Signal Separation To make the data easy to interpret at a glance, the script splits the final output into three distinct visual components:

  • The Primary Trend Line: A continuous line representing the smoothed momentum of the market.
  • Bullish Momentum (Upward): The tool isolates positive values. When the momentum is above the zero level, it creates a specific visual histogram. This highlights periods of strength or upward pressure.
  • Bearish Momentum (Downward): Conversely, the tool isolates negative values. When momentum drops below the zero level, a separate histogram appears, highlighting periods of weakness or downward pressure.

Summary for Traders

In practical terms, this script provides a "cleaned up" version of market momentum. By smoothing out the jagged edges of standard indicators, it helps traders see the underlying trend more clearly. The visual separation of positive and negative momentum allows for a quicker identification of whether the current market sentiment is leaning bullish or bearish, providing a clearer picture of where the price may be headed next.

Indicators Used
Commodity channel index
Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
CCI 8
//+------------------------------------------------------------------+
//|                                           FX Sniper's 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 White
#property  indicator_color2  DodgerBlue
#property  indicator_color3  Crimson
//----
extern int CCI_Period = 8;
extern int T3_Period = 1;
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
    SetIndexBuffer(0, cci);
    SetIndexBuffer(1, cciHup);
    SetIndexBuffer(2, cciHdn);
//----
    SetIndexStyle(0, DRAW_LINE);
    SetIndexStyle(1, DRAW_HISTOGRAM);
    SetIndexStyle(2, DRAW_HISTOGRAM);
    SetIndexStyle(3, DRAW_HISTOGRAM); 
//----        
    IndicatorShortName("CCI 8(" + CCI_Period + ", " + T3_Period + ")");
    SetIndexLabel(0, "FXST3CCI");     
   SetIndexLabel(1, NULL);
   SetIndexLabel(2, NULL);   
//---- 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 = 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