GentorCCI
Download scriptThis tool is a technical analysis indicator designed to help traders visualize market momentum and trend direction through a combination of customized price oscillators and moving averages. Rather than cluttering the main price chart, it operates in a separate window, providing a dedicated space for analyzing underlying market dynamics.
Core Analysis Components
The logic of this script revolves around three primary visual elements:
1. Dual CCI Momentum Tracking The indicator utilizes two different "Commodity Channel Index" (CCI) calculations. The CCI is a standard tool used to identify whether an asset is overbought or oversold by measuring price deviation from its average.
- Fast Momentum: This tracks short-term price swings quickly.
- Slow Momentum: This tracks long-term price trends more steadily. By comparing these two different speeds, the tool allows you to see the relationship between immediate "noise" in the market and the broader established trend.
2. Histogram Visuals The script includes a histogram component that mirrors the longer-term momentum data. While the lines show the continuous flow of price movement, the histogram provides a clearer visual representation of the strength and direction of the current price cycle.
3. Dynamic Trend Boundary Logic A unique feature of this script is its automated "color-coding" logic based on an Exponential Moving Average (EMA). The tool monitors where the current closing price sits in relation to this average:
- When the price is trading above the moving average, it signals a bullish environment.
- When the price falls below the moving average, it signals a bearish environment.
The script handles these conditions by dynamically adjusting what is displayed on your screen, effectively highlighting the current trend state so you can quickly identify whether the market is currently leaning toward "high" or "low" territory without having to manually calculate the cross-over points.
How it works for the user
Essentially, this indicator filters out the complexity of raw price action and translates it into a simplified visual map. It tells you:
- Direction: Where the price is trending relative to its average.
- Speed: How fast that trend is moving (via the Fast and Slow CCI lines).
- Strength: The intensity of the current movement (via the Histogram).
By observing the interaction between these lines and the histogram, traders can better identify potential turning points or confirm the strength of an existing move.
//+------------------------------------------------------------------+
//| GentorCCIM .mq4 |
//| Egorov Gennadiy |
//+------------------------------------------------------------------+
#property copyright "Egorov Gennadiy"
#property link ""
#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Red
#property indicator_color2 Black
#property indicator_color3 Lime
#property indicator_color4 Yellow
#property indicator_color5 Green
#property indicator_level1 300
#property indicator_level2 200
#property indicator_level3 100
#property indicator_level4 50
#property indicator_level5 -50
#property indicator_level6 -100
#property indicator_level7 -200
#property indicator_level8 -300
//---- input parameters
extern int A_period=14;
extern int B_period=6;
extern int EMA=34;
extern int num_bars=300;
// parameters
int shift=0;
//---- buffers
double FastWoodieCCI[];
double SlowWoodieCCI[];
double HistoWoodieCCI[];
double LineHighEMA[];
double LineLowEMA[];
//---- indicator buffers
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
IndicatorDigits(2);
//---- indicators
SetIndexStyle(0,DRAW_LINE,0,1);
SetIndexBuffer(0,FastWoodieCCI);
SetIndexStyle(1,DRAW_LINE,0,2);
SetIndexBuffer(1,SlowWoodieCCI);
SetIndexStyle(2,DRAW_HISTOGRAM,0,1);
SetIndexBuffer(2,HistoWoodieCCI);
SetIndexStyle(3,DRAW_LINE,1,3);
SetIndexBuffer(3,LineHighEMA);
SetIndexStyle(4,DRAW_LINE,1,3);
SetIndexBuffer(4,LineLowEMA);
//---- initialization done
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int i;
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--;
counted_bars = Bars - counted_bars;
for (shift = 0; shift < counted_bars; shift++)
{
//
FastWoodieCCI[shift]=iCCI(NULL,0,B_period,PRICE_TYPICAL,shift);
SlowWoodieCCI[shift]=iCCI(NULL,0,A_period,PRICE_TYPICAL,shift);
HistoWoodieCCI[shift]=iCCI(NULL,0,A_period,PRICE_TYPICAL,shift);
//----------------color coding---------------------------
LineLowEMA[shift]=0;
LineHighEMA[shift]=0;
double EmaValue = iMA( NULL, 0, EMA, 0, MODE_EMA, PRICE_TYPICAL, shift );
if ( Close[shift] > EmaValue )
LineHighEMA[shift]=EMPTY_VALUE;
else
if (Close[shift] < EmaValue )
LineLowEMA[shift]=EMPTY_VALUE;
}
//---- done
return(0);
}
//+------------------------------------------------------------------+
Comments