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

RE: [amibroker] Standard Error AB vs MS is the same



PureBytes Links

Trading Reference Links

OBTW,

Shouldn't it be...
MOV( array, period, S )  =>>>>   MA( array, period );
MOV( array, period, E )  =>>>>  EMA( array, period ); //E for Exponential MA
?
Power( array, value ) =>>>> array ^ value

Just a thought.
Mr Valley

-----Original Message-----
From: Tomasz Janeczko [mailto:amibroker@xxxxxx]
Sent: Wednesday, March 12, 2003 1:20 AM
To: amibroker@xxxxxxxxxxxxxxx
Subject: Re: [amibroker] Standard Error AB vs MS not the same

Ken,

I wrote before that Metastock has built-in STE function that matches exactly
AB's StdErr

The code you provided does not use STE function but is some
kind of "custom" implementation.
You may easily rewrite it to AFL using the following rules:

MOV( array, period, S )  =>>>>   MA( array, period )
MOV( array, period, E )  =>>>>  MA( array, period )
Power( array, value ) =>>>> array ^ value

^ - is an exponentiation operator (listed in AFL reference)

Power(Sum(C,21),2)/21)

In AFL can be written as this

( Sum( C, 21 ) ^ 2 ) /21

Best regards,
Tomasz Janeczko
amibroker.com
----- Original Message -----
From: "Ken Close" <closeks@xxxxxxxx>
To: <amibroker@xxxxxxxxxxxxxxx>
Sent: Tuesday, March 11, 2003 10:31 PM
Subject: RE: [amibroker] Standard Error AB vs MS not the same


> I do not mean to start a debate on similar values from the two programs;
> however, this is important to me because a client wants a system done in
> AB that is currently being successfully implemented in MS, and if the
> functions produce the same values, then the MS system rules will work in
> AB....right now it does not.
>
> Attached are two screen shots:
>
> A1.gif is from AB showing QQQ for 3/4/2002. The screen shows the code
> for the indicator; the indicator pane shows the values. A7.gif shows the
> equivalent screen in MS with values shown in the databox.
>
> .........MS Value......AB Value
> Upper......35.0397......37.85
> Lower......33.4256......34.34
>
> The one difference is that there is a "smoothing" function box in the
> settings box in MS.  I did not see, nor know how to apply, any
> "smoothing factor" in AB.  Perhaps that is the difference.
>
> In fact, when the smoothing factor in MS is set to 1, then both values
> are the same.
>
> So can you please tell me how and where to apply a smoothing factor in
> the AB formula for the Error Bands, so they become equivalent to the
> ones in MS.
>
>
> Ken
>
> -----Original Message-----
> From: Tomasz Janeczko [mailto:amibroker@xxxxxx]
> Sent: Tuesday, March 11, 2003 3:59 PM
> To: amibroker@xxxxxxxxxxxxxxx
> Subject: Re: [amibroker] Standard Error AB vs MS not the same
>
> Ken,
>
> I should probably add that Metastock STE (standard error) and
> AmiBrokers StdErr produce EXACTLY THE SAME output.
> =============================================
> (provided that they are applied to the same data and same
> 'period' parameter is used).
>
> I beg you that you check the things exactly before starting
> yet again "Indicator X in AB vs MS is not the same" thread.
>
> Belive me that I really check such things BEFORE I release
> each new function.
>
> Best regards,
> Tomasz Janeczko
> amibroker.com
> ----- Original Message -----
> From: "Tomasz Janeczko" <amibroker@xxxxxx>
> To: <amibroker@xxxxxxxxxxxxxxx>
> Sent: Tuesday, March 11, 2003 9:50 PM
> Subject: Re: [amibroker] Standard Error AB vs MS not the same
>
>
> > Ken,
> >
> > Could you please use STE function in Metastock?
> > This is what we can refer as to "Standard error" produced in
> Metastock.
> >
> > Best regards,
> > Tomasz Janeczko
> > amibroker.com
> > ----- Original Message -----
> > From: "Ken Close" <closeks@xxxxxxxx>
> > To: "AmiBroker List" <amibroker@xxxxxxxxxxxxxxx>
> > Sent: Tuesday, March 11, 2003 9:37 PM
> > Subject: [amibroker] Standard Error AB vs MS not the same
> >
> >
> > > All:
> > >
> > > Recently there has been some talk about Standard Error Bands.
> > >
> > > I have confirmed that the Standard Error Bands produced within AB do
> NOT
> > > match the Standard Error Bands produced within MS.   I do not care
> which
> > > one is "theoretically correct."   I have a system idea that needs to
> > > generate a signal when the Close crosses above the upper Standard
> Error
> > > Band, or below the lower Standard Error Band.
> > >
> > > It does not work in AB but does work using the MS version of the
> > > Standard Error Band (I really do not care what the name is, I just
> want
> > > the values to be correct)....
> > >
> > > Here is the AB version of the error band:
> > >
> > > Pr=Param("Pr",8,2,21,1);
> > > Lr = LinearReg( Close, Pr);
> > > Se = StdErr( Close, Pr );
> > > width = 2;
> > >
> > > Uband = Lr + width * Se;
> > > Lband =  Lr - width * Se;
> > >
> > > Plot(C,"Close",4,64);
> > > Plot(Uband,"Upper",2,1);
> > > Plot(Lband,"Lower",5,1);
> > >
> > > Here is the more complex (understatement) expression for the
> standard
> > > error band from Metastock:
> > >
> > > 21 period Upper Band (smoothed):
> > > Mov((21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21)) / (21 *
> > > Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2)) * Cum(1) +
> (Mov(C,21,S) -
> > > Mov(Cum(1),21,S) * (21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) *
> > > Sum(C,21))/ (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2)))
> > > +2*(Sqrt(((Sum(Power(C,2),21)-(Power(Sum(C,21),2)/21))
> > > -((Sum(Cum(1)*C,21))-((Sum(Cum(1),21)*Sum(C,21)/21)))/
> > > ((Sum(Power(Cum(1),2),21))-(Power(Sum(Cum(1),21),2)/21))
> > > *((Sum(Cum(1)*C,21))-((Sum(Cum(1),21)*Sum(C,21)/21)))) /19)),3,S)
> > >
> > > 21 period Lower Band (smoothed):
> > > Mov((21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) * Sum(C,21)) / (21 *
> > > Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2)) * Cum(1)
> +(Mov(C,21,S) -
> > > Mov(Cum(1),21,S) * (21 * Sum(Cum(1) * C,21) - Sum(Cum(1),21) *
> > > Sum(C,21))/ (21 * Sum(Pwr(Cum(1),2),21) - Pwr(Sum(Cum(1),21),2))) -
> > > 2*(Sqrt(((Sum(Power(C,2),21)-(Power(Sum(C,21),2)/21))
> > > -((Sum(Cum(1)*C,21))- ((Sum(Cum(1),21) * Sum(C,21)/21))) /
> > > ((Sum(Power(Cum
> > > (1),2),21))-(Power(Sum(Cum(1),21),2)/21))*((Sum(Cum(1)*C,21))-
> > > ((Sum(Cum(1),21)*Sum(C,21)/21)))) /19)),3,S)
> > >
> > >
> > > Can someone suggest how I might recreate the equation (whatever it
> is
> > > called) so that I can get the same signal out of this "error band"
> > > parameter?
> > >
> > > For example, what is the equivalent in AB for "POWER"?  I will for
> now
> > > assume that all of the other functions - Cum(), Sum(), etc are the
> same.
> > > I know how to convert the MS Mov() formula to the AB MA().  Any help
> on
> > > Power or Pwr??
> > >
> > > If the above is too imposing, can you just translate this into AFL
> > >
> > > Power(Sum(C,21),2)/21)  ===>  ???? in AFL  ?????
> > >
> > > Thanks for any help,
> > >
> > > Ken
> > >
> > >
> > >
> > >
> > > Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> > > Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> > > -----------------------------------------
> > > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > > --------------------------------------------
> > > Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> > >
> > > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> > >
> > >
> > >
> >
> > Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> > Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> > -----------------------------------------
> > Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> > (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> > --------------------------------------------
> > Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
> >
> > Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
> >
> >
> >
>
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
> http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
> Your use of Yahoo! Groups is subject to
> http://docs.yahoo.com/info/terms/
>
>
>
>
> Send BUG REPORTS to bugs@xxxxxxxxxxxxx
> Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
> -----------------------------------------
> Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
> (Web page: http://groups.yahoo.com/group/amiquote/messages/)
> --------------------------------------------
> Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>

Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at:
http://groups.yahoo.com/group/amibroker/files/groupfaq.html

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/