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

[amibroker] Re: StDev question



PureBytes Links

Trading Reference Links

Right. Sorry, too quick on the draw on my part.

Mike

--- In amibroker@xxxxxxxxxxxxxxx, "ta" <tagroups@xxx> wrote:
>
> Sorry I meant to say Bar 0 of Chg array is Null. Bars 1 thru 5 have values,
> so on bar 5 StDev should NOT return null.
> 
>  
> 
>  
> 
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of ta
> Sent: Tuesday, August 18, 2009 2:45 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: RE: [amibroker] Re: StDev question
> 
>  
> 
>   
> 
> Mike
> 
>  
> 
> Bar 0 of Chg array is zero. Bars 1 thru 5 have values, so on bar 5 StDev
> should NOT return null.
> 
>  
> 
> test.jpg
> 
>  
> 
> From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf
> Of Mike
> Sent: Tuesday, August 18, 2009 2:38 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: [amibroker] Re: StDev question
> 
>  
> 
>   
> 
> I suspect that the problem is that your first element in the Chg array is
> {empty}. AmiBroker is probably waiting for 5 non empty values before giving
> an answer.
> 
> Mike
> 
> --- In amibroker@xxxxxxxxxxxxxxx <mailto:amibroker%40yahoogroups.com> , "ta"
> <tagroups@> wrote:
> >
> > 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/

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/