StockFetcher Forums · Filter Exchange · How do you get multiple sectors? Any ideas? << >>Post Follow-up
sboren
9 posts
msg #50867
Ignore sboren
4/4/2007 6:49:18 PM

Guys,

I want to filter by multiple sectors like 'sector is financial or sector is utilities'. SF only returns matches in one sector.

Any suggestions for filtering on multiple sectors?

Thanks,
Steve

lockwhiz
206 posts
msg #50868
Ignore lockwhiz
modified
4/4/2007 8:17:38 PM

Sectors can be sorted by their assigned number ... ie:

1 - Consumer Non-Cyclical
2 - Financial
3 - Basic Materials
4 - Healthcare
5 - Energy
6 - Technology
7 - Services
8 - Transportation
9 - Capital Goods
10 - Utilities
11 - Consumer Cyclical

What you need to use is a tool set that TRO created....you will need to use TRO's BOOLEAN LOGIC for StockFetcher.... this will give you the boolean OR
......search for BOOLEAN LOGIC.

..... post what you come up with !

lockwhiz
206 posts
msg #50869
Ignore lockwhiz
modified
4/4/2007 8:35:40 PM

...you got me curious ....I decided to get this to work ... So thanks to the RumpledOne work, giving us his tool set here it is:

Fetcher[
/* OR Implementation */
/* by definition OR is TRUE IF A is TRUE, B is TRUE, or A AND B is TRUE*/
/* THEREFORE by counting and adding, if the sum is greater than 0 the OR condition is TRUE. */
/* Copyright 2003 by Avery T. Horton, Jr. */
/* Permission to use OR Implementation withing StockFetcher Granted */
/* Permission to publish or post on any other forum DENIED */
/* ----------------------------------------------------------------*/
set{A, count(sector is equal to 2, 1)}
set{B, count(sector is equal to 10, 1)}
set{OR1, A + B}
show stocks where OR1 above 0
]

...or to sort for three sectors Energy, Financial and Utilities:
(sectors 2, 5 and 10)

Fetcher[
set{A, count(sector is equal to 2, 1)}
set{B, count(sector is equal to 10, 1)}
set{C, count(sector is equal to 5, 1)}
set{OR1, A + B}
set{OR2,OR1 + C}
show stocks where OR2 above 0
]

Fare Well !!

 sboren9 postsmsg #50920- Ignore sboren 4/7/2007 3:52:29 PMThanks guys, I'll give them a try!
 StockFetcher Forums · Filter Exchange · How do you get multiple sectors? Any ideas? << >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.