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

Re: extend lr average



PureBytes Links

Trading Reference Links

Best way is to set the formula in a variable.  This is per the pros
not me.

Input:Price(Close),(Displace(-1),Length1(25),Length2(2);
var:p2(0);
P1=LinearRegValueFC(Price,Length1,0);
P2=Average((P1,Length2);

Plot1[Displace](p1,"LinReg");
Plot2[Displace](p2,"LrAve");

Now I didn't check this out and you know I'm not the code wiz so there
could be multiple errors in spite of how simple it is.

where you show Plot2[Displace]average ....    you are misisng the (
before average.  Plus the pros tell me to do it so the whole formula
is not in the plot statement.  I do it anyway sometimes but it does
make the code easier to keep up with if you do it this way.

Jimmy


Can anyone tell me if it is possible to extend plot 2 forward like plot1 by 
using displace =-1.?? I have tried
writing it out like this but it tells me it needs more inputsl.
"Plot2[Displace]average(LinearRegValueFC(Price, Length1, 0), "LinearReg"); I 
know this is not the way you do it. can anyone tell me how to write it 
correctly, if it can be done?


Inputs: Price(Close),  Displace(-1),length1(25),LENGTH2(2) ;

If Displace > -1 OR CurrentBar > AbsValue(Displace) Then Begin
	Plot1[Displace](LinearRegValueFC(Price, Length1, 0), "LinearReg");
Plot2(Average(Plot1, Length2), "lrAvg" );

I want to extend plot 2 forward like plot 1.   thanks