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

Re: [amibroker] Re: Metastock PREV



PureBytes Links

Trading Reference Links

Hello,

> One of the many things I don't understand about programming is why
> PREV should require slowly recalculating all the previous values of
> whatever.

It is because MS' PREV is self-referencing (recursive), i.e. i-th element depends on value of (i-1)th element.
With recursive definition one can not perform vector (parallel) processing,
you need to perform iteration.

Because MS offers no iteration (no loops and no array element access) they "invented" PREV.

But AB has iteration (loops and array access) so there is no need for PREV.
BTW: note that no general-purpose langauage (C/C++, Pascal, Basic, Fortran, whatever)
needs/has PREV thingy. Why? Because looping is all you need.

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message ----- 
From: "owenbdavies" <owen5819@xxxxxxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Wednesday, August 03, 2005 7:40 PM
Subject: [amibroker] Re: Metastock PREV


> One of the many things I don't understand about programming is why
> PREV should require slowly recalculating all the previous values of
> whatever. Why not just scan the formula first, note what the PREV
> statement refers to, set up an extra array, and save the values to it
> as they are calculated? Then when you get to the PREV statement all
> you'd have to do is look up the necessary value in the array. With the
> advantage of not knowing what I'm talking about, it seems that this
> would have to be a lot faster than the endless-recalculation method,
> and maybe even fast enough not to degrade AB's performance to an
> objectionable degree.
>
> Just a thought.
>
> Owen Davies
>
>
>
>
>
> 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
>
>
>
>
>
>
> 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
<font face=arial size=-1><a href="http://us.ard.yahoo.com/SIG=12h5t6dnn/M=362343.6886682.7839641.1493532/D=groups/S=1705632198:TM/Y=YAHOO/EXP=1123100477/A=2894350/R=0/SIG=10tj5mr8v/*http://www.globalgiving.com";>Make a difference. Find and fund world-changing projects at GlobalGiving</a>.</font>
--------------------------------------------------------------------~-> 

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/