linear regression channel screener
Forums › ProRealTime English forum › ProScreener support › linear regression channel screener
- This topic has 6 replies, 3 voices, and was last updated 3 years ago by cc267.
-
-
04/20/2021 at 11:43 PM #167653
Hi, I am trying to make a screener for this indicator -https://www.prorealcode.com/prorealtime-indicators/standard-deviation-standard-error-linear-regression-channel/
A similar thread here gives some examples but i cant get any of them to work. https://www.prorealcode.com/topic/screener-help-for-nicolass-standard-deviation-error-lr-channel/
How could i go about screening for when the open price hits the lower band? Many Thanks
04/20/2021 at 11:53 PM #167656A screener detects and shows an event, while this indicator plots a channel.
To make a screener out of it you need to tell us what event do you want to be detected and shown. For example when a price touches or breaks one of the outer bands or the middle band or whatever else you want to be detected.
04/21/2021 at 8:28 AM #16767404/21/2021 at 8:28 AM #16767504/21/2021 at 8:33 AM #167677lin reg123test = high > linearregression[lookback]+std[lookback]*NbDeviation OR low < linearregression[lookback]-std[lookback]*NbDeviationscreener[test]I’ve manged to get this one to work now. I think the other one the OP posted is not working.
04/21/2021 at 10:27 AM #167686This works:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152//PRC_Std and Ste LinRegChannel | indicator//Standard Deviation and Standard Error//Linear Regression Channel//12.03.2019//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge// --- settingslookback= 200 //channel periodChannelType = 1 //1= Standard Deviation ; 2= Standard ErroNbDeviation = 1 //Deviation multiplier// --- end of settingssumx = 0sumy = 0sumxy = 0sumx2 = 0for cmpt = lookback downto 0 dotmpx = cmpttmpy = close[cmpt]sumy = sumy+tmpysumx = sumx+tmpxsumx2 = sumx2 + (tmpx*tmpx)sumxy = sumxy + (tmpy*tmpx)nextn = lookback+1if (sumx2 = sumx * sumx) then // protection to avoid infinite valuesb = sumxy - sumx * sumyelseb = (n * sumxy - sumx * sumy) / (n * sumx2 - sumx * sumx)endifa = (sumy - b * sumx) / n//channelif ChannelType = 1 then //Standard Deviationdat = std[lookback]*NbDeviationelsedat = ste[lookback]*NbDeviationendif//UPPER band//UpperBand = a+b*0+dat//drawsegment(barindex[lookback],(a+b*lookback)+dat,barindex,a+b*0+dat) coloured(colorRed,colorGreen,colorBlue)//LOWER bandLowerBand = a+b*0-dat//drawsegment(barindex[lookback],(a+b*lookback)-dat,barindex,a+b*0-dat) coloured(colorRed,colorGreen,colorBlue)Cond = (open CROSSES UNDER LowerBand) OR (max(open,close) >= LowerBand AND min(open,close) <= LowerBand)SCREENER[Cond]04/21/2021 at 9:05 PM #167734 -
AuthorPosts
Find exclusive trading pro-tools on