# CCI DIVERGENCE SCANNER

#### subham2010

##### Member
Hello All,

I need a scanner on CCI divergence where I can findout the CCI divergence Stocks at day end. Is it possible.

Thanks

#### VolumeBhai

##### New Member
Customise RSI Divergence to your need

_SECTION_BEGIN("RSI Stochastics");
// RSI / Stochastics
//
slow=LLV(C,21);
shigh=HHV(C,21);
faststoc=EMA(100*(C-slow)/(shigh-slow),13)/2 + RSI(14)/2;
Title=Date()+" "+EncodeColor(colorBlue)+Name()+" "+FullName()+" RSI / Stochastic "+WriteVal(faststoc,1.1)+" ";

Plot(50,Date()+" ",4,5);
Plot(65," ",5,5);
Plot(faststoc," "+FullName()+" - Stoch/RSI",6,5);
_SECTION_END();

_SECTION_BEGIN("RSI Divergence");
//------------------------------------------------------------------------------
//
// Formula Name: RSI Divergence
// E-mail:
// Origin:
// Keywords:
// Level: medium
// Flags: indicator
// Formula URL: http://www.amibroker.com/library/formula.php?id=603
// Details URL: http://www.amibroker.com/library/detail.php?id=603
//
//------------------------------------------------------------------------------
//
// + scanner
//
//------------------------------------------------------------------------------

/*---------------------------------------------------
RSI Divergence
Aron Pipa, March, 20 , 2006
--------------------------------------------------------*/

GraphXSpace=7;
n=Param("% Reverse ",20,0,100,1);

Var = Zig(RSI(), n);
t= Trough(RSI(), n, 1);
p= Peak(RSI(), n, 1);
x[0] =Var[0];
price[0] = C[0];
j=0;

// bearish divergence
for ( i=0; i<BarCount; i++)
{
if(Var == p)
{

j++;
x[j] =Var;
price[j] =C;
if(x[j] <x[j-1] && price[j-1]< price[j])
Sell =1;
}
}

// bullish divergence
for ( i=0; i<BarCount; i++)
{
if(Var == t)
{
j++;
x[j] =Var;
price[j] =C;
if(x[j] >x[j-1] && price[j]<price[j-1])
}
}

Plot(Var, "", 39);
PlotShapes ( IIf(Sell, shapeSmallCircle, shapeNone), colorRed, 0 , Var,0);
PlotShapes( IIf(Buy, shapeSmallCircle, shapeNone), colorBrightGreen, 0, Var,0);

Title ="RSI Divergence" ;
_SECTION_END();

_SECTION_BEGIN("RSI Divergence 120406");
GraphXSpace=7;
n=Param("% Reverse ",20,0,100,1);

Var = Zig(RSI(), n);
t= Trough(RSI(), n, 1);
p= Peak(RSI(), n, 1);
x[0] =Var[0];
price[0] = C[0];
j=0;

// bearish divergence
for ( i=0; i<BarCount; i++)
{
if(Var == p)
{

j++;
x[j] =Var;
price[j] =C;
if(x[j] <x[j-1] && price[j-1]< price[j])
Sell =1;
}
}

// bullish divergence
for ( i=0; i<BarCount; i++)
{
if(Var == t)
{
j++;
x[j] =Var;
price[j] =C;
if(x[j] >x[j-1] && price[j]<price[j-1])
}
}

Plot(Var, "", 39);
PlotShapes ( IIf(Sell, shapeCircle, shapeNone), colorRed, 0 , Var,0);
PlotShapes( IIf(Buy, shapeCircle, shapeNone), colorBrightGreen, 0,
Var,0);

Title ="RSI Divergence" ;

_SECTION_END();

#### subham2010

##### Member
Getting the error...

Equities 0
General Trading & Investing Chat 1
AmiBroker 4
AmiBroker 2
AmiBroker 0