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

Re: another code question



PureBytes Links

Trading Reference Links

> I have been told by 1 person that this is correct and by several
> that say no because too many inputs like ts tells me.  Whats odd is
> that the same expression using LR   LinearRegValueFC(Close,34,10);
> verifys fine. and it is the same expression except that is is using
> LR. 

Have you looked at the definition of LinearRegValueFC?  
Apparently not, since if you had, you would have found that the 
3rd parameter specifies the number of bars into the future or 
past that it's supposed to project the LR value.

Xaverage has nothing like that.  It just calculates the EMA for 
the last Length bars.  If you want the LR equivalent of Xaverage, 
you tell it to project 0 bars into the future -- i.e. right now.  
So LinearRegValueFC(Close, 34, 0) is roughly equivalent to 
Xaverage(Close, 34), except one uses LR and one uses EMA.