--- In amibroker@yahoogroups.com, "Ara Kaloustian" <[EMAIL PROTECTED]> wrote:
>Hi Ara, this worked great but I had left out a part that the loop did
not address. I have some zero values in array. So it looks like this:
MyArray = (30,40,-20,0,0,-10);
The results I would like are:
Results = (30,70,5
>
> }
>
>
>
>
> Regards,
>
>
>
> David
>
> This worked great! Thanks Dave
> Nick
> _
>
> From: amibroker@yahoogroups.com [mailto:[EMAIL PROTECTED]
On Behalf
> Of NickCivit
> Sent: 02/18/2007 7:24 AM
> To: amibroker@y
Nick,
The following logic should work:
newarray[0] = myarray[0];
for (i=1; imailto:[EMAIL PROTECTED] On Behalf
Of NickCivit
Sent: 02/18/2007 7:24 AM
To: amibroker@yahoogroups.com
Subject: [amibroker] Re: Running total array help
--- In [EMAIL PROTECTED] <mailto:amibro
for (i=1; i<=Lastvalue(Barindex()); i++)
{
newarray[i] = iif(myarray[i] ==0,myarray[i-1],myarray[i] + myarray[i-1]);
}
- Original Message -
From: "NickCivit" <[EMAIL PROTECTED]>
To:
Sent: Sunday, February 18, 2007 4:23 AM
Subject: [amibroker] Re: Running total ar