#Kino_CCI_RSI_v5
Download scriptThis script is a custom technical analysis tool designed to help traders identify specific momentum shifts and price trends by combining three different mathematical indicators: the Commodity Channel Index (CCI) and the Relative Strength Index (RSI). Instead of looking at just one piece of data, it synthesizes these different perspectives into a single visual window to highlight potential market opportunities.
Core Logic Overview
The tool functions by monitoring three distinct layers of market data simultaneously:
1. Dual CCI Momentum Tracking The script tracks two different versions of the Commodity Channel Index (CCI) at the same time—one with a short-term period (34) and one with a long-term period (170).
- The goal here is to observe "crossovers" or momentum shifts.
- The script specifically looks for instances where both indicators transition from negative territory to positive (suggesting upward momentum) or from positive to negative (suggesting downward momentum).
2. RSI Strength Filtering To ensure the momentum identified by the CCI is actually backed by strong price movement, the script uses the Relative Strength Index (RSI). It acts as a filter:
- It looks for "over-strength" or "high-activity" signals (where the RSI is above 55).
- It looks for "weakness" or "low-activity" signals (where the RSI is below 45).
- By requiring these conditions to be met alongside the CCI movements, the tool attempts to filter out "noise" and only highlight moves that have significant underlying strength.
3. Visual Signaling and Mapping The script translates these complex calculations into a visual interface on your chart:
- Dynamic Arrows: When the specific criteria for upward momentum are met (matching CCI shifts combined with high RSI), the script places a visual marker. Conversely, it places a different marker when downward momentum conditions are met.
- Trend Lines: It draws two continuous lines representing the short and long-term CCI values, allowing you to see the "flow" of the market trends over time.
- Histogram Bars: The script includes a three-part histogram based on the RSI levels. This provides a visual representation of where the price is currently sitting in relation to the 45 and 55 thresholds, helping you see at a glance whether the market is leaning toward bullish, bearish, or neutral territory.
Summary for the User
In simple terms, this tool acts as a "confirmation engine." It waits for the short-term momentum to align with the long-term trend (via the CCI lines) and then checks if the current price strength (via the RSI) is significant enough to be worth noticing. When all these conditions align, it signals it visually on your screen, helping you identify entries where momentum and trend are moving in the same direction.
//+------------------------------------------------------------------+
//| #CCIs&RSI8___v5.mq4 |
//| Copyright © 2008, MetaQuotes Software Corp. |
//| http://kinonen.over-blog.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link "http://kinonen.over-blog.com"
#property indicator_separate_window
#property indicator_buffers 7
#property indicator_color6 Blue
#property indicator_color7 PaleGreen
#property indicator_color3 DarkGreen
#property indicator_color4 Red
#property indicator_color5 Yellow
#property indicator_color1 OrangeRed
#property indicator_color2 Lime
#property indicator_level1 100
#property indicator_level2 200
#property indicator_level3 300
#property indicator_level4 0
#property indicator_level5 -300
#property indicator_level6 -200
#property indicator_level7 -100
#property indicator_levelcolor Aqua
extern int CCI1=34;
extern int CCI2=170;
extern int RsiMultiplicator=1;
extern int NbOfCandles=1000;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
double ExtMapBuffer7[];
//+------------------------------------------------------------------+
//| expert initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0, DRAW_ARROW, EMPTY,2);
SetIndexArrow(0, 234);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1, DRAW_ARROW, EMPTY,2);
SetIndexArrow(1, 233);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle (2,DRAW_HISTOGRAM, 0, 4);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle (3,DRAW_HISTOGRAM, 0, 4);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle (4,DRAW_HISTOGRAM, 0, 4);
SetIndexBuffer(4,ExtMapBuffer5);
SetIndexStyle(5,DRAW_LINE, STYLE_SOLID, 2, Blue);
SetIndexBuffer(5,ExtMapBuffer6);
SetIndexStyle(6,DRAW_LINE, STYLE_SOLID, 2, PaleGreen);
SetIndexBuffer(6,ExtMapBuffer7);
SetIndexLabel(0,"CCI 34");
SetIndexLabel(1,"CCI 170");
SetIndexLabel(2,"RSI>55");
SetIndexLabel(3,"RSI<45");
SetIndexLabel(4,"45<RSI<55");
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
//----
return(0);
}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{int limit;
double val1,val2,val3,val22,val11,val33;
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;
//==========================================
for(int i = NbOfCandles; i >= 0; i--)
{
val1=iCCI(NULL,0,CCI1,PRICE_TYPICAL,i);
val11=iCCI(NULL,0,CCI1,PRICE_TYPICAL,i+1);
val2=iCCI(NULL,0,CCI2,PRICE_TYPICAL,i);
val22=iCCI(NULL,0,CCI2,PRICE_TYPICAL,i+1);
val3=iRSI(NULL,0,8,PRICE_CLOSE,i);
val33=iRSI(NULL,0,8,PRICE_CLOSE,i+1);
if((val2>0 && val1>0 && val11<0)||(val1>0 && val2>0 && val22<0)&& (val3>55) ) //&& val3>55)
ExtMapBuffer2[i]=-100;
else
if((val2<0 && val1<0 && val11>0)||(val1<0 && val2<0 && val22>0) && (val3<45)) // && val33>45 )
ExtMapBuffer1[i]=100;
if (val3>=55)
ExtMapBuffer3[i]=-val3*RsiMultiplicator;
else
if (val3<=45)
ExtMapBuffer4[i]=-val3*RsiMultiplicator;
else
ExtMapBuffer5[i]=-val3*RsiMultiplicator;
ExtMapBuffer6[i]=val1; //CCI34
ExtMapBuffer7[i]=val2; //CCI170
}
//----
//----
return(0);
}
//+------------------------------------------------------------------+
Comments