SuperWoodieCCI_v1

Download script
Author: duckfu
SuperWoodieCCI_v1

Overview of the SuperWoodiesCCI Logic

This technical indicator is designed to provide traders with a visual representation of market momentum and trend direction by analyzing the Commodity Channel Index (CCI). Rather than simply showing a raw data line, this tool filters price action to identify sustained "bullish" and "bearish" movements, helping users distinguish between active trends and sideways market noise.

Core Components

The logic operates using three primary layers of visual information:

1. The Baseline Indicators (CCI & TCCI) The script first calculates two variations of the Commodity Channel Index. These act as the foundation for the entire tool. One is a standard long-term calculation, while the other serves as a secondary reference point to help track the overall price velocity relative to its average.

2. The Trend Recognition Logic (Upward Movement) The script doesn't react instantly to every minor price fluctuation. Instead, it uses a "look-back" verification system. It examines a sequence of 6 consecutive data points:

  • If the indicator remains consistently above zero for a sustained period, the logic identifies this as an Uptrend.
  • When an uptrend is confirmed, the tool highlights this visually using a specific color (Lime Green).

3. The Trend Recognition Logic (Downward Movement) Similarly, the script performs a secondary check for bearish momentum:

  • It looks for a sustained sequence where the indicator remains consistently below zero.
  • Once this downward move is verified over the required duration, it identifies it as a Downtrend, highlighting it with a distinct color (Red).

4. Neutral Market Detection (Flat Movement) When the price action does not meet the specific requirements for either a confirmed uptrend or a confirmed downtrend (meaning the movement is inconsistent or lacks sufficient momentum), the script classifies this as a "Flat" or "No Trend" state. This is represented by a different visual color (Blue) to warn the user of potential market indecision.

Summary for Traders

The primary goal of this logic is to filter out "false signals." By requiring a sequence of data points to align before triggering a trend color, it aims to show users where the market has significant staying power. It effectively separates high-momentum movements (Green/Red) from periods of consolidation or erratic price action (Blue), providing a clearer picture of the current market environment at a single glance.

Indicators Used
Commodity channel index
Miscellaneous
Implements a curve of type %1
17 Views
0 Downloads
0 Favorites
SuperWoodieCCI_v1
//+------------------------------------------------------------------+
//|                                              SuperWoodiesCCI.mq4 |
//|                                                           duckfu |
//|                                          http://www.dopeness.org |
//+------------------------------------------------------------------+
#property copyright "duckfu"
#property link      "http://www.dopeness.org"

#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 White // CCI Colour (note the superfluous vowel, cheers mates ;)
#property indicator_color2 Yellow // TCCI Colour
#property indicator_color3 LimeGreen // Long Trend Histogram Colour 
#property indicator_color4 Red // Short Trend Histogram Colour
#property indicator_color5 Blue // No Trend Histogram Colour
//---- input parameters
extern int       CCI_Period=50;
extern int       TCCI_Period=0;
//---- buffers
double ExtCCIBuffer[];
double ExtTCCIBuffer[];
double ExtLongHistBuffer[];
double ExtShortHistBuffer[];
double ExtFlatHistBuffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init(){
//---- indicators
   SetIndexStyle(0,DRAW_LINE,STYLE_SOLID,1);
   SetIndexBuffer(0,ExtCCIBuffer);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtTCCIBuffer);
   SetIndexStyle(2,DRAW_HISTOGRAM,STYLE_SOLID,1);
   SetIndexBuffer(2,ExtLongHistBuffer);
   SetIndexStyle(3,DRAW_HISTOGRAM,STYLE_SOLID,1);
   SetIndexBuffer(3,ExtShortHistBuffer);
   SetIndexStyle(4,DRAW_HISTOGRAM,STYLE_SOLID,1);
   SetIndexBuffer(4,ExtFlatHistBuffer);
   ArrayInitialize(ExtCCIBuffer,0);
   ArrayInitialize(ExtTCCIBuffer,0);
   ArrayInitialize(ExtLongHistBuffer,0);
   ArrayInitialize(ExtShortHistBuffer,0);
   ArrayInitialize(ExtFlatHistBuffer,0);
//----
   return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit(){
//---- TODO: add your code here
   
//----
   return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start(){
   int i,j,limit,counted_bars=IndicatorCounted();
   int uptrending=0,downtrending=0;
//---- TODO: add your code here
   if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
//---- main loop
   for(i=0; i<limit; i++){
      ExtCCIBuffer[i]=iCCI(NULL,0,CCI_Period,PRICE_TYPICAL,i);
      ExtTCCIBuffer[i]=iCCI(NULL,0,TCCI_Period,PRICE_TYPICAL,i);
      ExtFlatHistBuffer[i]=ExtCCIBuffer[i];     
   }
   
   for(i=0;i<limit;i++){
      for(j=0;j<6;j++){
         if(ExtCCIBuffer[i+j] > 0){
            uptrending++;
         } else if(ExtCCIBuffer[i+j] < 0){
            uptrending=0;         
         }
      }
      
      if(uptrending>5){
         ExtLongHistBuffer[i]=ExtCCIBuffer[i];
         ExtShortHistBuffer[i]=0;
         ExtFlatHistBuffer[i]=0;
      }
   }
   
   for(i=0;i<limit;i++){
      for(j=0;j<6;j++){
         if(ExtCCIBuffer[i+j] < 0){
            downtrending++;
         } else if(ExtCCIBuffer[i+j] > 0){
            downtrending=0;
         }
      }
      
      if(downtrending>5){
         ExtShortHistBuffer[i]=ExtCCIBuffer[i];
         ExtLongHistBuffer[i]=0;
         ExtFlatHistBuffer[i]=0;
      }
   }
   return(0);
}
//+------------------------------------------------------------------+

Comments