New Members: Be sure to confirm your email address by clicking on the link that was sent to your email inbox. You will not be able to post messages until you click that link.

RSI scan

Hi Markd and everyone

I was wondering if it is possible to write a scan code for the followings:

1. Let's say RSI(14) has been below 40 once or twice or more for the last 6 months (long term) and has been fluctuating below 60 but never exceed 60. Then RSI then trends up above 60.

I'm not sure if this is clear with what I can to write a code for. But is it possible to write a scan code for the above ?

Thanks in advance.

Best Answers

  • markdmarkd mod
    Answer ✓
    Usually, patterns vary enough that they are very hard to capture in code, which has to be pretty specific. No matter what you write, you may capture some instances, but you will miss others that your eye tells you fit the pattern.

    For a (fairly) simple approach, you could do something like RSI x 60 today and 1 day ago max RSI for some number of days was below 60, and then test for min RSI over some number of days was below 40. You'll get junk that doesn't fit what you are looking for, but at least some that do fit.

    If you want to get more complicated, you have specify the time period(s) in which RSI was between 40 and 60, and the time period(s) when it went below 40. That's likely to vary at least somewhat from stock to stock, so its hard to code for it.

    I don't see any logical reason why this pattern should predict a rise. It may appear in a large number of charts, but that is likely because many stocks trade alike with their sector or the general market, not because it says something about the state of supply and demand that precedes a good gain. If you have found this pattern in other markets - say in 2012 or 2015 (to pick random years), it might have predictive value. But, it might be more productive to just test for an initial breakout above 60 after a long period below 60.
  • AndytAndyt
    Answer ✓
    Hi Markd

    I have observed for some stocks, when their RSI reach below 40 and then rebound above 60, that is the beginning of a new uptrend. I was thinking that RSI might provide clue on the trend direction once above 60. Oh, well, I guess it was not as simple as what I thought.


  • markdmarkd mod
    edited August 2017

    Your could try something like this (play with the parameters) and test it over some random dates from the past:

    [group is sp500]
    and [rsi(14) > 60]
    and [1 days ago max(21, RSI(14)) < 60]
    and [min(21, RSI(14)) < 40]
Sign In or Register to comment.