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

[amibroker] Re: What is the number of a specific array's cell ?



PureBytes Links

Trading Reference Links

Dimitri,

Here is a copy of T3 picked up from the list.

function T3(a, iCounter)

{

local n;

global strN;

global iColor;

global iStyle;

if (icounter == 1)

{ n = 3;

iColor = colorGreen;

iStyle = styleThick; }

else if (icounter == 2)

{ n = 5;

iColor = colorBlue;

iStyle = styleThick; }

else if (icounter == 3)

{ n = 8;

iColor = colorViolet;

iStyle = styleThick; }

else if (icounter == 4)

{ n = 13;

iColor = colorGold;

iStyle = styleThick; }

else if (icounter == 5)

{ n = 21;

iColor = colorOrange;

iStyle = styleThick; }

else

{ n = 34;

iColor = colorRed;

iStyle = styleDots; }

alpha = 2/(n + 1);

e1 = EMA(Close, n);

e2 = EMA (e1, n);

e3 = EMA (e2, n);

e4 = EMA (e3, n);

e5 = EMA (e4, n);

e6 = EMA (e5, n);

TTT = -a^3 * e6 + (3 * a^2 +3 * a^3) * e5 + (-6 * a^2 - 3 * a - 3 *

a^3) * e4 + (1 + 3 * a + a^3 + 3 * a^2) * e3;

strN = NumToStr(n, 1.0,False);

return TTT;

}

for (i = 1; i <= 6; i++)

{

a = Optimize("a",0.7,0.382,1.618,0.382);;//Hot Button

Plot(T3(a,i),"T3(" + strN + ")",iColor, iStyle);

}

Plot(C,"Close", 1, 65);

Plot(O,"Open", 1, styleNoDraw);



Anthony

----- Original Message ----- 
From: "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Thursday, March 04, 2004 4:43 AM
Subject: [amibroker] A Ti3 crash test


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







---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.583 / Virus Database: 369 - Release Date: 2/10/2004



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->

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/