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.

Compress a lengthy scan

Below is about half of a very long scan. The complete scan uses up almost all of the allowed characters. If possible, I'd like to compress this scan so that I can combine another shorter scan into one big scan. I have already taken and tested some of your ideas to compress the scan. Do you have any further ideas about how to further compress this portion of the scan? One idea might be for me to change 2 words, this week's to 1 word, weekly.

[Favorites list is 10] and [[[This week's MACD Signal(12,26,9) > 0.0] and [This week's MACD Line(12,26,9) > This week's MACD Signal(12,26,9)] and [MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

or [[This week's MACD Signal(12,26,9) > 0.0] and [This week's MACD Line(12,26,9) > This week's MACD Signal(12,26,9)] and [MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

or [[This week's MACD Signal(12,26,9) > 0.0] and [This week's MACD Line(12,26,9) > This week's MACD Signal(12,26,9)] and [MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

or [[This week's MACD Signal(12,26,9) > 0.0] and [This week's MACD Line(12,26,9) > This week's MACD Signal(12,26,9)] and [MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

or [[This week's MACD Signal(12,26,9) > 0.0] and [This week's MACD Line(12,26,9) < This week's MACD Signal(12,26,9)] and [This week's MACD Hist(12,26,9) > 1 Week ago MACD Hist(12,26,9)] and [MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [Today's MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

or [[This week's MACD Signal(12,26,9) > 0.0] and [This week's MACD Line(12,26,9) < This week's MACD Signal(12,26,9)] and [This week's MACD Hist(12,26,9) > 1 Week ago MACD Hist(12,26,9)] and [MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

or [[This week's MACD Signal(12,26,9) > 0.0] and [This week's MACD Line(12,26,9) < This week's MACD Signal(12,26,9)] and [This week's MACD Hist(12,26,9) > 1 Week ago MACD Hist(12,26,9)] and [MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

or [[This week's MACD Signal(12,26,9) > 0.0] and [This week's MACD Line(12,26,9) < This week's MACD Signal(12,26,9)] and [This week's MACD Hist(12,26,9) > 1 Week ago MACD Hist(12,26,9)] and [MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

Comments

  • markdmarkd mod
    edited September 2018
    Well, I find it very hard to read as you have formatted it (and w/o comments - space reasons?).

    But, I see a lot of conditions re-occurring, so I think you might want to identify which conditions are common to which "or" statements, and then which conditions are unique to each "or" condition. Then you can group the common conditions so you only have to write them once, and then connect the various unique conditions with "or".

    So, schematically it might look like this:

    [group is whatever]

    // first set of common conditions

    and
    [
    [a > b]
    and [c > d]
    and [e > f]
    and

    [
    [ g < h] // first condition with this group
    or
    [ i < j ] // second
    or
    [k < l ] // third
    ]
    ]

    or

    //second set of common conditions

    [
    [a < b] // this one is different from first group of common condition
    and [c > d]
    and [e > f]
    and
    [
    [ m > n]
    or
    [ o < p ]
    or
    [q < r ]
    ]
    ]

    or
    // third set of common conditions
    [
    etc.

    Watch your brackets.
  • Mark, thanks. I can see that my understanding and ability to write scans isn't quite good enough to really understand what your telling me. I understand conceptually that the common conditions can be written only once but how to actually write that into a scan is mind boggling. I am pretty sure that it can be done with the proper placement of brackets. I'll see what I can do using your schematic above.
  • Below, I changed This week's to....Weekly. And, I have tried to place brackets per your schematic above. As you know when I check syntax it doesn't work. Brackets are placed wrong. I can add one bracket before the first common weekly condition and make the syntax correct but I don't think that's correct. As you can see, there are four different daily macd conditions for every weekly condition. My little pea brain thinks that every four daily conditions needs to be bracketed separately from all of the others.

    [Favorites list is 10] and [[Weekly MACD Signal(12,26,9) > 0.0] and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)] and [MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[Weekly MACD Signal(12,26,9) > 0.0] and [Weekly MACD Line(12,26,9) < Weekly MACD Signal(12,26,9)] and [Weekly MACD Hist(12,26,9) > 1 Week ago MACD Hist(12,26,9)] and [MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [Today's MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]]
  • markdmarkd mod
    edited September 2018
    This passes syntax, with a couple of edits that might mess up your logic (changed an "or" to "and" at the top). Also, there might be an extra set of parens, but I don't think that changes the logic.

    It would really help if you could add comments to explain what each section is supposed to be looking for, even if you think it's obvious (see example in scan) Maybe copy and paste this into a new scan, then write the comments, then edit/re-arrange for logic.

    I strongly suggest this format (new line for each condition). I honestly can't read the format you are using. Sorry!

    [Favorites list is 10]

    and [Weekly MACD Signal(12,26,9) > 0.0]
    and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)]
    and [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]

    and
    [
    [
    // Signal above zero, Line above Signal, Hist12 ticks up, Hist6 was below zero
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    [
    [Weekly MACD Signal(12,26,9) > 0.0]
    and [Weekly MACD Line(12,26,9) < Weekly MACD Signal(12,26,9)]
    and [Weekly MACD Hist(12,26,9) > 1 Week ago MACD Hist(12,26,9)]
    and [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]

    ]

    or
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]
    ]
  • Also, it might help to write separate, smaller scans, get those to work, and then combine them into a large scan, although I think you are better off with several smaller scans - easier to verify the results- which is hard enough because you are mixing time frames, so you have to look at two different charts for each hit.

    It's good that you are not afraid of work, or a challenge, but there's something to be said for simplicity, too.
  • Mark, thanks again. I'm sorry for not presenting it in a way that you can understand. I'm beyond my skill set now and I'm still not sure what your trying to tell me.
  • OK.

    Well, it looks like in all cases, you want Weekly MACD Signal >0. And in all cases you want 1 day ago MACD Hist < 0.

    Then, I'm guessing you want some daily MACD Line and Signal conditions when Weekly MACD Signal > weekly Line, and some daily conditions when weekly Line > Signal.

    Is that right, so far?
  • No, not quite right.

    Lets disregard this condition...[1 Day ago MACD Hist(6,9,0) < 0.0] for now.

    Let me try this.

    There are four macd conditions that I am looking at. Two conditions above zero and two conditions below zero. The first is when the signal line is above zero and the fast line is above the signal line. The second is when the signal line is above zero and the fast line is below the signal line. The third is when the signal line is below zero and the fast line is below the signal line. The fourth and last is when the signal line is below zero and the fast line is above the signal line. To follow the bigger time frame (weekly tf) I would like to use four weekly macd conditions just like I just mentioned above. With each weekly condition, I also want the same four macd conditions but using them on a daily time frame. So, when the scan is complete there are 16 different scenarios and each scenario can be it's very own scan. With that in mind, the "and' that you added won't work, there has to be an "or" there.

    Below is the first weekly condition with all four daily conditions;

    [[Weekly MACD Signal(12,26,9) > 0.0] and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)] and [MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    or [[MACD Signal(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)] and [1 Day ago MACD Hist(6,9,0) < 0.0]]
  • markdmarkd mod
    edited October 2018
    OK. Great explanation.


    I think if you re-arrange your brackets like this:


    // 1st weekly MACD combo


    [Weekly MACD Signal(12,26,9) > 0.0]
    and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)]

    and

    // begin daily MACD combos for 1st weekly MACD combo

    [
    // 1st daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // second daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // third daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // 4th daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]
    ] // end daily MACD combos for 1st weekly MACD combo
  • markdmarkd mod
    edited October 2018
    To get the whole scan, start a new scan, copy this bracket structure to it, then fill it in.


    [group is sp500]

    and
    [

    weekly combo 1 (i.e., copy/paste from above all the code between // 1st weekly ... and // end daily MACD for 1st weekly )

    ]

    or

    [

    weekly combo 2 (copy/paste code from above, edit as needed

    ]

    or

    [

    weekly combo 3

    ]

    or

    [

    weekly combo 4

    ]


  • Your original question was about compressing the code. I don't see a way to do that.

    But I don't think your original scan was getting expected results, except maybe by accident, because, as you had things grouped, the weekly condition was not required for the "or" paragraphs - just the first paragraph with the "and" daily MACD conditions.

    As I have re-arranged things, all four daily MACD conditions must occur with the associated weekly conditions.

    Hope that helps.
  • Whew, thanks. The way that you lay-out (format) the brackets with the intermittent notes is something new to me and it's hard for me to figure out. I'll have to study this and see if I can figure out what your doing. As far as compressing the original scan, the question still stands. If you were to go back to the top of this thread and look at the portion of the scan that I copied and pasted you'll see that I use the weekly condition with every single daily condition. I feel like there is a way to state the weekly condition less often and save space. I think that there is a way to use the weekly condition only 4 (1 time with each weekly combo) times by proper arrangement of the brackets. Maybe that is what your trying to tell me with your last effort to help my little pea brain understand this thing.
  • markdmarkd mod
    edited October 2018
    Yes, that's right.

    You only need to state each of the four weekly conditions one time.

    Basically, what we are doing is "nesting" the 'or' condition.

    Suppose you wrote the scan looking for just the weekly conditions. It would be

    ************

    [favorites list is 10]

    and
    [ // begin weekly combos

    [ // first weekly combo
    [Weekly MACD Signal(12,26,9) > 0.0]
    and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)]
    ]

    or

    [ // second weekly combo
    [Weekly MACD Signal(12,26,9) > 0.0]
    and [Weekly MACD Line(12,26,9) < Weekly MACD Signal(12,26,9)]
    ]

    or

    [ // third weekly combo
    [Weekly MACD Signal(12,26,9) < 0.0]
    and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)]
    ]

    or

    [ // fourth weekly combo
    [Weekly MACD Signal(12,26,9) < 0.0]
    and [Weekly MACD Line(12,26,9) < Weekly MACD Signal(12,26,9)]
    ]

    ] // end weekly combos

    *************

    So that's the "top" level.

    Then, under each weekly condition, you need the four daily conditions. Those are the "second" level. So you have "or" statements within an "or" statement.

    The four daily "or" conditions are grouped by brackets (labelled // begin daily combos - // end daily combos). Each daily "or" group is linked to it's weekly combo (first, second, third, fourth) by "and". The brackets around the four daily "or" statement make it read as if all the conditions in the daily "or" group are one statement.

    I wish we had color fonts. I'll try bolding the "top" level. With a real programming editor (word processor) the levels would be indented, but we'll make do. I think you know this, but the white space has no meaning - it's just for readability. Also, the white space doesn't count toward your character count (it might count as one character per blank line, I'm not sure, but negligible).

    [favorites list is 10]

    and
    [ // begin weekly combos

    [ // first weekly combo
    [Weekly MACD Signal(12,26,9) > 0.0]
    and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)]


    and

    [ // begin daily combos
    // 1st daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // second daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // third daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // 4th daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]
    ] // end daily MACD combos

    ] // end first weekly combo


    or

    [ // second weekly combo
    [Weekly MACD Signal(12,26,9) > 0.0]
    and [Weekly MACD Line(12,26,9) < Weekly MACD Signal(12,26,9)]


    and

    [

    [ // first daily combo
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // second daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // third daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // 4th daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]
    ] // end daily combos

    ] // end second weekly combo


    or

    [ // third weekly combo
    [Weekly MACD Signal(12,26,9) < 0.0]
    and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)]


    and

    [ // begin daily combos
    // 1st daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // second daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // third daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // 4th daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]
    ] // end daily MACD combos

    ] // end third weekly combo


    or

    [ // fourth weekly combo

    [Weekly MACD Signal(12,26,9) < 0.0]
    and [Weekly MACD Line(12,26,9) < Weekly MACD Signal(12,26,9)]


    and

    [ // begin daily combos
    // 1st daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // second daily MACD combo
    [
    [MACD Signal(12,26,9) > 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Hist(12,26,9) > 1 Day ago MACD Hist(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // third daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) < MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]

    or
    // 4th daily MACD combo
    [
    [MACD Signal(12,26,9) < 0.0]
    and [MACD Line(12,26,9) > MACD Signal(12,26,9)]
    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]
    ]
    ] // end daily MACD combos

    ] // end fourth weekly combo

    ] // end all weekly combos
  • Mark, I may finally get it. Have to study this again. Thanks again
  • Mark, one more time, thanks. You have spent a lot of time with me, I appreciate it
  • No problem. I hope you get where you want to go with it.
  • Thanks, it's almost as much about learning something new as it is anything else. My scans are already working well but I just can't shake the thought of trying to make them better somehow. I am sure that I will be back sometime in the future after I have had time to digest and test my new knowledge, lol.
  • Mark, I have to tell you that I have spent the morning re-writing and combining my scans. It will take me some time to test but so far the scan results seem to be identical to my original and longer versions of the separate scans. And, I have 718 characters left. Fantastic
  • markdmarkd mod
    edited October 2018
    Well, it occurred to me as I was re-formatting your scan, that your conditions account for every possible configuration of weekly and daily MACD, except Line = Signal (which is rare anyway).

    The other conditions are Line > than 1 day ago Line, and Hist 6 < 0.

    It seems to me you could leave out the MACD conditions altogether and just ask for the two other conditions.

    Asking for all possible configurations is the same as asking for any configuration (I think that may be why your results are so similar). If any configuration will do, then you don't need to specify every configuration.

    Of course, I haven't seen the whole scan, so Just a thought.
  • I have my interpretation of MACD which is kind of hard to explain this way, but is not the common interpretation. My theory is to follow MACD momentum. The core of my scan is the MACD with the larger TF being the weekly. Sometimes it's the Fline that gives me the signal and at other times it's the Histogram that gives me the signal, it all depends on the position of the Fline and Sline and their relation to zero. I have a couple of other indicators that I add to the MACD signals depending on where the weekly and daily MACD happen to be at the time. At extremes I add other indicators in an effort to eliminate a few of the inevitable losses when I get stopped out for being wrong. So I filter those extremes in hopes that I filter out some of the inevitable losses. I use the canned MACD setting (12,26,9) for all the MACD situations because I think that is what everyone watches and uses. You may or may not find it interesting that I use the MACD Hist(6,9,0) for my EMA(6) and EMA(9). When the histogram crosses zero, the two EMA's have crossed. I use the histogram for two reasons. First, it's easier for me to visually see the histogram cross zero, especially when it's colored. Second, it saves space expressing the EMA's in a scan.
  • markdmarkd mod
    edited October 2018
    OK. I understand the various states of MACD in weekly and daily are important to your analysis.

    I think the point I am trying to make is that what you scan for, and what you analyze do not necessarily have to be identical. Items in your analysis have to be on your chart, but they may not have to be in your scan.

    For instance, suppose I have a method where the direction of the 50 MA matters. And I use another indicator, too (let's say, Fast K), but how I interpret Fast K depends on what the 50 MA is doing.

    So, suppose I build the scan to include all possible states of the 50 MA first - rising, falling, turning up or turning down, WITHOUT the Fast K conditions. If I run that scan against a list of 100 stocks, won't I get 100 hits? I should, because the scan covers all possible 50 MA directions, so every stock in the list should be going in one of those directions.

    Now if I run the same scan, and add K x 20 or 20 x K, I will get many fewer hits, because K can be doing other things besides crossing above or below 20.

    But what happens if I scan for Kx20 or 20 x K ONLY?

    Won't I get the same number of hits as the scan with the 50 MA conditions? The 50 MA conditions will pick up all stocks no matter what. The limiting condition is K. If K x 80 the stock will not get picked - even though must have one of the 50 MA conditions. So why test for the 50 MA conditions? Even though I will use the 50 MA direction on my chart on in my analysis, I don't need to scan for it.

    So what I'm saying is, in your scan, you account for all combinations of weekly and daily MACD, but you don't have to. Your results will have one of those combinations no matter what because you have covered all possible combinations. Your charts will need MACD, but not your scan.
  • Ok, I think that I have it. However, the scan that I have shown you is the bull scan only. There is also a bearish MACD scan. The bull scan only chooses the bullish conditions and believe it or not, there are times when the scan results in nothing at all. These MACD scans do not work very well on the vast majority of stocks. It is only effective on something that will trend for a while.
  • markdmarkd mod
    edited October 2018
    Well, it's not unusual to get no hits.

    What I'm saying is, basically, this is your bullish scan:

    [favorites list is 10]

    and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]
    and [1 Day ago MACD Hist(6,9,0) < 0.0]]

    All the other stuff covers all possible configurations of daily and weekly MACD, which you don't need to specify, because if you hit on these conditions, it has to have one of the MACD combinations you want, because you want all of them.

    So I'm guessing your bearish scan can probably be just as brief.
  • Mark, the bracketing lay-out above does seem to work very well thank you. I have a new question please. I have two separate scans that I'd like to combine and also get the same results as if they were separate scans but I can't figure out how to bracket them.

    The first scan is [Favorites list is 10] and [1 Day ago MACD Hist(6,9,0) > 0.0] and [Full Stoch %K(14,3,3) < 1 Day ago Full Stoch %K(14,3,3)] and [[[Weekly MACD Line(12,26,9) > 0.0] and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)] and [Weekly MACD Line(12,26,9) < 1 Week ago MACD Line(12,26,9)] and [[[MACD Line(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Hist(12,26,9) < 1 Day ago MACD Hist(12,26,9)]]]]

    or [[Weekly MACD Line(12,26,9) > 0.0] and [Weekly MACD Line(12,26,9) < Weekly MACD Signal(12,26,9)] and [Weekly MACD Line(12,26,9) < 1 Week ago MACD Line(12,26,9)] and [[[MACD Line(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Hist(12,26,9) < 1 Day ago MACD Hist(12,26,9)]]]]

    or [[Weekly MACD Line(12,26,9) < 0.0] and [Weekly MACD Line(12,26,9) < Weekly MACD Signal(12,26,9)] and [Weekly MACD Line(12,26,9) < 1 Week ago MACD Line(12,26,9)] and [[[MACD Line(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Hist(12,26,9) < 1 Day ago MACD Hist(12,26,9)]]]]

    or [[Weekly MACD Line(12,26,9) < 0.0] and [Weekly MACD Line(12,26,9) > Weekly MACD Signal(12,26,9)] and [Weekly MACD Hist(12,26,9) < 1 Week ago MACD Hist(12,26,9)] and [[[MACD Line(12,26,9) > 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) > 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) < 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) < 0.0] and [MACD Line(12,26,9) < MACD Signal(12,26,9)] and [MACD Line(12,26,9) > 1 Day ago MACD Line(12,26,9)]]

    or [[MACD Line(12,26,9) < 0.0] and [MACD Line(12,26,9) > MACD Signal(12,26,9)] and [MACD Hist(12,26,9) < 1 Day ago MACD Hist(12,26,9)]]]]].

    The second scan is

    [Favorites list is 10] and [Weekly MACD Line(12,26,9) < 1 Week ago MACD Line(12,26,9)] and [Weekly MACD Hist(12,26,9) < 1 Week ago MACD Hist(12,26,9)] and [MACD Hist(48,104,0) < 1 Day ago MACD Hist(48,104,0)] and [MACD Hist(48,104,36) < 1 Day ago MACD Hist(48,104,36)].

    FYI, I can combine the two and when I test the syntax it is correct but the scan results are not the same as if I ran the scans seperately. I think that it has to do with the bracketing again.

    Thanks,

    David
  • That's just way too much for me to process.

    I know you want do it all in one scan, and I understand that it makes sense to you to do it that way, but for me it would be much easier to break it into several scans.

    Are you still asking for all possible combinations of Line and Signal in one scan? If so, why?
  • Yes, I have them as separate scans but it would be a little easier if they were combined into one scan. A few less mouse clicks etc. is all I was hoping for. The second scan is nothing like the first scan. Thanks again
  • I tried to add the second scan using an "or" but I don't seem to understand the bracketing well enough to make it run and produce results the same as they would if they are separate scans
  • Well, it appears that I may be able to add the second scan to the end of the first scan by using or [[ and ]]. The scan results appear to be good but I don't have the or wrapped in a parent bracket clause. Thanks Mark
  • I haven't read all this because it's really long, but if this was not suggested, you might use part of the scan, save the results into a chartlist, then further reduce it with the rest of the scan. I'm an infrequent visitor to this site, so will be unlikely to follow up.
  • Thanks, that has been suggested. Appreciate your response
Sign In or Register to comment.