GentorCCI_v1
Download scriptThe GentorCCIM is a specialized technical analysis tool designed to help traders visualize market momentum, price trends, and potential reversal points by combining several mathematical models into a single visual interface.
Instead of looking at basic price movements alone, this script processes data to highlight the "strength" behind the current market direction. Here is a breakdown of how the logic works:
Multi-Layered Momentum Analysis
The core of the script relies on calculating the Commodity Channel Index (CCI) across two different timeframes simultaneously:
- Fast Momentum: By tracking a shorter period of price action, the script identifies quick, immediate shifts in market sentiment.
- Slow Momentum: By tracking a longer period, the script provides a broader perspective on the overall trend.
By comparing these two different speeds of momentum, traders can better understand if a current move is a long-term trend or just a temporary "spike."
Visual Histogram and Trend Tracking
To make this information easy to read, the script generates several visual components:
- The Histogram: This provides a dynamic representation of the slower momentum period, helping you see the "weight" of the market's current direction at a glance.
- Dynamic Trend Boundaries: The script uses an Exponential Moving Average (EMA) as a baseline to determine the market's primary health. It intelligently places visual markers based on where the current price sits in relation to this average.
- If the price is performing well above the average, it signals a bullish environment.
- If the price falls below the average, it highlights a bearish environment.
Key Objectives for the Trader
The logic behind this tool is designed to provide three main benefits:
- Trend Identification: It helps you distinguish between "noise" and a sustained move by layering fast and slow momentum data.
- Overbought/Oversold Context: By utilizing CCI values, it provides a clearer picture of when a market might be stretched too far in one direction.
- Clear Visual Cues: Rather than forcing you to interpret raw numbers, the script converts these complex calculations into distinct lines and bars, allowing for quicker decision-making during live trading sessions.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| 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