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.

Scanning the 50SMA and 50SMA RS line

I need help with how to Scan for symbols in my chartlist where price is above the 50SMA and RS Line vs $SPX is above a 50SMA line. Any help is appreciated. Thx!

Best Answer

  • markdmarkd mod
    Answer ✓
    Unfortunately, you cannot scan for the RS line.

    You can work around it though by including $SPX as a symbol in your chart list, then run a scan on the list with with your conditions (e.g. close > sma(50,close) and then a rank by statement like

    rank by PctChange(50, close)

    Symbols doing better than the $SPX (up more or down less over the last 50 days) will rank above it in the results list. Not exactly the same thing, but maybe useful. When you save the list, save the order.

    If your chart style includes $SYMBOL:$SPX you can check the results.


  • Great to know. Thanks markd!
  • would it be possible to use a condition like the following?

    close/close($SPX) > sma( 50, close/close($SPX) )
  • Good idea, but the scan engine cannot interpret "close($SPX)".

    It can only interpret indicators (and overlays) that are specifically coded for scan engine to read, like MACD, Bollinger Bands, etc.

    Basically, if you can't find it in the drop downs under the scan window, the scan engine doesn't know what to do with it.
  • lmkwinlmkwin ✭✭
    edited May 20
    Here's a "quick" way to review your chartlists in Relative Strength order. When you view your chartlist it defaults to Summary view. At the top of the list there is a VIEW LIST AS drop down. Select Performance.

    Performance will show your list with a number of predefined columns for different periods of performance.

    You can add a symbol into the Compare To box at the top of the view and click Go.

    This will add that symbol the chartlist symbols with a colon between the symbols. It updates the Performance based on the relationship as well. You can then see the result and sort if desired. You can also then highlight the list to copy and then paste it into excel. Then copy and paste the symbols into a chartlist and you will have a RS list of your chartlist if desired. So you could copy the RS symbols into your existing list and then you will have both the symbol and the RS symbol in the list for example. You CAN review that RS list in Summary and CandleGlance and it should be able to sort there also.

    You CAN NOT scan against the RS symbols in the list as the RS symbols are NOT in the database. It is just a quick way to see RS vs whatever you would like to see.

    To remove the Compare To symbol from the Performance view, delete the symbol and hit Enter on your keyboard. Blanking it and clicking "Go" will not remove it.

    In the Scan engine there is a PctRelative function in the Technical Indicators dropdown.

    Defaults in like this

    and [PctRelative(20,$spx) > 0]

    This is asking for symbols that have a 20 day return vs the $spx that is greater than 0. Play around with this. Unfortunately you can't use a moving average on this function but you can do a comparison against a prior period.

    So you can try

    and [PctRelative(20,$spx) > 0] and [20 days ago PctRelative(20,$spx) < 0]

  • I welcome the Day, when Stockcharts allows Performance {Sorting} on Scans, and not just Chartlists
  • Wouldn't Have to make 2 Sets of Everything then.
  • lmkwinlmkwin ✭✭
    If you use a Rank By statement in your scan it will sort the results in the order of the Rank By statement.

    You can use Performance, for example

    Rank By [PctChange(10,close)]
    Rank By [PctRelative(20,$spx)]
    Rank By [PctRelative(20,$Industry)]

    You can use other ticker properties

    Rank By [yield]
    Rank By [market cap]

    You can use Indicators

    rank by [DistFromSMA(200)]
    rank by [PPO Line(12,26,9)]

    The Rank By will provide the data as the last column of the scan results and sort the returned results list in descending order by default.

    Arthur Hill recently shared an indicator that he has been testing called Normalized ROC. He takes the price difference value and divides that by the ATR. This then expresses the Rate of Change, which is a percentage based indicator, as percent of ATR (dollar) movements.

    //Arthur Hill Normalized ROC
    rank by [[Close - 200 days ago Close] / ATR(20)]

    Of course, all of the parameters above can be modified to meet your requirements, whether it's performance related or other data. Only real 'rules' for Rank By is that it is the last line of the scan. No AND in front of the line.

    Other considerations is that it sometimes doesn't like complex math. If you don't see the Rank By value as the last column of the scan results, or it looks off, there is an issue with the rank by statement. Most common is leaving the default code in place.

    Example. When you want to rank by PPO Line you add that from the drop down it defaults in like this.

    and [PPO Line(12,26,9) > 0.0]

    I replace the AND with Rank By

    rank by [PPO Line(12,26,9) > 0.0]

    This will put zeros in the rank by column. You need to remove the > 0.0 and the Line value will be shown.

    rank by [PPO Line(12,26,9)]

Sign In or Register to comment.