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

Re: [amibroker] Re: counting values within an array



PureBytes Links

Trading Reference Links

bigitop wrote:
for some reason i cant get Sum() to work.

i have two arrays

z  [0, 1, 1, 0, 1, 0, 0, 1, 1]
p  [1, 0, 1, 1, 1, 1, 0, 1, 0]


what i'm trying to do is calculate:

z/p

which should be 5/6 or 0.83

im trying it like this:

numberofcellsinarray = LastValue(BarIndex()) + 1;
sumZ = Sum(z, numberofcellsinarray);
sumP = Sum(p, numberofcellsinarray);

result = sumZ/sumP;


but this wont display anything in the automatic analysis window

can anyone suggest a good way to do this?

here you go:
result =
Cum(z)/Cum(p);
result =
LastValue(result);


__._,_.___


**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/





Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___