Screener for RSI and Linear Regression trading signals
Forums › ProRealTime English forum › ProScreener support › Screener for RSI and Linear Regression trading signals
- This topic has 5 replies, 3 voices, and was last updated 1 year ago by manafull.
-
-
07/26/2023 at 2:55 PM #218172
Hi Nicolas, awesome work for creating the Indictor of RSI and Linear Regression trading signals!
By any chance, do you have the Screener version for this “RSI and Linear Regression trading signals”?
I tried to convert the indicator to screener by replacing the drawing at the end i.e. “SCREENER[Signal](Signal AS “1=↑, 2=↓”)”, where I use the Signal =1 or 2 to replace the two condition of drawing in the codes … but at the end I always get the error “Syntax error: This variable is not used in the {did not show any further info}”.
The Screener would complete your indicator perfectly if you can add the screener here for us.
Thank you for the great work guiding us through, as always!
07/26/2023 at 3:59 PM #218174Hi Manafull,
You can combine the indicators in different ways, I don’t know exactly what you want but here is an example of the RSI (30/70) in combination with the Linear Regression slope…
RSI and Linear Regression Slope1234567891011121314151617myRSI=RSI[14](Close)C1=myRSI Crosses Over 30 //Buy signalC2=myRSI Crosses Under 70 //SellShort signalmyLRS = LinearRegressionSlope[10](close)C3=myLRS > 0 //Buy signalC4=myLRS < 0 //SellShort signalIf C1 and C3 thenTrend=1ElsIf C2 and C4 thenTrend=-1EndIfC5=Close>10SCREENER [C1 and C3 and C5 or C2 and C4 and C5] (Trend AS "Trend")07/27/2023 at 1:07 AM #218184Hi JS
Thanks for that and I will try yours and report back here..
In the meantime, the screener that I wanted to get to, is the indicator from Nicolos’s indicator that I wanted to convert into a screener… below is code I tried to run but always with the error ““Syntax error: This variable is not used in the {did not show any further info}”.”:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364// --- settingslen = 21 //RSI Lengthperiod = 200 //Perioddeviations = 2.0 //Deviation(s)// --- end of settings//extra for screenerSignal = 0irsi = rsi[len](close)periodMinusOne = period-1Ex = 0.0Ey = 0.0Ex2 = 0.0Exy = 0.0for i=0 to periodMinusOnecloseI = (irsi[i])Ex = Ex + iEy = Ey + closeIEx2 = Ex2 + (i * i)Exy = Exy + (closeI * i)ExEx = Ex * Exnext//slopeif Ex2=ExEx thenslope = 0.0elseslope= (period * Exy - Ex * Ey) / (period * Ex2 - ExEx)endifilinearRegression = (Ey - slope * Ex) / periodintercept = ilinearRegression + barindex * slopedeviation = 0.0for i=0 to periodMinusOnedeviation = deviation + square((irsi[i]) - (intercept - slope * (barindex[i])))nextdeviation = deviations * sqrt(deviation / periodMinusOne)startingPointY = ilinearRegression + slope / periodMinusOne//lineColor//if startingPointY > startingPointY[1] then//color.blue//r=0//b=255//else//color.red//r=255//b=0//endifa = startingPointY-deviationc1 = startingPointYb = startingPointY+deviationup=irsi crosses over adown=irsi crosses under bif up then//drawtext("↑ up",barindex,irsi-5,dialog,standard,20) coloured(0,255,0)Signal = 1endifif down then//drawtext("↓ down",barindex,irsi+5,dialog,standard,20) coloured(255,0,0)Signal = 2endifSCREENER[Signal](Signal AS "1=↑, 2=↓")If you or Nicolas can review the above code and rectify it, that would be awesome. In the meantime, I will try your (JS) code as above.
Thanks!
07/27/2023 at 1:23 AM #218185Hi JS, I just run your screener and it gives me some from NASDAQ. What I wanted is to see the list of the candidates who are at the signaling point either about to dive or taking off from the RSI perspective.
If you look at Nicolas’s indicator, it shows all those: https://www.prorealcode.com/prorealtime-indicators/rsi-and-linear-regression-trading-signals/
My above code is trying to convert Nicolas’s indicator into the Screener. It should not be difficult but I keep getting the syntax error.
07/27/2023 at 8:01 AM #218189Here is a working version to check for those RSI breakout of its linear regression channel with a screener.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859//PRC_RSILinearRegressionSignals| indicator//25.09.2020//Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge//converted from tradingview//https://www.prorealcode.com/topic/rsi-linear-regresion/// --- settingslen = 21 //RSI Lengthperiod = 200 //Perioddeviations = 2.0 //Deviation(s)// --- end of settingsirsi = rsi[len](close)periodMinusOne = period-1Ex = 0.0Ey = 0.0Ex2 = 0.0Exy = 0.0for i=0 to periodMinusOnecloseI = (irsi[i])Ex = Ex + iEy = Ey + closeIEx2 = Ex2 + (i * i)Exy = Exy + (closeI * i)ExEx = Ex * Exnext//slopeif Ex2=ExEx thenslope = 0.0elseslope= (period * Exy - Ex * Ey) / (period * Ex2 - ExEx)endifilinearRegression = (Ey - slope * Ex) / periodintercept = ilinearRegression + barindex * slopedeviation = 0.0for i=0 to periodMinusOnedeviation = deviation + square((irsi[i]) - (intercept - slope * (barindex[i])))nextdeviation = deviations * sqrt(deviation / periodMinusOne)startingPointY = ilinearRegression + slope / periodMinusOne////lineColor//if startingPointY > startingPointY[1] then////color.blue//r=0//b=255//else////color.red//r=255//b=0//endifa = startingPointY-deviation//c1 = startingPointYb = startingPointY+deviationup=irsi crosses over adown=irsi crosses under bscreener[up or down]07/27/2023 at 11:26 AM #218208Thank you so much Nicolas!!!!
I just run it and it is brilliant – exactly what I am after!
The only thing I need to accommodate to run the code at my end is to clean up my PC memory and make more room to run this screener, as it is taking some time to return the results, which are all gold to me.
Just can’t thank you enough 👍👍👍
-
AuthorPosts
Find exclusive trading pro-tools on