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.

What's the Difference

[ type = stock] and [country is US] AND [Daily SMA(20,Daily Volume) > 40000]
and[high < 20 days ago max(20,high)]
and [MACD Line(12,26,9) > 20 days ago MACD Line(12,26,9)]
and [ATR(14) > 1.5]

and these ..
[ type = stock] and [country is US] AND [Daily SMA(20,Daily Volume) > 40000]
and[high < yesterdays max(20,high)]
and [MACD Line(12,26,9) > 20 days ago MACD Line(12,26,9)]
and [ATR(14) > 1.5]

I am not getting the same results..

Comments

  • The latter part gives me higher highs 20 days ago..
  • '20 days ago max 20 high' looks at the prior twenty bars beginning twenty days ago.

    'yesterday's max 20 high' looks at the prior twenty bars beginning yesterday.
  • edited July 2019
    Markd, but I am getting a much higher highs way above 19 days ago begining yesterdays price like more than $10 bucks higher ..it just doesn't make sense..
  • Markd, thanks for your feedback. I think I know why I am getting way higher highs is because it has to satisfy the MACD condition too.
  • I wonder how scanning only the high condition is confirm and the MACD condition is still going higher instead...
  • Markd, is there a way to scan for both condition High and MACD to be true?
  • Maybe you could post a chart that shows what you want.
  • edited July 2019
    Markd, please check the link. The High at 54.75 is higher then the todays high of 51.08, so we are going down on price high, but the corresponding MACD is going higher ... This tells me to short this stock. Sorry don't know how to insert a charts.Hope this helps
  • edited July 2019

    Okay as shown below

  • Chart is enclosed, I figured it out after all


  • MACD Line plots the difference between ema 26 and ema 12. When ema 12 is above 26, MACD Line is above 0. When MACD 12 is below 26, MACD Line is below 0.

    When MACD Line is above 0, and prices rise quickly, MACD Line rises because ema12 moves faster than ema26, so the distance between them increases (see January). When prices slow down, ema12 slows down faster than ema26, so the distance between them DECREASES, so MACD Line falls (February).

    When MACD Line is below zero, the opposite is true. When prices fall quickly, ema12 falls faster, so it moves away from ema26 (May), so MACD Line falls. But when prices fall more slowly, ema 12 slows down faster than ema26, so ema12 APPROACHES ema26, making the distance between them shorter, so MACD Line RISES.

  • Thanks Markd, I was hoping to be able to scan for this 2 conditions only..instead of getting more than 300 hits to narrow it down somewhat because this conditions does not happen often. Normally the MACD follows what price is doing and when it does not we have a Divergence.
  • lmkwinlmkwin ✭✭
    The code below combines the two requirements. It has to satisfy the 1st set AND the 2nd set.
    Note the 2nd set of brackets on each group.
    If I run this on market caps between 300 and 8500 I only get 58 results ALRM is one of them.


    and [[high < 20 days ago max(20,high)]
    and [MACD Line(12,26,9) > 20 days ago MACD Line(12,26,9)]
    and [ATR(14) > 1.5]]

    and

    [[high < yesterdays max(20,high)]
    and [MACD Line(12,26,9) > 20 days ago MACD Line(12,26,9)]
    and [ATR(14) > 1.5]]
  • Imkwin, thanks a lot. These is what I want. You're a gentleman and a scholar...
  • lmkwinlmkwin ✭✭
    Once you get a knack for building scans, it opens up a whole new world of opportunities. Of course, some opportunities are better than others. Some are really bad opportunities. But, using logic and the tools you can, pretty much, define most any technical situation.

    I also like that you can back date your scans for "testing". It's definitely worth the effort to test your scans. What is working now, may not be what was working last week, or last month, or last quarter, or year or.... maybe it was.
Sign In or Register to comment.