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.
Scan 3 Sectors at the same time
i built a basic scan encompassing Sectors and Industries which I picked from the Scan Components-Sectors and Industries drop-down list.
I picked 3 sectors for the scan: Technology Sector, Health Care Sector, and Materials Sector. Unfortunately i CAN NOT get the scan to run against all 3 sectors at the same time, instead I have to run each sector scan individually and then combine the results from the 3 scans.
This is the script that got inputted from the drop down list:
and [group is HealthCareSector]
and [group is TechnologySector]
and [group is MaterialsSector]
Is there a way to scan all 3 sectors all at once rather than 1 at a time?
0
Comments
The scan engine returns symbols when ALL the conditions in the scan are true.
So, when all the conditions are "and" conditions, all those "and" conditions have to be true. But symbols can belong to only one group at a time, so if you ask for 'and Health and Technology', no symbol can fit both conditions, so you get no results.
However, for an "or" condition, only one of the alternatives inside of the "or" condition has to be true for the whole "or" condition to be true. (Only one HAS to be true; if two or more are true, symbols for all the true alternatives get returned).
To write an "or" condition, you have to put all the alternatives inside a set of brackets. So yours would look like this:
// some other preceding statement
and
[ // opening or bracket
[group is HealthCareSector] // first alternative
or [group is TechnologySector] //second alternative
or [group is MaterialsSector] // third alternative
] // closing or bracket
// some other following statements
The "or" operator is explained here (about two thirds down the page):
https://support.stockcharts.com/doku.php?id=scans:advanced_scan_syntax