For the moment I solved in this way ... 

for( i = 100; i < BarCount; i++ )
{
avrg1[0]=yield1[0];
avrg1[i]=(1-alpha)*avrg1[i-1]+alpha*yield1[i];
dvst1[0]=yield1[0];
dvst1[i]=sqrt((1-alpha)*dvst1[i-1]^2+alpha*(yield1[i]-avrg1[i])^2);
}



--- In [email protected], "Angio" <angio1...@...> wrote:
>
> I think the input is ... (yield1-avrg1)^2
> 
> output[i]=factor[i] * input[i] + (1 - factor[i]) * output[i-1];
> 
> dvst1=sqrt(alpha*(yield1-avrg1)^2+(1-alpha)*(Ref(dvst1,-1))^2);
> 
> 
> but also the output[i-1] should be ... ^2 !!!
> 
> 
> 
> 
> --- In [email protected], "Tomasz Janeczko" <groups@> wrote:
> >
> > Hello,
> > 
> > Oh sorry, second AMA should of course take yield1-avrg1 as input.
> > 
> > 
> > instead of:
> > dvst1=sqrt((1-alpha)*Ref(dvst1,-1)*Ref(dvst1,-1)+alpha*(yield1-avrg1)*(yield1-avrg1));
> > 
> > you should write
> > dvst1=sqrt( AMA( yield1-avrg1, alpha ));
> > 
> > 
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message ----- 
> > From: "Angio" <angio1967@>
> > To: <[email protected]>
> > Sent: Sunday, August 09, 2009 11:15 AM
> > Subject: [amibroker] Re: Error 29, variable 'xxx' without having been 
> > initialized !!!
> > 
> > 
> > > Tomasz thanks again, yesterday I studied the manual all day ...
> > > 
> > > but you are sure that the second AMA formula is correct?
> > > 
> > > So instead of:
> > > avrg1=(1-alpha)*Ref(avrg1,-1)+alpha*yield1; 
> > > 
> > > you should write:
> > > avrg1= AMA( yield1, alpha );
> > > 
> > > and instead of:
> > > dvst1=sqrt((1-alpha)*Ref(dvst1,-1)*Ref(dvst1,-1)+alpha*(yield1-avrg1)*(yield1-avrg1));
> > > 
> > > you should write
> > > dvst1=sqrt( AMA( yield1, alpha ));
> > > 
> > > by
> > > 
> > > 
> > > 
> > > ------------------------------------
> > > 
> > > **** 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
> > > 
> > > 
> > >
> >
>


Reply via email to