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.

Bad Scan Results

Below is a scan that I recently created trying to remember how to use brackets correctly. The scan seems to ignore the MACD Hist(48,104,39) and MACD Hist(48,104,0) criteria / filter. Yesterday it selected UVXY from my Favorites list but I can see that neither of the MACD Histograms met the criteria. I am certain that I have the brackets placed wrong?


[Favorites list is 16] and [[[MACD Hist(48,104,39) > 1 Day ago MACD Hist(48,104,39)] and [[Today's MACD Line(12,26,9) > 0.0] and [Today's MACD Line(12,26,9) > Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]

or [[Today's MACD Line(12,26,9) > 0.0] and [Today's MACD Line(12,26,9) < Today's MACD Signal(12,26,9)] and [Today's MACD Hist(12,26,9) > Yesterday's MACD Hist(12,26,9)]]

or [[Today's MACD Line(12,26,9) < 0.0] and [Today's MACD Line(12,26,9) < Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]

or [[Today's MACD Line(12,26,9) < 0.0] and [Today's MACD Line(12,26,9) > Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]]

or [[MACD Hist(48,104,0) > 1 Day ago MACD Hist(48,104,0)] and [[Today's MACD Line(12,26,9) > 0.0] and [Today's MACD Line(12,26,9) > Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]

or [[Today's MACD Line(12,26,9) > 0.0] and [Today's MACD Line(12,26,9) < Today's MACD Signal(12,26,9)] and [Today's MACD Hist(12,26,9) > Yesterday's MACD Hist(12,26,9)]]

or [[Today's MACD Line(12,26,9) < 0.0] and [Today's MACD Line(12,26,9) < Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]

or [[Today's MACD Line(12,26,9) < 0.0] and [Today's MACD Line(12,26,9) > Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]]]

Comments

  • markdmarkd mod
    edited February 26
    You have included the Hist 104 conditions in the "or" statement, but also have "or" conditions that don't specify a requirement for Hist 104. So when a Line-Signal condition is true, that symbol will be a hit regardless of the Hist 104 values.

    If you want to specify a Hist 104 condition that is always true, you have to isolate it from the "or" statement.

    [favorites list is 16]

    and [Hist 104 condition]

    and

    [
    [some condition]
    or
    [ next condtion]
    or
    ... etc.
    ]
  • Mark, the proper bracket placement is mind boggling. Below I have tried to emulate / copy a previous bracketing effort that you walked me thru a few months ago. I still don't understand it but I tried to copy it here. Does the below scan eliminate my mistake above?



    [Favorites list is 16] and [[[MACD Hist(48,104,39) > 1 Day ago MACD Hist(48,104,39)] and [[[Today's MACD Line(12,26,9) > 0.0] and [Today's MACD Line(12,26,9) > Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]

    or [[Today's MACD Line(12,26,9) > 0.0] and [Today's MACD Line(12,26,9) < Today's MACD Signal(12,26,9)] and [Today's MACD Hist(12,26,9) > Yesterday's MACD Hist(12,26,9)]]

    or [[Today's MACD Line(12,26,9) < 0.0] and [Today's MACD Line(12,26,9) < Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]

    or [[Today's MACD Line(12,26,9) < 0.0] and [Today's MACD Line(12,26,9) > Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]]]

    or [[MACD Hist(48,104,0) > 1 Day ago MACD Hist(48,104,0)] and [[[Today's MACD Line(12,26,9) > 0.0] and [Today's MACD Line(12,26,9) > Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]

    or [[Today's MACD Line(12,26,9) > 0.0] and [Today's MACD Line(12,26,9) < Today's MACD Signal(12,26,9)] and [Today's MACD Hist(12,26,9) > Yesterday's MACD Hist(12,26,9)]]

    or [[Today's MACD Line(12,26,9) < 0.0] and [Today's MACD Line(12,26,9) < Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]

    or [[Today's MACD Line(12,26,9) < 0.0] and [Today's MACD Line(12,26,9) > Today's MACD Signal(12,26,9)] and [Today's MACD Line(12,26,9) > Yesterday's MACD Line(12,26,9)]]]]]
  • I'm sorry, this scan is much too dense for me to untangle. I don't see the difference between this and the previous entry. I think it would be much more efficient to run separate scans for each condition, but that's just the way my head works.
  • Thanks again.
  • markdmarkd mod
    edited February 26
    I would suggest you document what each collection of conditions is testing for - in other words, write the test in common english - such as "// MACD Line rising above zero". Also, it would be very helpful for clarity if you wrote ONE "and" condition on each line. It would also make it much easier to track the brackets.

    It looks like you are testing for every possible state of MACD Line and Signal, but maybe not. Also, it looks like you could use the crossover ( "x" ) operator, which would make things simpler to read.
  • Thanks Mark. My second iteration above works well. I finally realized that I had enough available characters to include each of the two MACD 104 with each daily macd condition. I have two primary conditions....(48,104,36) and ....(48.104,0) and I have four secondary daily conditions that go with each of the two primary conditions. You figured all of this out for me a few months ago when I was trying to compress a scan where I had used up all of the available characters that the scan offered. I don't know why my little pea brain has such a hard time understanding how to use brackets correctly but it does. I still don't know why moving the brackets around in my second attempt above works but it does. Thank you
  • Mark, assuming that you'll see this, I wanted to tell you that I am getting close to having all of my scans just about as good as I feel they can get and it has been because of your help. Just stopping in this morning to tell you thanks again for your help. I may stop by again one day but for now, I think that I am good to go.

    Thanks,

    David
  • Thanks for the kind words. I hope it works out for you.
Sign In or Register to comment.