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.

Advice for scans: This week's low above SMA

Hi,

I'm quite new at the scans and still learning. I am building a scan that will let me know when a weekly stock's low has gone above an SMA. The expression I used is:
[Last week's Low <= SMA(10,close)] and [This week's Low > SMA(10,close)]

For some reason, the results don't match my criteria, all the prices are below the SMA, so I'm pretty sure I'm doing something wrong, but I can't see what it is. What do you guys think?

Here's the full expression:

[type = stock] AND [Daily SMA(10,Daily Volume) > 20000]
and [Last week's Low <= SMA(10)]
and [This week's Low > SMA(10)]

Thanks!

Comments

  • Your scan is mixing time frames. So it's asking for the weekly low to cross above the daily MA.

    If you don't place a time frame modifier in front of a value, like an indicator or overlay or price, the scan engine assumes you mean "daily" and looks at daily data to retrieve values for testing your condition.

    Also, if you have any parameter values in your indicator or overlay expressed in text, like "close", you have to include a time frame modifier there, too (daily, weekly, monthly).

    In your case, you are using an SMA without specifying the value to be averaged. When you do that, the scan engine assumes you mean you want to average the close. When you change time frames, it's best to write out what you mean (sometimes you don't have to, but it's better to be explicit, so you always know exactly what should be happening). So, your scan would be:

    [type = stock] AND [Daily SMA(10,Daily Volume) > 20000]
    and [1 week ago weekly Low <= 1 week ago weekly SMA(10, weekly close)]
    and [weekly Low > weekly SMA(10, weekly close)]

    Another way to write this is to use the "cross above" operator, which is "x". So,

    [type = stock] AND [Daily SMA(10,Daily Volume) > 20000]
    and [ weekly low x weekly sma(10, weekly close)]

    NOTE the weekly sma 10 is roughly equal to daily sma 50 - it won't be exactly equal because the weekly is averaging only 10 prices, while the daily is averaging 50 prices. Different data will give you different results, even though they cover the same calendar time period.
  • One more note: if you run a weekly time frame scan, you should probably run it as of the prior Friday (or last day of the week if a holiday). Otherwise, the scan engine may be using data from the current, incomplete week. I'm not 100% sure of that, but running it as of the last day of the prior week guarantees you are getting accurate results.
  • Thanks a lot markd.

    I will change my scan and take note for my future scans.
  • Hi again markd and all,

    I just tried the scan with the x operator and somehow, it showed me stocks which low did not cross over the SMA. one example is AAC.

    I used exactly what you wrote (copy and pasted it)

    Do you have any idea why?
  • I don't get AAC in the results.

    If you like, post your entire scan and I'll check it out.
Sign In or Register to comment.