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

Re: [amibroker] Stochrsi



PureBytes Links

Trading Reference Links

Dave,
Here is an example I use

Y=StochD();
 EV1=Cross(Y,30);
S=Sum(Y>Ref(Y,-1),BarsSince(EV1))==BarsSince(EV1);
SumS=S*Sum(S,1+BarsSince(S AND Ref(S,-1)==0));
SumS80=(y>80)*SumS;
Plot(SumS80,"SumS80",colorPink,2);
Plot(SumS,"SumS",colorBlue,2);
for(J=2;J<=12;J=J+2)
{PlotGrid(J,colorIndigo);}

to see the consecutive ascending StochD() bars after a 30 cross 
[blue] and, especially, the ones above 80 [pink]
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx> 
wrote:
> Thanks Dimitris, for waking me back up (:-). For reasons I can't 
remember, I
> thought the period for Sum() had to be a static number, but I just 
tried it
> in my context and Sum(array, BarsSince(event)) works fine.
> 
> Dave
>   Dave,
>   you can Sum(binary Condition,BarsSince(Binary event))
>   Dimitris Tsokakis
>   --- In amibroker@xxxxxxxxxxxxxxx, "Dave Merrill" <dmerrill@xxxx>
>   wrote:
>   > Does anyone have an idea for non-looping code to count or add 
the
>   values in
>   > some array since some logical event?
>   >
>   > For instance:
>   >
>   >   CountSince(Cross(Close, EMA(Close, 13)), Close > Open);
>   >
>   > ...should return the number of days that closed higher than they
>   opened,
>   > since the last time closing price crossed its 13 day EMA.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/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/