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

Re: Odd calculation problem



PureBytes Links

Trading Reference Links

Gary,

try to replace xaverage by e.g. xaverage2.

Jan Philipp

----- Original Message ----- 
From: Gary Fritz <fritz@xxxxxxxx>
To: Omega-List <omega-list@xxxxxxxxxx>
Sent: Thursday, January 18, 2001 10:23 AM
Subject: Odd calculation problem


> Here's a strange one.  I've got a chart with 2 data series:  NQ1H and 
> NDX.  I created an indicator to display the spread between NQ1H and 
> NDX.  
> 
>   plot1(           (h+l)/2 - (h data2 + l data2)/2    , "spread");
>   plot2( xaverage( (h+l)/2 - (h data2 + l data2)/2 ,5), "xavg");
> 
> So plot1 is the difference between the midrange of NQ1H (data1) and 
> the midrange of NDX (data2).  This plots fine.
> 
> plot2 shows the recent average value.  Notice it's identical to plot1 
> (cut and pasted), with an "xaverage" wrapped around it.
> 
> It plots zero.
> 
> In fact if I wrap the spread calc in ANY function, it plots zero.  If 
> I just display the spread calc, or any calculation involving that 
> spread value but not requiring a function, it works fine.  Add in a 
> function and it's zero.
> 
> Any guesses?  It must be some bizarre multi-data weirdity but I 
> haven't figured it out.  I'm even more confused because I've done 
> almost an identical indicator before, and it works just fine.  What 
> am I missing in this code??
> 
> Gary
> 
>