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

[amibroker] calculating the mean of only some of the observations in an array ?



PureBytes Links

Trading Reference Links

Without requiring loops that work through the whole barcount, can 
someone point out to me how to exclude certain values in an array 
when calculating a statistic across an array?

I must be missing something.  I am trying to calculate the mean of 
some values that occur only occassionally (after my signal) using 
Amibroker.  But,what happens is all the values between my signals get 
included in the calculation.  I know the solution is easy, but I 
cannot figure it out.  

//figure highest value that occurs between my signals and the 
next "x" following the signal
Cond6 = {some condition that i am investigating, like v > 5*ma(v,50)
NumBars = 12;
hV = IIf(BarsSince(Cond6) == NumBars,HHV(H,BarsSince(Cond6))-ValueWhen
(Cond6,C),Null);

//now calculate the mean of all the hv 's that occur
mean = ma(hv,NumBars*50);  //this line I am having trouble with
filter=1;
addcolumn(mean,"mean",1.2);
//then perform more statistics...(etc).



------------------------------------

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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> 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/