PureBytes Links
Trading Reference Links
|
you mean the price range? if so, yes, this is definitely less than all quotes. but i thought Cum(m) would look only at the 1 values in the "m" array.
so how can i make them equal?
i just need to count the number of 1's and 0's in the array "m" which is simply the stocks between 48 and 52 dollars for the time frame specified in the Analysis window. how can i do this with AB?
m = IIf(Open > 48 & Open < 52, 1, 0);
number = Cum(m); result = LastValue(number);
Filter = m == 1;
AddColumn(Open, "Open"); AddColumn(result,"result");
--- In amibroker@xxxxxxxxxxxxxxx, "wavemechanic" <timesarrow@xxx> wrote: > > You probably have specified a range that is less than all quotes so cum() and open are looking at different amounts of data. > > Bill > ----- Original Message ----- > From: bigitop > To: amibroker@xxxxxxxxxxxxxxx > Sent: February 25, 2009 2:15 PM > Subject: [amibroker] still struggling with Sum() and Cum() > > > > ok, here's my big problem. consider this example: > > m = IIf(Open > 48 & Open < 52, 1, 0); > > number = Cum(m); > result = LastValue(number); > > Filter = m == 1; > > AddColumn(Open, "Open"); > AddColumn(result,"result"); > > running this code in the Analysis window returns: > > total rows: 356 rows > highest number in "result": 450 > > so, first of all, shouldn't they be the exact same number and > secondly, shouldn't "result" be filled with just one value as opposed to many values? > > neither of this is happening. what am i doing wrong?! >
__._,_.___
**** 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/
__,_._,___
|