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.

Long Term Performance

How do you write a scan that ranks the S&P 500 stocks from top to bottom by their percentage gain over a 10 year period?

Comments

  • lmkwinlmkwin ✭✭
    In the workbench, select the SP500 from the Indexes and ETFs dropdown. Add it to your blank workbench.

    Then select the PctChange from the Technical Indicators dropdown. Add it.

    It will appear with an AND in front of it.

    and [PctChange(10,close) > 10]

    To use it as a Rank By statement you remove the AND and replace it with Rank by

    Change the PctChange values to be what you want them to be.

    Rank by [weekly PctChange(520,weekly close)]

    The end of the results list are stocks that are IN the SP500 but have not been around for 10 full years.

    There is a wealth of information in the Help on StockCharts using the Search function. There is also a wealth of information on this forum using the Search. Type in Rank By or PctChange for a lot of information that is very useful in the Search.

    https://support.stockcharts.com/doku.php?id=scans:advanced_scan_syntax:pctchange_scans

    https://support.stockcharts.com/doku.php?id=scans:advanced_scan_syntax
Sign In or Register to comment.