JSParticipant
Veteran
Hi @marco7630
Question about the formula:
Why are “smoothK” and “smoothD” in the formula when they are not being used?
//Start Code
lengthRSI = 14 //RSI period
lengthStoch = 14 //Stochastic period
smoothK = 10 //Smooth signal of stochastic RSI
smoothD = 3 //Smooth signal of smoothed stochastic RSI
myRSI = RSI[lengthRSI](close)
MinRSI = lowest[lengthStoch](myrsi)
MaxRSI = highest[lengthStoch](myrsi)
StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100
Return StochRSI
//End code
Hello,
I asked prorealtime which formule they used for this indicator and this was their reply.
gr Marco
JSParticipant
Veteran
Okay, strange but more importantly, does this formula match the formula you use, do they give the same values?
Actually the full code is:
// Stochastic RSI
//PRC_Stochastic RSI | indicator - 06.12.2016 - Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge - converted and adapted from Pinescript version
DEFPARAM CalculateOnLastBars = 2000
//lengthRSI = 10 //RSI period
//lengthStoch = 10 //Stochastic period
//smoothK = 10 //Smooth signal of stochastic RSI
//smoothD = 3 //Smooth signal of smoothed stochastic RSI
//
myRSI = RSI[lengthRSI](close)
MinRSI = lowest[lengthStoch](myrsi)
MaxRSI = highest[lengthStoch](myrsi)
//
StochRSI = (myRSI-MinRSI) / (MaxRSI-MinRSI)
//
K = average[smoothK](stochrsi)*100
D = average[smoothD](K)
//
return K as "K%", D as "D%"
but the standard formula I found over the internet, in several sites (and applied by PRT), doesn’t use the K and D lines,
JSParticipant
Veteran
Thanks Roberto…
Then the screener will now work as you intended…
lengthRSI = 14 //RSI period
lengthStoch = 14 //Stochastic period
myRSI = RSI[lengthRSI](close)
MinRSI = lowest[lengthStoch](myrsi)
MaxRSI = highest[lengthStoch](myrsi)
StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100
C1 = (StochRSI - StochRSI[1]) > 60
xSMA = Average[20](Close)
C2 = xSMA - xSMA[1] > 0
SCREENER [C1 and C2]
What would i need to change in the code to get only results that have more than 60 DECLINE and a downward SMA20?
JSParticipant
Veteran
lengthRSI = 14 //RSI period
lengthStoch = 14 //Stochastic period
//smoothK = 10 //Smooth signal of stochastic RSI
//smoothD = 3 //Smooth signal of smoothed stochastic RSI
myRSI = RSI[lengthRSI](close)
MinRSI = lowest[lengthStoch](myrsi)
MaxRSI = highest[lengthStoch](myrsi)
StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100
C1 = (StochRSI[1] - StochRSI) > 60
xSMA = Average[20](Close)
C2 = xSMA - xSMA[1] < 0
SCREENER [C1 and C2]
Great. What do i need to add to only see stocks with more than 500k volume on last trading day?
JSParticipant
Veteran
lengthRSI = 14 //RSI period
lengthStoch = 14 //Stochastic period
//smoothK = 10 //Smooth signal of stochastic RSI
//smoothD = 3 //Smooth signal of smoothed stochastic RSI
myRSI = RSI[lengthRSI](close)
MinRSI = lowest[lengthStoch](myrsi)
MaxRSI = highest[lengthStoch](myrsi)
StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100
C1 = (StochRSI[1] - StochRSI) > 60
xSMA = Average[20](Close)
C2 = xSMA - xSMA[1] < 0
C3 = Volume > 500000
SCREENER [C1 and C2 and C3](Volume as "Volume")
Hello,
I would like to add the following to the code. I only want to see stocks with Bolinbger Bandwidth (20 2) greater than 10% (0,1)
What do i need to add?
gr Marco