Announcement

Collapse
No announcement yet.

StochRSI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • StochRSI

    I am curious as to how the StochRSI works with the parameters I use.

    I am using StochRSI (13, 21 (3), 5)
    where the RSI is length 13
    Stochastic %K is length 21 and smoothing 3
    Stochastic %D is smoothing 5

    How is this calculated?

    I tried calculating it in Excel and am not getting the same results as Qcharts.

    RS = average gain/average loss
    Where the average gain and loss is the average of 13 days.
    (but im not sure how to calculate smoothing 3 here)

    RSI = 100-(100/(1+RS))

    %K = ((Recent close - RSI Lowest Low)/(RSI highest high - RSI lowest low)) x 100

    Where Recent close is the current RSI. Lowest low is the lowest RSI in 21 days
    Highest high is the highest RSI in 21 days.

    And the %D is the average of the last how many days? with a smoothing 5 which i also dont know how to calculate.

  • #2
    QC's implementation of RSI inserts an extra non-valid value for the first value in the RSI series. Also if you haven't reached the RSI length number of data points yet, you want to insert invalid values for RSI and just keep the running gain/loss averages intact.

    For Stochastics (in the context of StochRSI), QC sets the current high and current low to the last price rather than the normal stochastics algorithm of current high = MAX(current high, last price), current low = MIN(current low, last price). This only matters if you're recalculating a given StochRSI data point because you got a new last price for that time period.

    With these modifications, make sure your RSI values jive with QC's. Once they do, you can validate your StochRSI values.

    I've validated that my StochRSI matches QC exactly.

    Comment


    • #3
      Thanks nall for your reply. I am trying to use your advice and am still not getting the same values. I dont think i quite understand.

      Can you send me how exactly you did this?

      Comment


      • #4
        I attempted to recreate your program in an excel spreadsheet but am not getting similar numbers.

        I am not able to attach the spread sheet so here is what I have done.

        curGain=IF(close>prevClose,close-prevClose,0)
        curLoss=IF(close<prevClose,prevClose-close,0)
        avgGain=SUM(curGain:gain13daysago)/13
        avgLoss=SUM(curLoss:loss13daysago)/13
        RS=agvGain/avgLoss
        RSI=100-(100/(1+RS))
        StochRSI=100*((RSI-RSIlowestLow(21days)/RSIhighesthigh(21days)-RSIlowestlow(21days))

        Comment


        • #5
          I have the RSI giving proper values. But the StochRSI still isn't.

          You said "For Stochastics (in the context of StochRSI), QC sets the current high and current low to the last price rather than the normal stochastics algorithm of current high = MAX(current high, last price), current low = MIN(current low, last price)."

          Im interpreting this as:
          current high = last price
          current low = last price

          in the formula:
          StochRSI=100*((RSI-current low)/(current high-current low))

          which means you would always be dividing by 0.

          Comment


          • #6
            Attached is an Excel sheet that calculates the RSI(14) and the StockRSI(21,3,5) of daily IBM
            Alex
            Attached Files

            Comment


            • #7
              thank you for the file alex, however it seems that the file is password protected

              Comment


              • #8
                supersoup
                The file is not protected
                Alex


                Originally posted by supersoup
                thank you for the file alex, however it seems that the file is password protected

                Comment


                • #9
                  I clicked the link
                  Selected Save File and clicked Ok
                  The file is saved into my download folder as "esignal" with no extension (not .xls or .zip).
                  If i try sending it to a compressed (zipped) folder and try unzipping it, it asks for a password.

                  Maybe I didnt download it properly?
                  Or am handling it improperly?

                  Comment


                  • #10
                    supersoup
                    I just repeated the same steps you outlined and it saves the file as a compressed folder named esignal_stoch
                    Double clicking on the folder then opens it and double clicking on the eSignal StochRSI file contained therein opens the file in Excel
                    Try opening it online instead of saving it [this method also works at my end]
                    Alex


                    Originally posted by supersoup
                    I clicked the link
                    Selected Save File and clicked Ok
                    The file is saved into my download folder as "esignal" with no extension (not .xls or .zip).
                    If i try sending it to a compressed (zipped) folder and try unzipping it, it asks for a password.

                    Maybe I didnt download it properly?
                    Or am handling it improperly?

                    Comment

                    Working...
                    X