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.

Monthly MACD Scan

I am trying to create a scan for stocks that their Monthly MACD has turned bullish today and was bearish yesterday.

I tried the following formula but it didn't work; can you please help?

[Monthly MACD Line(12,26,9,Today's Close) >= Monthly MACD Signal(12,26,9,Today's Close)] AND
[Monthly MACD Line(12,26,9,Yesterday's Close) <= Monthly MACD Signal(12,26,9,Yesterday's Close)]


  • markdmarkd mod
    edited May 2017
    @Mason I'm guessing when you say bullish, you mean that MACD Line crossed above MACD Signal - in your case in the monthly time frame.

    So, the operator "cross above" is "x". This operator takes care of comparing values in the prior bar to the current bar, so you don't have to write it out.

    So a bullish crossover would be

    [group is SP500]
    and [monthly MACD Line(12,26,9) x monthly MACD Signal(12,26,9)]

    This gets 16 hits after the market close on 5/18/17.

    However, the month is not over yet. So, if you run this scan on the last day of the month after the market close, you will very likely get a different result (you probably know this already, but for others...). Some stocks hit today may stay "crossed over", some may not. And when you run the scan on the last day of the month, there may be some hits that do not appear for today's scan. The consequence of this is that if your method depends on a crossover signal from monthly MACD, a crossover that appears to occur mid-month, is not really a signal unless it holds up until the end of the month.

    If you run the scan on a day other than the last day of the chosen time frame, the scan engine considers the most recent update (end of day or intraday) as the close for that time frame, even though it isn't the "real" close.

    So, whenever you run a scan in a time frame other than daily, you will only get "accurate" results if you run the scan as of the last day in the chosen time frame - e.g. last day of the week, last day of the month, last day of the quarter or year. So in your case, you could run the scan as of the last day of the prior month.

    (Note: if you run a daily time frame scan when the market is still open, the same rules apply - the scan is "accurate" only after the market close).

  • I think the mistake may be in in line 1: [Monthly MACD Line(12,26,9,Today's Close) >= Monthly MACD Signal(12,26,9,Today's Close)] : Todays should be > than yesterday's, not >= than yesterdays. It should be cleanly > today, but less than or equal yesterday. That's how the MA crossovers generated by the system work. Let me know if that is correct.
Sign In or Register to comment.