i-GentorCCIM_v[1].0.2_v1
Download scriptThis indicator is designed to help traders visualize market momentum and identify trend shifts by utilizing a dual-layer Commodity Channel Index (CCI) system. Unlike standard indicators that provide a single line of data, this tool breaks down price movement into three distinct visual components: speed, historical context, and trend direction.
Core Logic and Components
1. Dual CCI Analysis (Fast vs. Slow) The script operates by comparing two different speeds of market momentum:
- Fast CCI: Tracks rapid price fluctuations to capture immediate moves.
- Slow CCI: Provides a broader view of the market's overall direction over a longer period.
By calculating both simultaneously, the tool allows you to see whether current "fast" price action is aligned with or deviating from the "slow" underlying trend.
2. Trend Tracking and Coloring The indicator automatically categorizes the market into "Up" or "Down" trends based on the position of the Slow CCI relative to the zero line.
- When the slow momentum is positive, it highlights the upward trend.
- When the slow momentum is negative, it identifies the downward trend. This visual distinction helps traders quickly identify which way the "heavy" money is moving, reducing the noise of minor price fluctuations.
3. Signal Identification and Bar Logic One of the primary features of this script is its ability to detect specific "signal bars." The logic monitors the behavior of the slow momentum line:
- Zero-Crossings: The script watches for moments when the momentum flips from positive to negative (or vice versa).
- Counting Mechanism: It uses a internal counter to track these crossings. When certain conditions are met—specifically when momentum moves across the zero level—it identifies a potential signal point.
- Visual Signaling: Rather than just showing a line, the script marks specific bars on the chart to alert you to these transition points, helping you spot high-probability areas where the trend might be changing.
How it Works for the Trader
Instead of looking at raw numbers, a user sees a dynamic environment where the background "trend" is clearly defined by different colors and histogram bars. The script essentially filters out the "jitter" of the market to show you:
- The Current Trend: Is the momentum currently pushing prices up or down?
- The Momentum Strength: How aggressively is the price moving relative to its recent history?
- The Turning Points: Where is the market showing signs of exhaustion or reversal?
In summary, this tool transforms standard CCI data into a visual roadmap, highlighting trend direction and signaling specific moments where the market's momentum may be shifting.
/*-----------------------------+
| |
| Shared by www.Aptrafx.com |
| |
+------------------------------*/
//+------------------------------------------------------------------+
//| i-GentorCCIM_v.0.2.mq4 |
//| Egorov Gennadiy |
//| 2005.08.20 KimIV v.0.0 |
//| Íåìíîãî ìîäåðíèçèðîâàë, äîáàâèâ LSMA è ïîìåíÿâ å¸ ìåñòàìè ñ ÅÌÀ |
//| 2005.08.20 KimIV v.0.1 |
//| Îñâîáîäèë îäèí áóôåð |
//| 2005.08.20 KimIV v.0.2 |
//| Óáðàë LSMA è EMA. |
//| Ñäåëàë ñèãíàëüíûé øåñòîé áàð è òðåíäîâóþ ðàñêðàñêó |
//+------------------------------------------------------------------+
#property copyright "Egorov Gennadiy, FX Sniper, KimIV"
#property link "http://www.kimiv.ru"
#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 Red
#property indicator_color2 Black
#property indicator_color3 Silver
#property indicator_color4 Yellow
#property indicator_color5 Lime
#property indicator_color6 Red
#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
//------- Âíåøíèå ïàðàìåòðû ------------------------------------------
extern int SlowCCIPeriod = 14; // Ïåðèîä ìåäëåííîãî CCI
extern int FastCCIPeriod = 6; // Ïåðèîä áûñòðîãî CCI
//------- Áóôåðû èíäèêàòîðà ------------------------------------------
double FastCCI[];
double SlowCCI[];
double HistCCI[];
double SignalBar[];
double TrendUp[];
double TrendDown[];
//------- Ãëîáàëüíûå ïåðåìåííûå --------------------------------------
bool fct=False, fup=False, fdn=False;
int ss=1;
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
void init() {
IndicatorDigits(2);
SetIndexStyle (0, DRAW_LINE, STYLE_SOLID, 1);
SetIndexBuffer(0, FastCCI);
SetIndexStyle (1, DRAW_LINE, STYLE_SOLID, 2);
SetIndexBuffer(1, SlowCCI);
SetIndexStyle (2, DRAW_HISTOGRAM, STYLE_SOLID, 1);
SetIndexBuffer(2, HistCCI);
SetIndexStyle (3, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(3, SignalBar);
SetIndexStyle (4, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(4, TrendUp);
SetIndexStyle (5, DRAW_HISTOGRAM, STYLE_SOLID, 2);
SetIndexBuffer(5, TrendDown);
Comment("");
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
void deinit() {
Comment("");
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start() {
int shift;
int counted_bars=IndicatorCounted();
if (counted_bars<0) return;
if (counted_bars>0) counted_bars--;
// for (shift=counted_bars; shift>=0; shift--) {
for (shift=Bars; shift>=0; shift--) {
TrendUp[shift] = 0;
TrendDown[shift] = 0;
FastCCI[shift] = iCCI(NULL, 0, FastCCIPeriod, PRICE_TYPICAL, shift);
SlowCCI[shift] = iCCI(NULL, 0, SlowCCIPeriod, PRICE_TYPICAL, shift);
HistCCI[shift] = SlowCCI[shift];
if (HistCCI[shift+1]*HistCCI[shift]<0) {
if (ss<=3) {
if ((fup && HistCCI[shift]>0)
|| (fdn && HistCCI[shift]<0)) fct = True;
} else fct = False;
ss = 1;
}
if (ss==6) SignalBar[shift] = HistCCI[shift];
else SignalBar[shift] = 0;
if (ss>6 || fct) {
if (HistCCI[shift]>=0) {
TrendUp[shift] = HistCCI[shift];
fup = True; fdn = False;
} else {
TrendDown[shift] = HistCCI[shift];
fdn = True; fup = False;
}
}
ss++;
}
}
//+------------------------------------------------------------------+
Comments