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.

Relative strength

Hello, I need a scanner as in the image attached.
Conditions
Spx 500 Falls more than 5% in 10-days ,but the stock felt less than 5% in the same period which shows that stock is exhibiting Relative Strength . Please if anyone guide me how to scan for such condition .

Thank you

Comments

  • I think you probably should set this up as an Alert (or Scheduled Scan) for the SPX FALLS condition. Then when the Alert is triggered, run the "FALLS LESS" scan.

    The Alert (or Scheduled Scan) code for the SPX condition could be

    [symbol = '$SPX']
    and [ROC(10) <= -5.0]

    This would trigger the Alert when the 10 day Rate of Change is less than or equal to -5%
    If run as a Scheduled Scan, the results would show "No data available in table" if the scan resulted in the condition not being met.

    Looking at the ROC10 on the $SPX chart and putting a horizontal line Overlay at -5 shows this doesn't happen too often in the past year.

    <img src="https://us.v-cdn.net/5022108/uploads/editor/sj/8xy4h3lb085h.png" alt="" />

    So once the Alert is triggered, or Scheduled Scan produces a result, you could run your "Falls less" scan

    StockCharts.com has a PctRelative function in the workbench in the TECHNICAL INDICATORS dropdown.

    PctRelative defaults into the workbench like this:

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

    It's asking for the percent change relative to the $spx in the last 20 days to be greater than 0. So if the $SPX went down 5% the symbols returned by this parameter would have gone down less than the $SPX.

    As you are looking for the 10 day threshold, you would change the 20 to 10.

    I'd also suggest changing the > 0 to be a much higher level as a securitiy that went down 4.999 percent vs the $SPX down 5.0% has a PctRelative > 0

    Below is a possible sample to "combine" both requirements into a single scan. You have a Part 1 to find the FALLS part and a Part 2 to find the FALLS LESS part.


    //FALLS LESS Scan or Alert

    //Part 1 FALLS
    //Remove the // from in front of the 2 lines after Begin Part 1 to run the FALLS part of the scan

    // Begin Part 1 FALLS
    [symbol = '$SPX']
    and [ROC(10) <= -5.0]
    // End Part 1 FALLS


    //Part 2 FALLS LESS
    // Add // in front of the Part 1 FALLS lines. Remove the // from in front of the 2 lines after Begin Part 2 to run the FALLS LESS part of the scan

    // Begin Part 2 FALLS LESS
    //[[group is NASDAQ100] or [group is SP500]]
    //and [PctRelative(10,$spx) > 3]
    // End Part 2 FALLS LESS

    //Optional Rank By to put results in PctRelative order
    rank by [PctRelative(10,$spx)]









  • Thank you Imkwin for guiding me through the querry , How is PctRelative calculated can you share the formula
  • It appears that terrorists (i.e. "The Team") have attacked the ChartSchool and the search function so I can't give you their definition on PctRelative, but... from my understanding is it takes the Percentage change of the security X and the percentage change for the comparison symbol Y, for the period you specify in the parameter and then assigns a value of X-Y for the difference.

    rank by [PctRelative(10,$spx)]

    This would calculate the 10 day Percentage change of the symbol and the 10 day percentage change for the $SPX and subtract the SPX % change from the symbol % change. The resulting value would be a positive number if the symbol had a higher 10 day percentage change. The value would be a negative number if the symbol had a lower 10 percentage change than $SPX
Sign In or Register to comment.