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

[amibroker] Re: CCI ZLR



PureBytes Links

Trading Reference Links


Hi Anthony,

A while ago, I took a look at the manual that explains Woodie's
patterns and attempted to code ZLR for long trades (below).  This and
every other variation I tried performed poorly.  I think this code
pretty much captures the essence of the pattern but if I'm mistaken, I
welcome constructive feedback.  Watch out for wrapped code.  Good luck.

Mark

SetTradeDelays(0,0,0,0);// no trade delays
BuyPrice=C;
SellPrice=C;
wcci=CCI(14);
tcci=CCI(6);
Ct=IIf(wcci>0,1,0);
sct1=Sum(Ct,8);// # of times in last 8 bars CCI was >0
sct2=Sum(Ct,2);// # of times in last 2 bars CCI was >0

Buy= sct1>=7 AND sct2==2// 7 or more of last 8 CCI bars must be >0 AND
last 2 must be >0
AND wcci>Ref(wcci,-1) AND Ref(wcci,-1)<=Ref(wcci,-2) AND
Ref(wcci,-2)<=Ref(wcci,-3)// CCI bounce
AND LLV(wcci,3)>=-100 AND HHV(wcci,3)<=100;// CCI bounce occurs
between +/- 100

Sell=wcci<=Ref(wcci,-1)// declining or flat CCI
OR Cross(0,wcci)// CCI crosses below zero line
OR tcci<=Ref(tcci,-1)// declining or flat TCCI
OR Cross(wcci,tcci);// TCCI crosses below CCI

SetOption("MaxOpenPositions", 20 );
PositionSize = -5;

--- In amibroker@xxxxxxxxxxxxxxx, Anthony Abry <abry@xxxx> wrote:
> I was wondering if any of you have ever coded Woodie's CCI zero line
> reject into AB.
> 
> As a first step to learn some coding I am currently trying to do,
> 
> If CCI(14) has been positive for 6 bars then buy. Sell when CCI
> declines.
> 
> The next step would be, if CCI(14) has been positive for 6 bars, and has
> been above 100 and has retraced back below 100 and then turns up again,
> then buy.
> 
> I have tried many variations - all of which show me I am not fit for
> programming.
> 
> Any help appreciated ......
> 
> Anthony Abry





------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

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

<*> 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/