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

[amibroker] Re: simple stuff I still can't code easily



PureBytes Links

Trading Reference Links

Example:
Cond=Cross(StochD(),30);
Buy=Cond AND Sum(Cond,11)==1;
Filter=1;
AddColumn(Cond,"COND");
AddColumn(Buy,"BUY");
Cond is true [equal to 1] when the StochD() crosses the 30 line.
Buy is true when Cond is true AND the sum of the last 11 Cond values 
is 1.
Since the last Cond value is 1 [from the first requirement] then the 
only possible scenario is
0+0+0+0+0+0+0+0+0+0+1=1
because, if any of the previous 10 Cond values was 1, the sum would 
be 2 or 3 etc.
Clear ?
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Yuki,
> conditions, in general, have binary output, their value is 0 or 1 
> [FALSE or TRUE].
> If a condition is true for n consecutive bars, then the 
> sum(COND,n) will be 1+1+...+1=n and
> sum(COND,n)==n
> If the condition is false for n consecutive bars, then sum(COND,n)
==0.
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, Yuki Taga <yukitaga@xxxx> wrote:
> > If I have a condition that needs to be true for B or S, but I want
> > that condition to NOT be true for at least any of the 10 previous
> > bars, is there an easier way to write it than by writing
> > ref(mycond,-1) AND ref(mycond,-2) etc?
> > 
> > Yuki


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Rent DVDs Online - Over 14,500 titles.
No Late Fees & Free Shipping.
Try Netflix for FREE!
http://us.click.yahoo.com/Tq9otC/XP.FAA/3jkFAA/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 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/