/ _SECTION_BEGIN("Unnamed 22"); /* Settings setup should have buy and sell at open with one day delay. I also use a 3% maximum stop loss. This code also plots the DMI Index in its own chart pane. Note that I have also provided a zero line for better viewing of the zero cross.*/ /* Exploration, System and Indicator Author rakesh kaushik Email address: rakesh.kaushik25@ymail.com sept 25, 2009 */ Percent=3; pds=PeakBars(C,Percent,2)-PeakBars(C,Percent,1); pds=LastValue(pds); /* the following code is for the consolidation periods or better know as the sleeping Alligator */ var3= 5; var4= 3; var10=10; var0= Ref(Wilders(C,13),-8); var1= Ref(Wilders(C,8),-5); var2= Ref(Wilders(C,5),-3); var5= MA((var0+var1+var2),var4) ; angle=atan(var5-Ref(var5,-var3)/var3); angle=IIf( angle >90,angle-360,angle); hope=IIf( angle <20 AND angle>-20,1,0); cry=((StDev(C,var3*2) - Ref(Wilders(StDev(C,var3*2),8),-5))/ (Ref(Wilders(StDev(C,var3*2),8),-5)))<0; /* End of Sleeping Alligator which is an area of little or no volitlity or price movement.*/ SI=MA(PDI(pds)-MDI(pds),5); Graph0=SI; /* Spread Index */ Graph1=0; /* Provides a zero based line of blue color */ Graph1Style=5; Buy=Cross(SI,0) ; /* or PDI(14)>MDI(14) and ADX(14)>MDI(14) and (Hope and Cry)==0;*/ /* Having PDI and ADX and (Hope and Cry) does not test as well */ Sell=Cross(0,SI) OR ADX(14)