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.

Kevin

Pretty green here, want to scan for a weekly MACD Histogram below zero line and rising for possible buys, also want to scan for MACD Histogram above the zero line and falling for sell signals, appreciate any help. Not sure this is possible ?

Comments

  • markdmarkd mod
    edited June 14
    Histogram above or below zero is pretty simple, e.g. just use the greater than operator ">" or less than operator "<", like MACD Hist(...) > 0.

    To see if an indicator is rising or falling, you have to compare the current value to a past value. To get the past value, you need a modifier in front of the indicator like "2 days ago", so, 2 day ago MACD Hist(...). If the past value is less than the current value, the indicator is rising.

    You can build scans from the advanced editor. As you type, it makes suggestions, which you can select or edit. Or, you can make selections from the drop downs under the scan window on the scan workbench and edit them.

    If you need a primer to get started:

    https://stockcharts.com/docs/doku.php?id=scans

    Or, you could look at the pre-defined scan code. Here's how:

    Find "Pre-defined Scans" link on the Members Page in the "Members Tools" section (scroll down)

    On the Pre-defined Scans page, click on any number in the first column.

    On the results page, click on "Click here to edit this scan" in the upper right corner of the page.
  • lmkwinlmkwin ✭✭
    @Kevin. Pretty much everything is possible. I've only encountered a few things that aren't.

    This board has been very helpful (markd and gord in particular) to assisting with issues I've encountered. Posting what you have for your scan so far, provides the best results.
  • Thanks for the help !
  • markd, Thank you !
  • KevinKevin
    edited June 16
    Markd, please look at this, I think I'm close. Trying to find positions w/ a MACD below 0 but improving, all are weekly charts ?
    [weekly macd hist (12,26,9)<0]
    and [weekly macd hist (12,26,9)>1 day ago wekly macd hist (12,26,9)]
  • markdmarkd mod
    edited June 17
    A correction in the second line. I think you want to compare this week's Hist to last week's Hist.

    [weekly macd hist (12,26,9)<0]
    and [weekly macd hist (12,26,9)>1 week ago weekly macd hist (12,26,9)]

    Keep in mind that the current value for a weekly indicator changes each day of the week. So one day, this week's value could be above last week's value, but the next day it could be below last week's value. That could be OK, as long as you know what's happening. In general, to get a "valid" signal, you should wait for the time frame to expire before scanning - so, in a daily time frame, scan after the day's close; in a weekly time frame, wait for the Friday close; in a monthly scan, wait for the close of the last trading day of the month.

    Also, keep in mind that Hist is not the same as MACD Line. Hist measures the difference between MACD Line and MACD Signal. MACD Line measures the difference between the two emas you designate in the parameters . So, Line could be rising, but Hist could drop. So you might want to use MACD Line instead of Hist. Try it both ways and see. Also, you might want to try different look backs - maybe 3 weeks or 5 weeks instead of one. The longer look back may be more likely to get trends that will continue on. The shorter lookback could give you an earlier signal, but there will be more "false positives".
  • markd- Thank you for the help
Sign In or Register to comment.