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

Re: [amibroker] Average and Standard Deviation for all data



PureBytes Links

Trading Reference Links



Hi
 
Wrting out the value of  the _expression_ BarsSince(NOT(IsNull(Calc1))) , the value is constant 0.
 
SetBarsRequired(-2,-2);
Calc1 = C - MA(C,30);
Mean = Cum(Calc1) / Cum(1);
SumOfSquare = Cum( (Calc1 - mean) * (Calc1 - mean));
Std  = sqrt(SumOfSquare/ BarCount) ;
bars = BarsSince(NOT(IsNull(Calc1)));
"Bars = " + bars;
"Calc1 = " + Calc1;
"Mean = " + Mean;
"Std = " + Std;
There's also AFL function StDev(Array,Periods),  however, when I try Std = StDev(Calc1,BarCount), the result is 0.
 
But I don't know why.
 
Rds
SW


From: pmxgs <pmxgs@xxxxxxxxxx>
To: amibroker@xxxxxxxxxxxxxxx
Sent: Saturday, April 11, 2009 3:48:45 AM
Subject: [amibroker] Average and Standard Deviation for all data

Hi,

I would like to calculate the average and standard deviation for all the data available in an array.
For example:

calc1=C-ma(C, 30);

I would like now to calculate an average and std. dev. of calc1 which gets updated as new bars appears.
This average and std. dev. include all the available data.

I have tried MA(calc1,barssince( not(isnull( calc1)))) ; but it doesn't work.

Any suggestions?

thanks




__._,_.___


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

__,_._,___