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 for an upturn of the 50 week SMA

So what I want to do is scan for stocks that have their 50 week SMA turn up. Obviously this downturn is going to end at some point and this is how I determine when it has ended.

So what I have so far is this:
[Weekly SMA(50,Close) > Last Week SMA(50,Close)]
and [Weekly SMA(50,Close) > 3 Weeks ago SMA(50,Close)]

But this does not seem to work. I basically want it to look for stocks that have been turning up for a few weeks just to be sure. When I used this one I got some stocks back that still had declining 50 week SMA's. I am thinking this is because the way it is set right now it is looking at daily SMA instead of weekly somehow?

Akroma

Comments

  • markdmarkd mod
    edited September 2015
    this seems to work:

    [ weekly SMA(50,weekly Close) > 1 week ago weekly SMA(50,weekly Close)]
    and [ weekly SMA(50,weekly Close) < 3 Weeks ago weekly SMA(50,weekly Close)]

    but a couple of notes:

    make sure you run the scan from a Friday date; then, when you review the results, make sure you adjust the dates so the chart ends on the same Friday that you scanned for.

    also a suggestion: - widen the gap between the two tests, maybe 5 or ten weeks ago vs just 3.

    also, maybe use a 50 day average turning up instead of a 50 week? or maybe 50 day crossing above 200 day? nothing's perfect, so those are just suggestions.
  • Thanks for your response!

    The 50 day is too volatile but a 200 day might work. I initially wanted to do a 12 month one but that would mean I have to wait till the end of the month so it would be too slow. If I use the 200 day I could indeed use the wider gap of say 10 days (or a little more if that filters out more whipsaws). I am not a fan of the MA crossover since they tend to take too long and still whipsaw quite a bit.

    Btw: 1 week ago weekly SMA this gives me an error for the weekly SMA part. Should it be: [SMA(50,weekly Close) > 1 week ago SMA(50,weekly Close)] ?? Since your current syntax basically seems to say weekly 2x.

    Not that it matters if I decide to use the 200 day (which I probably will), but for the sake of completion?
  • markdmarkd mod
    edited September 2015
    I don't get an error for that. But my actual test scan was:

    [group is sp500]
    and [ weekly SMA(50,weekly Close) > 1 week ago weekly SMA(50,weekly Close)]
    and [ weekly SMA(50,weekly Close) < 3 Weeks ago weekly SMA(50,weekly Close)]

    So there was an "and" in front of that phrase.

    I don't know why that should make a difference.

    Also, I tried two versions of the scan, one with "weekly" preceding "SMA", and one without. Both versions pass syntax, but give different results.

    If you set the calendar to Friday, August 14, it returns one hit, ADSK when "weekly" is included, but no hits without "weekly".

    ADSK appears to be a valid hit, so I think the "weekly" version is the better one.

    I didn't have time to look in the Instructions documentation (see link at bottom of advanced scan page) to see if there is something about how to modify functions like sma() for different time frames.
  • I will try this later today. I will also try the opposite (MA turning down)
  • I am using this one now:
    [SMA(200,close) > yesterday SMA(200,close)]
    and [yesterday SMA(200,close) > 10 days ago SMA(200,close)]
    and [SMA(200,close) < 40 days ago SMA(200,close)]

    And it seems to work so thanks!
Sign In or Register to comment.