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

[RT] Error and Lag



PureBytes Links

Trading Reference Links

It almost looks like one could graph the error, once it gets beyond a
certain error.
Then the average is no longer describing the the trend.  I guess that is
what BobR is angling
about.  Thanks for giving the formula.  I was also thinking that Supercharts
and TS used to have
a correlation function.  That could work also.

Don Thompson.

----- Original Message -----
From: "Bob Fulks" <bfulks@xxxxxxxxxx>
To: <realtraders@xxxxxxxxxxxxxxx>
Sent: Saturday, April 14, 2001 9:59 AM
Subject: Re: [RT] General - code question


> At 9:40 PM -0700 4/13/01, BobR wrote:
>
> >Is there any easylanguage code that will determine how well a moving
> >average represents price? Suppose for example you want to compare
> >different types of averages and different lengths of averages and
> >desire a numerical output for fitness of each average. How would you
> >write a statistical indicator to compare the close or the (H+L)/2 to
> >the moving average over a period of N bars or maxbars back?
>
> You can start by knowing that the average will lag the price. That
> will be most of the error. I would assume you want to remove that
> source of error first and see what is left.
>
> The lag of many common averages (Average, XAverage, etc.) is given by:
>
>     Lag = (Length - 1) / 2
>
> More complex averages such as the T3Average and the JurikMA have more
> complicated lag functions.
>
> So next you might want to calculate the root-mean-square error -
> something like this:
>
>   Avg = Average(Price, Length);
>   Lag = (Length - 1) / 2;
>   Error = Price[Lag] - Avg;
>   SqrErr = Error * Error;
>   MSqrErr = Average(SqrErr, Length2);
>   if MSqrErr > 0 then RMSE = SquareRoot(MSqrErr);
>
> or the average absolute error - something like this:
>
>   Avg = Average(Price, Length);
>   Lag = (Length - 1) / 2;
>   Error = Price[Lag] - Avg;
>   AbsErr = AbsValue(Error);
>   MAbsErr = Average(AbsErr, Length2);
>
> The choice will depend upon what you are trying to determine.
>
> Bob Fulks
>
>
>
> To unsubscribe from this group, send an email to:
> realtraders-unsubscribe@xxxxxxxxxxxxxxx
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>


To unsubscribe from this group, send an email to:
realtraders-unsubscribe@xxxxxxxxxxxxxxx

 

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