I am trying to capture divergences on the TRI. I am sure I am missing something. Can someone please review the code.
////////////////////////////////////////
pds = Param("Periods", 13, 3, 30, 1);
Pds1 = round(pds * 0.231);
TRI = RSI(pds) + MA(RSI(pds1),pds);
Plot( TRI, "TRI("+pds+","+pds1+")", ParamColor( "Color", colorCycle ), ParamStyle("Style") );
dp = Divergence(TRI, C, 0.75)==1; // positive ---
dn = Divergence(C, tri, 0.75)==-1; //negative ---
shape = dp * shapeSmallCircle + dn * shapeSmallCircle ;
PlotShapes( shape, IIf( dp, colorGreen, colorRed ),0,TRI,0 );
////////////////////////////////////////
__________ Information from ESET Smart Security, version of virus signature database 4460 (20090926) __________
The message was checked by ESET Smart Security.
http://www.eset.com