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)]]]]
0
Comments
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.
]
[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)]]]]]
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,
David
Try this scan:
[group is TechnologySector]
and [SCTR >90]
rank by sctr
Then down load the CSV file. Then save the results list to a new list, or replace an existing list, and check off the box to keep the sort order. Add the SCTR Line indicator to the charts, then compare the values to the CSV file. They will be the same.
Note that if you run the scan for a PAST date, the results page displays data for the CURRENT date. So, if you run a scan for a date a month ago (e.g. 4/17), and you ask for [SCTR > 45], you may get SCTR values on the results page which are LESS than 45 because the SCTR value has changed between the scan date 4/17 a month ago and the current date 5/17. So, to check the scan results, you would have to edit the chart start/end date so the chart ends on the scan date (4/17), apply to all, then view the SCTR Line indicator values.
So, if you ask for SCTR > 45 and back date the scan for a month ago, the symbols you get had SCTRs greater than 45 on that date.
For instance, if you want symbols ONLY if the SPX MACD is above zero, test for MACD for SPX below zero. If it is true, the scan should return only SPX. If it is false, it should return symbols for the other "or" conditions, if they are true. So,
[group is sp500]
and
[
[[symbol = $SPX] and [MACD < 0]]
or
[
some other conditions
]
]
I think there was a similar question some time ago and I think this worked, but I don't remember. Give it a try (but keep it simple while you are testing it out).
Found it - here's the previous question:
http://scan.stockcharts.com/discussion/comment/5081#Comment_5081
As for software that scans lower time frames - I don't know. Not my thing.
[[symbol = $SPX] and [MACD Line(12,26,9) > 1 Week ago MACD Line(12,26,9)]] and [Group is SP500] and [RSI(14) > SMA(20,RSI(14))] and [1 Day ago MACD Hist(6,9,0) < 0.0] and [Volume > 500,000] and [Close > 10.0] and [Close < 100.0] and [Close > Open] and [Low < 1 Day ago High] 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) > Yesterday's MACD Line(12,26,9)] and [1 Day ago MACD Line(12,26,9) < 2 Day ago MACD Line(12,26,9)] 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) > Yesterday's MACD Line(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 Hist(12,26,9) > Yesterday's MACD Hist(12,26,9)]]]
[[symbol = $SPX] and [Weekly MACD Line(12,26,9) > 1 Week ago MACD Line(12,26,9)]] and [Group is SP500] and [RSI(14) > SMA(20,RSI(14))] and [1 Day ago MACD Hist(6,9,0) < 0.0] and [Volume > 500,000] and [Close > 10.0] and [Close < 100.0] and [Close > Open] and [Low < 1 Day ago High] 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) > Yesterday's MACD Line(12,26,9)] and [1 Day ago MACD Line(12,26,9) < 2 Day ago MACD Line(12,26,9)] 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) > Yesterday's MACD Line(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 Hist(12,26,9) > Yesterday's MACD Hist(12,26,9)]]]
I'm assuming this scan is not giving the results you expect.
You have to isolate the symbol = $SPX statement. If you have a scan including "symbol = ...", you cannot have any other "and" statements in the scan meant for other symbols. You can only have an "or" statement.
Remember, to return ANY symbol, ALL "and" statements must be true for that symbol. If you specify "symbol is $SPX", that is not true of any other symbol EXCEPT $SPX. For instance, symbol = $SPX is not true for AAPL. The symbol for AAPL is AAPL.
Within the "or" statement you can group "and" statements if you want, but they cannot stand alone outside the "or" statement.
For instance, you have combined your symbol statement with an "and" statement for group is sp500. That says that you are looking for a symbol that is "$SPX" and belongs to the sp500. These two things cannot be true because there is no $SPX symbol in the sp500 group. So, you will get no symbols back for your conditions before the "or". You may get some for the conditions after the "or".
If you want to test for just a gap open, you would look for today's open above yesterday's close. That won't change.