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.

3 Consecutive Week Scan - Is this correct?

Does this look right? I'm new to scanning, but what I'm trying to do is uncover any stocks (in my chart list) to see if their price has been under the SMA(10) for three weeks in a row. This seems to pull the correct results, but I just want to make sure I've set this up correctly for what I'm trying to achieve. Thanks!

[favorites list is 1] // Current Holdings
and [WEEKLY CLOSE < 1 week ago WEEKLY SMA(10,close) ]
and [WEEKLY CLOSE < 2 weeks ago WEEKLY SMA(10,close) ]
and [WEEKLY CLOSE < 3 weeks ago WEEKLY SMA(10,close) ]

Comments

  • markdmarkd ✭✭✭
    As you have it, you are testing whether this week's weekly close is less than the three weekly MA values preceding the current week.

    // the line below says, is this week's weekly close less than the sma value from 1 week ago
    // NOT the current week's sma value, the one prior to it

    and [WEEKLY CLOSE < 1 week ago WEEKLY SMA(10,close) ]

    // the next line says, is this week's weekly close less than the sma value from 2 weeks ago,
    // meaning the second prior value from this week's sma value

    and [WEEKLY CLOSE < 2 weeks ago WEEKLY SMA(10,close) ]

    // this says, is this week's weekly close less than the sma value from 3 weeks ago
    // so the fourth value back in the sma if the current week is the first value

    and [WEEKLY CLOSE < 3 weeks ago WEEKLY SMA(10,close) ]

    If you want to look at the close of each of the most recent 3 weeks' closes, starting with the most recent completed week, vs. the sma for each week, it would look like this:

    // the most recent weekly close is less than the most recent sma

    and [weekly close < weekly sma(10, weekly close)]

    // last weeks close was below last week's sma

    and [1 week ago weekly close < 1 week ago sma(10, weekly close)]

    // the third week back, counting this week as week 1, was below the sma that week

    and [2 weeks ago weekly close < 2 weeks ago sma(10, weekly close)]

    NOTE: you need "weekly" in front of close inside the sma( ) expression, otherwise the scan engine calculates the DAILY sma by default.

    Note, too, that this scan does not look at whether the fourth week back was above or below its sma, so the scan will find symbols that have AT LEAST 3 closes below the sma - could be four, or six or ten or more. If you want to limit the scan to 3 closes below the sma, test the fourth week back (3 weeks ago close) for a value greater than the corresponding sma.


  • Okay, that makes perfect sense now. I really appreciate the help!
Sign In or Register to comment.