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

Re: extend lr average



PureBytes Links

Trading Reference Links

Hello John,

You are almost there.

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[Displace](Average(Plot1, Length2), "lrAvg" ) ;
end ;

The question is whether that is the Plot2 you want. Or do you want Plot2 to be
Plot2[Displace](Average(LinearRegValueFC(Price, Length1, 0), Length2), "lrAvg" ) ;

Also look at Jimmy's idea to make the code efficient.

-- Harrison


john Davis wrote:

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