inputs: Price(Close), length(25), BarsBack(1), Displace(0),UpColor(green), DownColor(red) ;
var: LR(0);
LR= LinearRegValue(Price.Lenght,0);
If LR > LR[BarsBack] then setplotcolor[1](1, UpColor);
If LR < LR[BarsBack] then setplotcolor[1](1, DownColor);
Plot1[Displace](LR,"LinReg");
var: LR(0);
LR= LinearRegValue(Price.Lenght,0);
If LR > LR[BarsBack] then setplotcolor[1](1, UpColor);
If LR < LR[BarsBack] then setplotcolor[1](1, DownColor);
Plot1[Displace](LR,"LinReg");
Comment