Screener Help for Nicolas's Standard Deviation/Error LR Channel
Forums › ProRealTime English forum › ProScreener support › Screener Help for Nicolas's Standard Deviation/Error LR Channel
- This topic has 10 replies, 3 voices, and was last updated 4 years ago by Nicolas.
-
-
02/09/2020 at 1:09 PM #119085
Greetings team. I’ve been working on back testing with Nicolas’s Indicator here: https://www.prorealcode.com/prorealtime-indicators/standard-deviation-standard-error-linear-regression-channel/
I’d like to develop a screener along with another indicator in order to share with you all, however, I’m a little stuck with the conditions. Ideally this is a question directly to Nicolas. But anyone who can help, please feel free. I can do the rest of the work on my own I think.
As a visual indicator, this is amazing. But how does one detect digitally, when price (close) is above (>) the top line (+1) of the channel? I’m struggling with converting the drawn-line to a number or fixed point to use for a reference.
Ideally I want to make the top line of the channel, indicator 1 and the bottom line, indicator 2 respectively.
I think this has real potential…
02/09/2020 at 1:31 PM #119086I’m guessing that you want to know if the current bar is above or below the lines and not if a candle in the lookback period has been above or below the lines?
If so then a+b*0+dat is the upper line y value and a+b*0–dat is the lower line y value for the current bar.
1 user thanked author for this post.
02/09/2020 at 2:57 PM #11909202/09/2020 at 5:48 PM #11910102/09/2020 at 5:55 PM #119103I can’t find it now.. anyway, what you are looking for is if the price is exceding a linear regression + standard deviation factorized, should be coded like this:
123test = high > linearregression[lookback]+std[lookback]*NbDeviation OR low < linearregression[lookback]-std[lookback]*NbDeviationscreener[test](not tested)
1 user thanked author for this post.
02/10/2020 at 5:33 PM #119208Okay guys… Thank you so far. I’ve managed to learn a bit more from what you’ve both told me and I’ve merged both comments into one screener prototype. However… the MAX units I can set for the lookback is 254, ideally I’d like this to be 300.
I’m enclosing the code below for assistance. (Please keep in mind I’m a real newcomer, but I really am interested in learning more).
Screener Prototype - Nicolas's PRC LR STD/STE channel123456789101112131415161718192021222324252627282930313233343536373839404142// --- settingslookback= 254 //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]*NbDeviationendify = a+b*0+datz = a+b*0-dattest = close > y OR close < zscreener[test]Thanks for your help and patience, Craig 🙂
02/10/2020 at 7:27 PM #11923102/11/2020 at 10:17 AM #11930403/02/2020 at 8:01 PM #121010Hi Nicolas
I know you’re constantly bombarded with questions, however, I was wondering if there’s a way to code that both values must be “above” the top line. (Even though I know the line is only a drawn on object)! I’m working on this as developing the indicator for multi-timeframe, but then also for use later in a strategy to share. (I just want it to be better before sharing.
So far I have…
Multi-TF Channel Detection Screener12345678Timeframe (1 hour)test1 = high > linearregression[254]+std[254]*1 OR low < linearregression[254]-std[254]*1Timeframe (15 Minute)test2 = high > linearregression[254]+std[254]*1 OR low < linearregression[254]-std[254]*1screener[test1 AND test2]However, currently this would show when say the one hour is Above the Top line but the default or 15m is below the bottom line. I know that this is correct. But it’s not the outcome I wish to return.
03/02/2020 at 8:06 PM #121011I may have just answered my own question on this… If it’s not this, then any help would be received with gratitude.
MTF Channel modification1234567891011Timeframe (1 hour)test1 = high > linearregression[254]+std[254]*1test2 = low < linearregression[254]-std[254]*1Timeframe (15 Minute)test3 = high > linearregression[254]+std[254]*1test4 = low < linearregression[254]-std[254]*1screener [(test1 AND test2) OR (test3 AND test4)]03/03/2020 at 9:36 AM #121033 -
AuthorPosts