PureBytes Links
Trading Reference Links
|
I use the following graphs for CSCO.The red line is the
50-bar Moving Average.The yellow line is a displaced MA.The vertical
displacement is recalibrated every 50 bars and it is equal to the difference of
the red-green line.The green line [TrendMA] adds an increment 1/1000 to its
previous value, as long as the red MA is ascending.Buy when the Close line
crosses the red MA.Fast exit when Close crosses the yellow displaced
MA.Exit without any hesitation when Close crosses the green TrendMA.You
may see that the green TrendMA acts as an o/b upper limit, the stock does not
stay for long above it.The recent dead-cat-bounce is descriptive
enough.The red MA is still ascending. When it will reach the local peak,
the yellow and the green line will come back to the red ground level.[^NDX
has already began a new cycle by the end of the last November, the TrendMA
target was out of any realistic perspective...].The code for Indicator
builder is
// TRENDma,
DISPLmaP1=50;Plot(C,"C",1,64);COEFF=0.001;M1=MA(C,P1);MM[0]=0;X=BarsSince(ROC(M1,1)<=0);for(I=1;I<BarCount;I++){if(M1[I]>M1[I-1])MM[I]=(1+COEFF*X[I])*M1[I-1];else{MM[I]=M1[I];}}Plot(M1,"MA",colorRed,8);Plot(MM,"TrendMA",colorBrightGreen,4);Buy=Cross(C,M1);Sell1=Cross(M1,C);Sell2=Cross(MM,C);Buy=ExRem(Buy,Sell2);Sell2=ExRem(Sell2,Buy);XX=X%P1==0;DISPL=ValueWhen(XX,MM-M1);DISPLma=M1+DISPL;Plot(DISPLma,"DisplacedMA",colorYellow,8);FastExit=Cross(DISPLma,C);Buy=ExRem(Buy,FastExit);FastExit=ExRem(FastExit,Buy);PlotShapes(shapeUpArrow*Buy,colorBrightGreen);PlotShapes(shapeCircle*Sell1,colorBlue);PlotShapes(shapeDownTriangle*Fastexit,colorPink);PlotShapes(shapeDownArrow*Sell2,colorRed);
The pink triangles are for the fast [partial] exits, the red
arrows are for the final exits and the blue circles are for the delayed regular
MA crosses.Dimitris Tsokakis
Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links
To visit your group on the web, go to:http://groups.yahoo.com/group/amibroker/
To unsubscribe from this group, send an email to:amibroker-unsubscribe@xxxxxxxxxxxxxxx
Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.
Attachment:
DISPLma.gif
Attachment:
Description: "Description: GIF image"
|