PureBytes Links
Trading Reference Links
|
I've only recently started visiting this board, and this is my
first
posting. My recent purchase of Amibroker was driven in large part by
a desire to build a trading system modeled on the systems in
Elder's "Come into my Trading Room". There have been
several postings
here with code for Elder indicators and screens (for which I thank
the authors), but nothing that I could see on channel coefficient.
Elder defines a channel coefficient as:
Upper Channel = EMA + channel coefficient * EMA
Lower Channel = EMA - channel coefficient * EMA
I use this test on a daily chart. The value of channel coefficient is
such that 95% of all highs and lows lie within the channel. Prices at
the upper channel provide a sell signal, and prices at or below a
rising EMA (I use 13-day) signal buy.
Here is my code for the Elder channel indicator:
EMA13 = EMA(C,13);
CChigh = (High-EMA13)/EMA13;
CClow = (EMA13-L)/EMA13;
Higher = IIf(CChigh>=CClow,CChigh,CClow);
NumOfBars = 200;
if (BarCount < 200)
{
NumOfBars = BarCount-1;
}
CC = Percentile(Higher,NumofBars,95);
upperChannel = EMA13 + CC*EMA13;
lowerChannel = EMA13 - CC*EMA13;
Plot(C,"Candle Plot",colorBlack,styleCandle);
Plot(upperChannel,"Upper Channel",colorRed,styleLine);
Plot(EMA13,"EMA 13",colorBlue,styleLine);
Plot(LowerChannel,"Lower Channel",colorRed,styleLine);
I'd appreciate any corrections and suggestions for improvement.
The trickiest part was the choice of NumofBars in the Percentile
function, and I opted for 200 (or less if Barcount is less than 200),
so that the most recent data are used.
Now, I'll give away the fact that I am a new user by asking a
very
basic question; how do I add the x-axis (dates) and grid to this
graph?
David Nowotnik
------------------------ Yahoo! Groups Sponsor --------------------~-->
What would our lives be like without music, dance, and theater?
Donate or volunteer in the arts today at Network for Good!
http://us.click.yahoo.com/Tcy2bD/SOnJAA/cosFAA/GHeqlB/TM
--------------------------------------------------------------------~->
Please note that this group is for discussion between users only.
To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com
For other support material please check also:
http://www.amibroker.com/support.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/
|