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

Re: [amibroker] ignore extra buy signals



PureBytes Links

Trading Reference Links

Let us suppose a stock goes from 100 to 110 in one day.
We shall examine the response of DEMA, TEMA and Ti3 averages.
These smoothers catch the new price in some days, then go higher and 
find again [asymptotically] the final price.
For a given DEMA/TEMA period we may calibrate the Ti3 period to 
obtain the same Maximum Divergence from the final price.
EXAMPLE
For DEMA/TEMA period=20, we need Ti3 periods  x=4 and x=7 
respectively to avoid exceeding the DEMA/TEMA MaxDiv.

// Ti3 crash test and Maximum Divergence, by D. Tsokakis, March 2004
function T3(price,periods)//According to Jayson´s message 59811 
{
s = 0.83;
e1=EMA(price,periods);
e2=EMA(e1,Periods);
e3=EMA(e2,Periods);
e4=EMA(e3,Periods);
e5=EMA(e4,Periods);
e6=EMA(e5,Periods);
c1=-s*s*s;
c2=3*s*s+3*s*s*s;
c3=-6*s*s-3*s-3*s*s*s;
c4=1+3*s+s*s*s+3*s*s;
Ti3=c1*e6+c2*e5+c3*e4+c4*e3;
return ti3;
}
L1=LastValue(Cum(1));D=100;DD=110;
C1=IIf(Cum(1)<L1-D,D,DD);
Plot(C1,"\nCLOSE",1,8);
PERIOD=20;
S1=DEMA(C1,PERIOD);
S2=TEMA(C1,PERIOD);
X=Param("X",3,3,20,1);
Ti3=T3(C1,X);
//The maximum divergence
Div1=100*(s1-C1)/LastValue(C1);MaxDiv1=LastValue(Highest(Div1));
Div2=100*(s2-C1)/LastValue(C1);MaxDiv2=LastValue(Highest(Div2));
Div3=100*(Ti3-C1)/LastValue(C1);MaxDiv3=LastValue(Highest(Div3));
Plot(S1,"\nDEMA",colorRed,1);
Plot(S2,"\nTEMA",colorBrightGreen,1);
Plot(Ti3,"\nT3",colorBlue,1);
z=WriteVal(period,1.0);
Title="Maximum Divergence for \nDEMA("+z+") ="+WriteVal(MaxDiv1,1.2)
+"%"+"\nTEMA("+z+")="+WriteVal(Maxdiv2,1.2)+"%"+"\n     Ti3("+WriteVal
(x,1.0)+")="+WriteVal(maxDiv3,1.2)+"%";




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/