CCIRSIDOT_v1
Download scriptThe RSI with Trend Catcher is a specialized technical analysis tool designed to help traders identify momentum shifts and potential price reversals by combining two well-known market indicators: the Relative Strength Index (RSI) and the Commodity Channel Index (CCI).
By merging these two perspectives, the script attempts to filter out "noise" and provide clearer signals on whether the current market trend is gaining strength or losing steam.
Core Logic and Functionality
1. Momentum Tracking (RSI Component) The tool monitors the RSI to detect significant shifts in momentum. It specifically looks for moments where the RSI crosses the 50 level. In technical analysis, the 50 level acts as a "midpoint":
- When the indicator moves from below 50 to above 50, it suggests bullish momentum is taking over.
- When it moves from above 50 to below 50, it suggests bearish pressure is increasing. The script identifies these specific crossover points to help highlight where the "mood" of the market is shifting.
2. Trend Strength Identification (CCI Component) While the RSI handles momentum, the CCI component evaluates the price relative to its average range. The logic focuses on key thresholds:
- It tracks the CCI values to determine if the price is moving into overbought or oversold territory.
- The script provides visual feedback and alerts when the CCI crosses specific boundaries (such as the 100 level), signaling that a trend may be reaching an extreme point.
3. Visual Signals and Alerts To make the data actionable for the user, the script translates these mathematical calculations into visual cues on the trading chart:
- On-Chart Markers: The tool places specific arrows (dots) at the exact moment the RSI crosses the 50 midpoint. These serve as immediate visual "flags" for momentum changes.
- Real-Time Notifications: If enabled, the script features an automated alert system. It monitors the CCI values and sends a notification when the price breaks through key levels, ensuring that traders can react quickly even if they aren't staring at the screen constantly.
Summary for the Trader
In simple terms, this tool acts as a "double-check" system. It uses the RSI to tell you where the momentum is switching directions and the CCI to tell you how strong that move is relative to recent history. By looking for areas where both indicators signal a shift, traders can aim to enter positions with more confidence in the prevailing trend.
/*
*********************************************************************
RSI with Trend Catcher signal
by Matsu
based on codes from various sources
*********************************************************************
*/
#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 LightBlue
#property indicator_color2 LightBlue
#property indicator_color3 LightBlue
#property indicator_color4 Red
#property indicator_width4 2
#property indicator_color5 LimeGreen
#property indicator_width5 2
#property indicator_color6 Red
#property indicator_width6 2
#property indicator_level1 100
#property indicator_level3 -100
//#property indicator_level3 40
extern int CCIPeriod=14;
extern int RSIPeriod=14;
extern int BullLevel=100;
extern int BearLevel=-100;
extern bool AlertOn = true;
double rsi,rsib4;
double cci,ccib4;
double CCI[];
double DnCCI[];
double UpCCI[];
double NoCCI[];
double RSIdotup[];
double RSIdotdn[];
int init()
{
IndicatorBuffers(6);
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,CCI);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,DnCCI);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,UpCCI);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,NoCCI);
SetIndexStyle(4,DRAW_ARROW,STYLE_SOLID,2);
SetIndexArrow(4,159);
SetIndexBuffer(4,RSIdotup);
SetIndexStyle(5,DRAW_ARROW,STYLE_SOLID,2);
SetIndexArrow(5,159);
SetIndexBuffer(5,RSIdotdn);
IndicatorShortName("CCI with RSI Crossing zero dot CCI Period=("+CCIPeriod+")");
return(0);
}
int start()
{
int counted_bars=IndicatorCounted();
int shift,limit,ob,os;
bool dn = false;
double BuyNow, BuyPrevious, SellNow, SellPrevious;
static datetime prevtime = 0;
if (counted_bars<0) return(-1);
if (counted_bars>0) counted_bars--;
// limit=Bars-31;
// if(counted_bars>=31) limit=Bars-counted_bars-1;
for (shift=500;shift>=0;shift--)
{
rsi=iRSI(NULL,0,RSIPeriod,0,shift);
rsib4=iRSI(NULL,0,RSIPeriod,0,shift+1);
cci=iCCI(Symbol(),Period(),CCIPeriod,PRICE_TYPICAL,shift); // no Im not dumb I had to do it this way
ccib4=iCCI(Symbol(),Period(),CCIPeriod,PRICE_TYPICAL,shift+1);
CCI[shift]=iCCI(Symbol(),Period(),CCIPeriod,PRICE_TYPICAL,shift);
// Alert (RSI[shift+1]);
if (rsib4<50 && rsi>50)
{
RSIdotup[shift]=0;
}
if (rsib4>50 && rsi<50)
{
RSIdotdn[shift]=0;
}
// ========= three-tone RSI
// if (dn==true)
// {
// if (CCI[shift]> BullLevel)
// {
// DnCCI[shift]=EMPTY_VALUE;
// NoCCI[shift]=EMPTY_VALUE;
// UpCCI[shift]=CCI[shift];
// }
// if (CCI[shift]<BearLevel)
// {
// DnCCI[shift]=CCI[shift];
// NoCCI[shift]=EMPTY_VALUE;
// UpCCI[shift]=EMPTY_VALUE;
// }
}
// }
// ======= Alert =========
if(AlertOn)
{
if(prevtime == Time[0])
{
return(0);
}
prevtime = Time[0];
if (cci<100 && ccib4> 100) Alert(Symbol()," ",Period(),"m ","CCI above 100");
if (cci>100 && ccib4< 100) Alert(Symbol()," ",Period(),"m ","CCI below 100");
}
// ======= Alert Ends =========
return(0);
}
Comments