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.

Merging

[type = stock] AND [country = US] AND [Daily EMA(20, Daily Volume) > 250000]
// and [SCTR > 90]
AND [Daily EMA(20,Daily Close) > 10]
AND [Daily EMA(20, Daily Close) x Daily EMA(200,Daily Close)]
AND [Daily CCI(14) crosses 0] or [Daily CCI(14) crosses -100]
and [MACD signal (12,26,18) crosses MACD line (12,26,18)]

Question

Is it possible to combine the scans to produce a list of stocks that are at the confluence of Price line at or just below the 20 ema, CCI 14 crossing the zero line or moving off -100, and the MACD line crossing the signal line?

thanks in advance
Quill

Best Answers

  • markdmarkd mod
    edited May 2016 Answer ✓
    @Quill , sorry, should have said "greater than", meaning ">" (without the quotes) rather than "above". So,

    and [MACD Line(12,26,18) > MACD Signal (12,26,18)]

    Then for CCI:

    and [[Daily CCI(14) > -100] or [Daily CCI(14) > 0]]
  • markdmarkd mod
    edited May 2016 Answer ✓
    Thanks for the kind words. Glad it worked out for you!

Answers

  • markdmarkd mod
    edited May 2016
    I'm not sure what you mean by "at the confluence of Price line".

    For "just below the 20 ema", you need to choose what "just below" means in a way that can be expressed mathematically. Should it be some per cent below, like 1 per cent, or some number of pennies or points below, say .25 or 3.00?

    The crossing operator is "x" which means the first term crosses above the second.

    and [term1 x term2]

    so,

    and [CCI(14) x 0]

    If you have conditions that must be met, the condition must begin with "and" (unless it is the very first statement).

    If you have a list of conditions where at least one must be true, but it doesn't matter which one, then you precede that list with "and" and an opening bracket "[".

    Then each condition in the list, except the first, begins with "or".

    After you have listed all the conditions, you need a closing bracket "]"

    So,

    // begin scan

    [condition 1] // must be true

    and [condition 2] // must be true

    and

    [

    [condition 3] // at least one condition - 3, 4, or 5 - must be true

    or [condition 4]

    or [condition 5]

    ]

    // end scan

    Let me know if that helps. If you get stuck, post what you've updated.

  • Confused more than ever. Not a programmer by any means.

    Quill -
  • markdmarkd mod
    edited May 2016
    OK. Sorry that didn't help.

    We can go line by line if you want.

    What does this mean?

    "at the confluence of Price line at or just below the 20 ema"

    Maybe if you say it another way I'll get it.

    Or post a link to a chart, or a screen capture that's a good example.

    Or maybe all you need to do is put an extra pair of brackets around the CCI line, like this?:

    AND [ [Daily CCI(14) crosses 0] or [Daily CCI(14) crosses -100] ]
  • Markd,

    OK, here we go on the journey.

    Confluence = an act or process of merging.

    http://stockcharts.com/h-sc/ui?s=TLT&p=D&yr=0&mn=4&dy=0&id=p13997453254 jumped over today.

    First phase:

    Trying to find stocks that stop short before crossing up and over the 20 ema by about 25 cents. It is like hitting the yellow pause button. The following morning or an hour later pull the trigger in beating the crowd in getting a better price.

    Price line to be at the 20 ema but just short by about 25 cents or 1 or 2% could work.

    The following scan is the 20 ema and up and the rest of the scans I use separately.

    Scan 60 - 20 ema price crossover Up and over

    [type = stock] AND [COUNTRY = US]
    //and [SCTR > 90]
    AND [Daily Volume > 500000]
    AND [Daily Close > 10]
    and[Yesterdays close <= Yesterdays EMA(20)]
    and [Todays close > Todays EMA(20)]

    - - - - - -
    Scan 18-AAA Long MACD 12 26 Line xover MACD 12 26 Signal

    [type = stock] AND [COUNTRY = US]
    //and [SCTR > 90]
    and [MACD Line(12,26,18) crosses MACD Signal (12,26,18)]
    AND [Daily Volume > 500000]
    AND [Daily Close > 10]
    - - - - - - -

    Scan 11A - CCI Bullish (crossing above -100)

    [type = stock] AND [country = US]

    //and [SCTR > 90]
    and [Daily EMA(5,Daily Volume) > 500000]
    and [Daily EMA(20,Daily Close) > 10]
    and [Daily CCI(14) crosses -100]

    or

    Scan 11 - CCI Bullish (crossing above 0)

    [type = stock] AND [country = US] AND [Daily EMA(20,Daily Volume) > 500000]
    //and [SCTR > 90]
    and [Daily EMA(20,Daily Close) > 10] AND [Daily CCI(14) crosses 0]

    - - - - - - -
    Hope this can be of some assistance.

    Best regards,

    Quill -
  • OK, here's a shot at it.

    I think for the close near but under the ema 20, you can use a cross of the Lower EMA Envelope, with the envelope distance around the ema set to around half a percent:

    and [close x Lower EMA Env(20,0.5)]

    Obviously you can adjust the 0.5 per cent to whatever you like.

    If I understand you, you want to merge these scans into one scan. Here is what it would look like.

    // begin scan

    // universe of stocks to look at


    [type = stock] AND [country = US]
    //and [SCTR > 90]
    and [Daily EMA(5,Daily Volume) > 500000]
    and [Daily EMA(20,Daily Close) > 10]

    // conditions to find

    // close crossed the lower ema envelope but not the ema
    and [close < ema(20,close)]
    and [close x Lower EMA Env(20,0.5)]

    // MACD crossed its signal line
    and [MACD Line(12,26,18) crosses MACD Signal (12,26,18)]

    // CCI crossed -100 or 0
    and

    [

    [Daily CCI(14) crosses -100]

    or

    [Daily CCI(14) crosses 0]

    ]

    // end scan

    Hope that helps.

    But in backtesting it, I got few hits. To get more, you might play with having MACD Line above Signal, instead of crossing it, and/or CCI above -100 instead of crossing it. Apparently, having three crosses simultaneously is not a frequent event.

    P.S. It didn't occur to me (but should have) that you were using a line chart. I only ever use candle charts, so that's were my mind was.
  • Markd,

    Looks like we are getting close to Miller Time.

    On the first pass of backtesting, I have no hits at this time. If you got some hits which sounds like it is alive.

    The syntax doesn't recognize the word "above" as you suggested from the word "crosses"

    // CCI crossed -100 or 0
    and [[Daily CCI(14) above -100] or [Daily CCI(14) above 0]]

    //Your scan syntax is incorrect. Could not parse "(14) ABOVE" located in the clause "DAILY CCI(14) ABOVE -100" (an integer was expected). In the above MACD. Man, it went nuts with syntax errors.

    It was looking for an integer?

    Best regards,

    Quill -

    ps will keep running the scanning tool.
  • Markd,
    I think it is a matter of waiting for all three to click at the same time.

    Ran some tests by putting the // in from of the and MACD line and it found 4 stocks.

    Thank you very very much for your patience.
    Best regards,
    Quill -
Sign In or Register to comment.