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

[amibroker] The prediction of a DEMAcross



PureBytes Links

Trading Reference Links




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:
dema.gif

Attachment: Description: "Description: GIF image"