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

Re: [amibroker] Got a better way to code for increasing close? (newbe question)



PureBytes Links

Trading Reference Links

How about something like this (untested):

daysup = Sum(C>Ref(C,-1),6) ;

Bill

 bestbobleonard wrote:

> It seems to me there is something better than.
>
> c0 = Ref(close,0);
> c1 = Ref(close,-1);
> c2 = Ref(close,-2);
> c3 = Ref(close,-3);
> c4 = Ref(close,-4);
> c5 = Ref(close,-5);
> c6 = Ref(close,-6);
>
> t0 = iff( c0 > c1, 1,0);
> t1 = iff( c1 > c2, 1,0);
> t2 = iff( c2 > c3, 1,0);
> t3 = iff( c3 > c4, 1,0);
> t4 = iff( c4 > c5, 1,0);
> t5 = iff( c5 > c6, 1,0);
>
> daysup = t0 + t1 + t2 + t3 + t4 + t5;
>
> Thanks,
> Bob
>
>
>
>
> 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
>
>     *  Visit your group "amibroker
>       <http://groups.yahoo.com/group/amibroker>" on the web.
>        
>     *  To unsubscribe from this group, send an email to:
>        amibroker-unsubscribe@xxxxxxxxxxxxxxx
>       <mailto:amibroker-unsubscribe@xxxxxxxxxxxxxxx?subject=Unsubscribe>
>        
>     *  Your use of Yahoo! Groups is subject to the Yahoo! Terms of
>       Service <http://docs.yahoo.com/info/terms/>.
>
>
> ------------------------------------------------------------------------
>



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/