[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] The prediction of a DEMAcross [the side effect]



PureBytes Links

Trading Reference Links




The DEMAcrossClose line gives a good trend 
description.
It is descending on a bullish trend and ascending on a bearish 
trend.
The respective Peaks/Troughs have insignificant lag related to 
the actual Close Peaks/Troughs.
When the trend exists, you may have interesting Entry/Exit 
signals.
Try the experimental Indicator builder formula
// DEMAcross side effect
 <FONT 
size=2>k=30;p=20;fk=2/(k+1);fp=2/(p+1);d=(2-fp)*fp-(2-fk)*fk;MAp=MA(C,p);MAk=MA(C,k);MAcrossClose=(p*(k-1)*MA(C,k-1)-k*(p-1)*MA(C,p-1))/(k-p);EMAk=EMA(C,k);EMAp=EMA(C,p);EMAcrossClose=((p+1)*(k-1)*EMAk-(k+1)*(p-1)*EMAp)/(2*(k-p));DEMAk=DEMA(C,k);DEMAp=DEMA(C,p);DEMAcrossClose=((1-fp)*fp*EMAp-(1-fk)*fk*EMAk+(1-fk)*DEMAk-(1-fp)*DEMAp)/d;// 
Plot(MAcrossClose,"MAcrossClose",4,1);// 
Plot(EMAcrossClose,"EMAcrossClose",5,1);Plot(DEMAcrossClose,"DEMAcrossClose",(DEMAcrossClose>Ref(DEMAcrossClose,-1))*colorRed+(DEMAcrossClose<Ref(DEMAcrossClose,-1))*colorBrightGreen,styleOwnScale|styleThick);Plot(C,"Close",1,64);COND1=Ref(DEMAcrossClose,-1)==HHV(DEMAcrossClose,3);COND2=Ref(DEMAcrossClose,-1)==LLV(DEMAcrossClose,3);PlotShapes(shapeUpArrow*Cond1,5,0,Graph1,-20);PlotShapes(shapeDownArrow*Cond2,4,0,Graph1,-20);GraphXSpace=3;
 
Similar properties appear for the EMAcrossClose 
line.
The DEMAcrossClose peak A was the beginning of a 22-bar 
bullish movement for the Nikkei index until point B.
Then, an 24-bar bearish trend followed until point 
C.
The lag of DEMAcrossClose in the description of this trend was 
0 or 1.
Dimitris Tsokakis
----- Original Message ----- 
From: <A 
href="" title=tsokakis@xxxxxxxxx>Dimitris Tsokakis 

To: <A href="" 
title=amibroker@xxxxxxxxxxxxxxx>amibroker@xxxxxxxxxxxxxxx 
Sent: Saturday, August 09, 2003 9:05 PM
Subject: The prediction of a DEMAcross

is the last part of this prediction series.
DEMA is a useful smoother and DEMA crosses give reliable 
signals for various indicators.
We shall decrease the lag of a DEMA cross by 1 
bar.
The next bar Close necessary for a DEMAk, DEMAp cross is a bit 
complicated
 
DEMAcrossClose=((1<FONT 
size=2>-fp)*fp*EMAp-(1<FONT 
size=2>-fk)*fk*EMAk+(1<FONT 
size=2>-fk)*DEMAk-(1<FONT face=Verdana 
size=2><FONT 
face="Times New Roman">-fp)*DEMAp)/d;<FONT 
face="Times New Roman">
 
The basic argument is similar to the MA or EMA crosses.
 
"The crosses of DEMAcrossClose with the Close 
line anticipate the DEMA crosses"
 
In an Ind. builder window paste the formula
 
// Anticipating DEMAcrosses, by D. Tsokakis, Aug2003<FONT 
face=Verdana size=2>
k=30;p=<FONT 
size=2>20;fk=2<FONT 
size=2>/(k+1);fp=<FONT 
size=2>2/(p+1<FONT 
face=Verdana size=2>);<FONT 
face="Times New Roman">
d=(2-fp)*fp-(<FONT 
size=2>2<FONT 
face="Times New Roman">-fk)*fk;
EMAk=EMA<FONT 
size=2>(C,k);EMAp=EMA<FONT 
face="Times New Roman">(C,p);
DEMAk=DEMA<FONT 
size=2>(C,k);DEMAp=DEMA<FONT face=Verdana 
size=2>(C,p);<FONT face=Verdana 
size=2>
Plot(DEMAk,"DEMAk"<FONT 
size=2>,1,<FONT 
size=2>1);Plot<FONT 
size=2>(DEMAp,"DEMAp",<FONT 
size=2>2,1<FONT 
face=Verdana size=2>);<FONT 
face="Times New Roman">
DEMAcrossClose=((1<FONT 
size=2>-fp)*fp*EMAp-(1<FONT 
size=2>-fk)*fk*EMAk+(1<FONT 
size=2>-fk)*DEMAk-(1<FONT face=Verdana 
size=2>-fp)*DEMAp)/d;<FONT 
face=Verdana size=2>
Plot(DEMAcrossClose,<FONT 
size=2>"DEMAcrossClose",4<FONT 
size=2>,1<FONT 
face="Times New Roman">);<FONT 
face="Times New Roman">
PlotShapes(shapeUpArrow*<FONT 
size=2>Cross<FONT 
face="Times New Roman">(DEMAp,DEMAk),colorBrightGreen);<FONT 
face=Verdana size=2>
PlotShapes(shapeDownArrow*<FONT 
size=2>Cross<FONT 
face="Times New Roman">(DEMAk,DEMAp),colorRed);<FONT face=Verdana 
size=2>
PlotShapes(shapeDownTriangle*<FONT 
size=2>Cross(DEMAcrossClose,C),colorPink,<FONT 
size=2>0,Graph0,-30<FONT 
face=Verdana size=2>);<FONT 
face=Verdana size=2>
PlotShapes(shapeUpTriangle*<FONT 
size=2>Cross(C,DEMAcrossClose),colorPaleGreen,<FONT 
size=2>0,Graph0,-30<FONT 
face=Verdana size=2>);<FONT 
face=Verdana size=2>
Plot(C,"C"<FONT 
size=2>,colorDarkBlue,64<FONT face=Verdana 
size=2>);
GraphXSpace=4<FONT face=Verdana 
size=2>;
 
The graph of this 
DEMAcrossClose [the red line] moves around the actual Close graph and may take 
very high [low]
values. It is obvious that there are extended periods for which the 
DEMAcross is impossible. [This property will help
the crossover trader to avoid crucial mistakes] 
The actual 
DEMAcrosses are pointed by the green-red arrows. 
The predictions are 
pointed by the respective triangles and, usually, anticipate the actual 
crosses.
You may replace the Close array with an Indicator and anticipate the 
indicators DEMAcrosses.
Dimitris 
Tsokakis
 
PS: In the attached 
gif you may see an interesting side effect.
The peaks/troughs of 
the red DEMAcrossClose line T1, P1, match with increased  accuracy to 
the turning points of the stock.
But, this is the 
beginning of the next subject and I hope you agree...
 






Yahoo! Groups Sponsor


  ADVERTISEMENT 









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



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



Attachment:
dema1.gif

Attachment: Description: "Description: GIF image"