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

Re: [amibroker] Re: japanese candlesticks



PureBytes Links

Trading Reference Links

Here is an interesting side effect of the Ti3 study.
If we want to replace DEMA with TEMA, what is the proper period ?
When the price goes from 100 to 110 in one day, the DEMA smoother 
exceeds the final price for some days and causes a maximum distorsion 
MaxDiv.
Let us suppose accepted distorsions between DEMA(5) minimum and DEMA
(50) maximum.
The TEMA periods which would cause a distorsion in the accepted 
levels are 

// Maximum TEMA distorsion in the range of DEMA5 to DEMA50 distorsions
L1=LastValue(Cum(1));D=100;DD=110;
C0=IIf(Cum(1)>L1-d,dd,d);
Plot(C0,"\nCLOSE",1,8);
PERIOD1=5;
PERIOD2=50;
S2=DEMA(C0,PERIOD2);
S1=DEMA(C0,PERIOD1);
Div1=100*(s1-C0)/LastValue(C0);MaxDiv1=LastValue(Highest(Div1));
Div2=100*(s2-C0)/LastValue(C0);MaxDiv2=LastValue(Highest(Div2));
Plot(S1,"",colorRed,8);z2=WriteVal(period2,1.0);z1=WriteVal
(period1,1.0);
Plot(S2,"",colorBrightGreen,8);
Title="Max Distorsion for DEMA("+z1+") ="+WriteVal(MaxDiv1,1.2)
+"%"+", DEMA("+Z2+")="+WriteVal(Maxdiv2,1.2)+"%"+"\nThe TEMA period 
should be ";
for(n=2;n<PERIOD2;n++)
{
t1=TEMA(C0,n);
Divt1=100*(t1-C0)/LastValue(C0);MaxDivt1=LastValue(Highest(Divt1));
if(Maxdivt1>=MaxDiv1 AND MaxDivt1<=MaxDiv2)
{Plot(t1,"",1,1);
Title=Title+WriteVal(n,1.0)+", ";}
}

As you see, we should use periods 4, 5, 6.
Periods higher than 6 will cause distorsion above the accepted levels 
and the TEMA line will begin to oscillate around the price.
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:
     http://docs.yahoo.com/info/terms/