Jerry,
Here is the code for the “Trading
Channel Index” (TCI). ‘Rem-out’ the last Plot statement if
you do not like the background pane coloring!
_SECTION_BEGIN("TCI");
ChannelPeriods = Param("Channel Periods",10,1,50,1);
AvgPeriods = Param("Average Periods",21,1,50,1);
OverBought = Param("Over Bought Line",64,0,100,1);
OverSold = Param("Over Sold Line",-64,-100,0,1);
ColTCI = ParamColor("TCI Line Color",colorBrown);
ColOB = ParamColor("Over Bought Color",colorRed);
ColOS = ParamColor("Over Sold",colorGreen);
XSpace = Param("GraphXSpace",7,0,20,0.5);
n1 =
ChannelPeriods; //
Channel periods Default is 10.
n2 =
AvgPeriods; // Average periods Default is 21.
AP = Avg; //Typical Price
ESA = EMA(AP, n1);
D =
EMA(abs(AP -
ESA), n1);
CI =
(AP - ESA) / (0.015 * D);
TCI = EMA(CI, n2);
Plot(TCI,"TCI",ColTCI,1);
Plot(OverBought,"OB Line",ColOB,8+16);
Plot(OverSold,"OS Line",ColOS,8+16);
Plot(n1,"Channel Periods",colorBlue,styleNoLabel |styleNoRescale | styleNoDraw);
Plot(n2,"Avg Periods",colorBlue,styleNoLabel |styleNoRescale | styleNoDraw);
Plot(100,"",9 ,styleOwnScale | styleArea | styleNoLabel,-5,100); // Background pane
coloring
GraphXSpace = XSpace;
_SECTION_END();
Regards,
Gordon Sutherland
-----Original Message-----
From: thegress
[mailto:pleasenospamplease@xxxxxxxxxxx]
Sent: Tuesday, 22 February 2005
6:17 p.m.
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Trading
Channel Index by Welles Wilder
Hi All,
Does anybody have the AFL for the TCI? The TCI is
an adoption for
equities of the Welles Wilder Commodity Channel
Index. Something
about a standard deviation of a simple moving
average!
Thanks in advance,
Jerry
Stockton, Ca.
Check
AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Check AmiBroker web page at:
http://www.amibroker.com/
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html
Yahoo! Groups Links