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

Re: Problem with XAverage function in TS6



PureBytes Links

Trading Reference Links

Look at the code for the XAverage function and you will see that it only looks at the Length input on CurrentBar = 1.

You need to modify that code to have it do what you want.

When in doubt look at the code for the function, figure out what it is doing, and then make a new version that does what you want it to do.

Bob Fulks

At 3:25 PM +0100 12/6/01, Franz Schildberger wrote:

>Hi list,
>
>I just stumbled over a problem with XAverage function in ELA. If you
>use a variable for length the restults of the XAverage function are wrong.
>
>I am using TS6, so not sure if problem exists in 2000i too.
>
>Copy the following code into an indicator and insert it into a chart.
>
>If I did something wrong, please let me know.
>
>Thanks in advance.
>
>Nice Regards,
>
>Franz
>
>{============================================}
>Inputs:
>	Price (Close),
>	Length (10);
>
>Variables:
>	AvgLength (0);
>
>AvgLength=10;
>
>Plot1( XAverage(Price,Length), "1PlotInd" ) ;
>Plot2( XAverage(Price,AvgLength), "2PlotInd" ) ;
>{===========================================}