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

[amibroker] StDev question



PureBytes Links

Trading Reference Links



The following is a screen shot of an excel spread sheet that contains data from the trace statement below. As you can see I am trying to calculate 5 bars std of array “Chg”. What I don’t understand is that why StDev returns null on bar index 5. It has 5 data points to calculate the STD. Using excel function STDEVP I was able to calculate the std for bar index 5. I have noticed similar behavior with the Correlation and LinRegSlope functions. What I am missing? I have gotten around this issue by writing my own STD function. TIA

 

Bar Index

close

Chg

STD

STDEVP

0

4.2813

{EMPTY}

{EMPTY}

1

4.25

-0.731088

{EMPTY}

2

4.2813

0.736472

{EMPTY}

3

4.4063

2.91967

{EMPTY}

4

4.4063

0

{EMPTY}

5

4.375

-0.710348

{EMPTY}

1.35092

6

4.2813

-2.14171

1.67506

1.67506

7

4.25

-0.731088

1.67705

1.67705

8

4.2813

0.736472

0.953698

0.95370

9

4.3125

0.728749

1.07725

1.07725

 

Chg = ROC(   Close,1);
STD =
StDev(Chg, 5);
for( i = 0 ; i < 10; i++ )
{
_TRACE("i: " + i + " close: " + C[i] + " Chg: " + Chg[i] + " STD: " + STD[i]);
}

 



__._,_.___


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

__,_._,___