Stoch RSI 14 code help

Viewing 11 posts - 16 through 26 (of 26 total)
  • Author
    Posts
  • #203528 quote
    JS
    Participant
    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

    #203538 quote
    marco7630
    Participant
    New
    Hello, I asked prorealtime which formule they used for this indicator and this was their reply. gr Marco
    #203539 quote
    JS
    Participant
    Veteran

    Okay, strange but more importantly, does this formula match the formula you use, do they give the same values?

    #203546 quote
    robertogozzi
    Moderator
    Master
    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,
    #203550 quote
    JS
    Participant
    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]
    
    #203577 quote
    marco7630
    Participant
    New
    It is working:-). Thanks
    JS thanked this post
    #203578 quote
    marco7630
    Participant
    New
    What would i need to change in the code to get only results that have more than 60 DECLINE and a downward SMA20?
    #203580 quote
    JS
    Participant
    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]
    #203593 quote
    marco7630
    Participant
    New
    Great. What do i need to add to only see stocks with more than 500k volume on last trading day?
    #203595 quote
    JS
    Participant
    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")
    #203621 quote
    marco7630
    Participant
    New
    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
Viewing 11 posts - 16 through 26 (of 26 total)
  • You must be logged in to reply to this topic.

Stoch RSI 14 code help


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
marco7630 @marco7630 Participant
Summary

This topic contains 25 replies,
has 3 voices, and was last updated by marco7630
3 years, 4 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 11/01/2022
Status: Active
Attachments: 5 files
Logo Logo
Loading...