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.

Near 50 Days Crossover above 200

I'm trying hard to scan to find the stocks which are near to 50 days crossing above 200 days close. Any suggestions where i'm wrong ? please.

AND [market cap > 30] and [market cap < 300]
AND [Daily SMA(20,Daily Volume) > 25000]
//and [PctDiff(close,SMA(50,close)) >= -10]
//and [PctDiff(close,SMA(200,close)) >= 10]]
AND [Daily SMA(50,Daily Close) > Daily SMA(200,Daily Close)]
AND [Yesterday's Daily SMA(50,Daily Close) <= Yesterday's Daily SMA(200,Daily Close)]


  • markdmarkd mod
    edited March 2021
    and [PctDiff(close,SMA(200,close)) >= 10]]

    I think you want this to be less than <=, not greater than >=

    Also, I don't think you want the crossover (last two lines) AND the proximity test together in the same scan, if that is what you are doing. (In other words, to get the 50 near the 200, comment out the last two lines after making the operator change suggested here.)
  • edited March 2021
    Thanks for your update Mark.

    I've tried this but actually 50 day MA is always cutting down 200MA with below code . But actually i'm looking 50 day moving very close to 200 and planning to take over 200 DMA. Can you please suggest what am i doing wrong ?

    Appreciate your help.

    [ [type is Stock]
    AND [[exchange is NASDAQ] or [exchange is NYSE] or [exchange is PINK] or [exchange is TSXV] or [exchange is TSE]]
    AND [name not contains 'ETF']
    AND [name not contains 'ETN']
    AND [name not contains 'Fund']
    AND [name not contains 'iShares']
    AND [market cap > 30] and [market cap < 300]
    AND [Daily SMA(20,Daily Volume) > 25000]
    //and [PctDiff(close,SMA(50,close)) <= 2]]
    and [PctDiff(close,SMA(200,close)) <= 10]]
    //AND [Close > Daily SMA(200,Daily Close)]]
    //AND [Yesterday's Daily SMA(50,Daily Close) <= Yesterday's Daily SMA(200,Daily Close)]]
  • Try this:

    and [sma(50,close) > 20 days ago sma(50, close)] // MA 50 rising

    and [sma(50, close) < sma(200, close)] // MA 50 below MA 200

    and [sma(50, close) > sma(200, close) * .98] // MA 50 within 2 per cent of MA 200

    But remember, this is a fairly rare condition. A valid (syntactically and logically correct) scan can still get no or few results if the market is not compatible (e.g. stocks have already passed the stage you are testing for, or haven't got there yet).

    But I think the conditions that are missing in your code is MA 50 rising and below the 200.

    If you get too many results, or don't like the ones you get, you could also test for MA 200 falling - i.e., less than, say, 50 days ago. This would be a set up for a "golden cross".

    No matter how specific you are, some results will not be what you are looking for. Don't worry about those, as long as you get enough "good" hits.
  • edited April 2021
    Thanks Mark!! appreciated your help this works and let me dig a bit more with few conditions.
  • A method that is used by some professional technical analysts is to look for shorter term moving averages for indications. Golden Crosses are not the best patterns for moving into or out of a trend. So instead of looking for the 50 to be close to crossing, look at a shorter moving average to be crossing. Arthur Hill might have suggested using the 5 and the 200. In the ChartSchool section on Moving Averages the suggested scan has the 5 and 35.

    Stan Weinstein used the 30 week to make the call of bullish or not, in addition to stage analysis.
  • markdmarkd mod
    edited April 2021
    Well, the only definitive thing you can say about technical analysis is, there is nothing definitive about technical analysis.

    While I agree generally with the idea that shorter MA crosses will get you in sooner, they will also give you more false positives. A stock going into a long trend will pass every shorter MA cross test before the golden cross. But many stocks will pass the shorter MA tests and not get to the golden cross, or not develop into longer trends. The golden cross filters out most of those and should leave a higher percentage of stocks that will develop longer trends (assuming a generally trend-favorable market).

    The trade off is always the same - the longer you wait for more information, the smaller, but more likely, your profit will be. Whereas, if you act with less information, your winning trades will be larger but fewer, and your profits are reduced by your more frequent losses, or, even if you don't lose money on a trade that doesn't develop into a trend, there is an opportunity cost - the money tied up in the under-performer isn't available for the better profits in the winners.
  • Mark,

    Yes , agree let me give couple of examples . I'm just learning so i hope you bear with me please.

    MMMB i'm an investor this in this company , there was a golden cross 9th Feb 2021 . Also , the ALTO stock on 29th June 2020 with the above code i couldn't pull these names when i go back and search. I'm actually validating the above code to see if i'm doing correctly but there is something wrong for sure. Can you please guide.

  • markdmarkd mod
    edited April 2021
    MMMB - A golden cross occurred in November 2019 - a golden cross is the rising MA 50 crossing above the (usually still) falling MA 200 from below.

    In February 2021, the falling MA 50 approached (but did not cross) the rising MA 200, and then turned up again. It turns out that was a good entry, but it was not a golden cross. It was a price test (not a 50 MA test) of the rising MA 200.

    If you want to scan for MA 200 tests -

    and [sma(200, close) > 50 days ago sma(200, close)] // MA 200 is rising

    and [sma(200, close) x close] // close crosses below MA 200 (the code actually says, MA 200 crosses above close, but its the same thing)

    ALTO - this does become a golden cross.
    ALTO first shows up with the above code on June 24, 2020. MA 50 is 0.53 cents, MA 200 is 0.54 cents. This is just before the golden cross.

    On June 25, ALTO does NOT show up on the scan because MA 50 is 0.54, and MA 200 is 0.54 - so they are equal - but our code asks for MA 50 less than the MA 200, so ALTO doesn't show up.

    On June 26, MA 50 is 0.55 and MA 200 is still 0.54, so the crossover occurred June 26, not June 29. This doesn't show up on the scan again because the MA 50 is not less than the MA 200 anymore.

    (Note - you can get the indicator values to for a specific date to verify a scan from the chart. If you use "Start/End" for chart duration, indicator values will be for the "end" date you enter.)

    (Note: I did not use any symbol-related conditions except [exchange is NASD] - no requirements for price, market cap, etc. A quirk of the scanner is, some symbol conditions are as of TODAY - not the date you scan for in the past - so for instance, ALTO might be worth more than 300 M today, even though it might not have been worth < 300 M in June 2020. It wouldn't show up in your scan if its market cap today is > 300 M)

  • Thanks Mark!! this was far better to understand further.
Sign In or Register to comment.