I am just looking how to code it.
I have tried e.g.
a=IIf((Ref(CCI(14),-4) >0 AND Ref(CCI(14), -3) >0
AND Ref(CCI(14),-2) >0 AND Ref(CCI(14), -1) >0 AND Ref(CCI(14)>0) >0),1,0);
Buy=a>0;
which gives me error messages.
I have tried
--------------------------------------------------
Buy = Short = Sell = Cover
= 0;
a=b=d=e=0;
a=BarsSince(Cross(CCI(14),0)); //checks for
uptrend
b=BarsSince(Cross(100,CCI(14))); //checks for
upmomentum
d=BarsSince(Cross(0,CCI(14)));//checks for
downtrend
e=BarsSince(Cross(CCI(14),-100));//checks for down
momentum
Buy=a>5 AND
b<=a AND CCI(14)>Ref(CCI(14),-1);//ZLR
Sell=CCI(14)<Ref(CCI(14),-1);
Short=d>5 AND e<=d AND CCI(14)<Ref(CCI(14),-1);//ZLR
Cover=CCI(14)>Ref(CCI(14),-1);
Buy=ExRem(Buy,Sell);
Sell=ExRem(Sell,Buy);
Short=ExRem(Short,Cover);
Cover=ExRem(Cover,Short);
which gives me buys when CCI is negative?????
I have tried
-------------------------------------------------------------
a=BarsSince(CCI(14) >0); //checks for uptrend
b=BarsSince(CCI(14)>100); //checks for upmomentum
d=BarsSince(CCI(14)<0);//checks for downtrend
e=BarsSince(CCI(14)<-100);//checks for down momentum
Buy= a>5 AND
b<=a AND CCI(14)<100 AND CCI(14)>Ref(CCI(14),-1) AND Ref(CCI(14),-1)<Ref(CCI(14),-2);//ZLR
Which gives me error
messages
I have
tried something with for statetements and plain if statements – I don’t
remember
Maybe something like
For (i=1;i<barssince(cci(14)>0);i++) //checking to make sure that all bars
between cci cross 0 are positive
{ //
also used barssince(cross(cci(14),0))
if (ref(cci(14),i*-1)
a=a+1;
else
a=0;
}
------------------------------------------------------
None of which would execute.
Thanks
for any help.
-----Original Message-----
From: Fred
[mailto:ftonetti@xxxxxxxxxxxxx]
Sent: Monday, December 06, 2004 4:21 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: CCI ZLR
You've tried many variations that you could not
get to work
properly ? or they worked as described but
didn't generate great
returns ?
--- 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
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 Sponsor |
ADVERTISEMENT
| |
|
Yahoo! Groups Links