Stoch RSI 14 code help
Forums › ProRealTime English forum › ProScreener support › Stoch RSI 14 code help
- This topic has 25 replies, 3 voices, and was last updated 2 years ago by marco7630.
-
-
11/04/2022 at 3:03 PM #203528
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 RSImyRSI = RSI[lengthRSI](close)
MinRSI = lowest[lengthStoch](myrsi)
MaxRSI = highest[lengthStoch](myrsi)StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100
Return StochRSI
//End code11/04/2022 at 3:49 PM #20353811/04/2022 at 3:55 PM #20353911/04/2022 at 5:42 PM #203546Actually the full code is:
12345678910111213141516171819// Stochastic RSI//PRC_Stochastic RSI | indicator - 06.12.2016 - Nicolas @ www.prorealcode.com//Sharing ProRealTime knowledge - converted and adapted from Pinescript versionDEFPARAM 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)*100D = 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,
11/04/2022 at 6:07 PM #203550Thanks Roberto…
Then the screener will now work as you intended…
Marco763012345678910lengthRSI = 14 //RSI periodlengthStoch = 14 //Stochastic periodmyRSI = RSI[lengthRSI](close)MinRSI = lowest[lengthStoch](myrsi)MaxRSI = highest[lengthStoch](myrsi)StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100C1 = (StochRSI - StochRSI[1]) > 60xSMA = Average[20](Close)C2 = xSMA - xSMA[1] > 0SCREENER [C1 and C2]11/05/2022 at 8:46 AM #20357711/05/2022 at 10:20 AM #20357811/05/2022 at 10:42 AM #203580Marco7630 V212345678910111213lengthRSI = 14 //RSI periodlengthStoch = 14 //Stochastic period//smoothK = 10 //Smooth signal of stochastic RSI//smoothD = 3 //Smooth signal of smoothed stochastic RSImyRSI = RSI[lengthRSI](close)MinRSI = lowest[lengthStoch](myrsi)MaxRSI = highest[lengthStoch](myrsi)StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100C1 = (StochRSI[1] - StochRSI) > 60xSMA = Average[20](Close)C2 = xSMA - xSMA[1] < 0SCREENER [C1 and C2]11/05/2022 at 3:12 PM #20359311/05/2022 at 3:28 PM #203595Marco7630 V312345678910111213lengthRSI = 14 //RSI periodlengthStoch = 14 //Stochastic period//smoothK = 10 //Smooth signal of stochastic RSI//smoothD = 3 //Smooth signal of smoothed stochastic RSImyRSI = RSI[lengthRSI](close)MinRSI = lowest[lengthStoch](myrsi)MaxRSI = highest[lengthStoch](myrsi)StochRSI = ((myRSI-MinRSI) / (MaxRSI-MinRSI))*100C1 = (StochRSI[1] - StochRSI) > 60xSMA = Average[20](Close)C2 = xSMA - xSMA[1] < 0C3 = Volume > 500000SCREENER [C1 and C2 and C3](Volume as "Volume")11/06/2022 at 10:00 AM #203621 -
AuthorPosts
Find exclusive trading pro-tools on