StockFetcher Forums · Filter Exchange · Need help to write a combined list of stocks<< >>Post Follow-up
styliten
294 posts
msg #149562
Ignore styliten
11/9/2019 3:12:42 AM

Need to combine 4 distinct groups of stocks into 1 dynamically updated combined list:

1. Group 1 criteria:
a. Market Cap > 300
b. Average volume(30) > 600000
c. Day change > 4.5%

2. Group 2 criteria:
a. Market is S&P 500
b. Day change > 3.5%

3. Group 3 criteria:
a. Market is Nasdaq 100
b. Day change > 2.5% (so if a ticker belongs to both S&P 500 and Nasdaq 100 with a day change of 3.0% should be picked up here, because it failed to meet the Group 2 criteria)

4. Group 4 criteria:
a. Market is Dow 30
b. Day change > 1.5% (Dow 30 stocks are also part of S&P 500 and Nasdaq 100, but their average day change is typically smaller since they are Blue Chip stocks, so any day change > 1.5% would be picked up right here.)

Now how to combine groups 1 thru 4 into a "Total_Group"?

compound_gains
222 posts
msg #149566
Ignore compound_gains
11/10/2019 3:07:05 PM

Fetcher[
/*1. Group 1 criteria:
a. Market Cap > 300
b. Average volume(30) > 600000
c. Day change > 4.5%*/
set{mcap, shares outstanding * close}
set{g11, count(mcap above 300,1)}
set{g12, count(average volume(30) above 600000, 1)}
set{g13, count(day change above 4.5, 1)}
set{g14, g11 + g12}
set{g15, g14 + g13}
set{group1, count(g15 equals 3, 1)}
add column group1

/*2. Group 2 criteria:
a. Market is S&P 500
b. Day change > 3.5%*/
set{g21, count(market is s&p500, 1)}
set{g22, count(day change above 3.5, 1)}
set{g23, g21 + g22}
set{group2, count(g23 equals 2, 1)}
add column group2

/*3. Group 3 criteria:
a. Market is Nasdaq 100
b. Day change > 2.5% (so if a ticker belongs to both S&P 500 and Nasdaq 100 with a day change of 3.0% should be picked up here, because it failed to meet the Group 2 criteria)
*/
set{g31, count(market is nasdaq 100, 1)}
set{g32, count(day change above 2.5, 1)}
set{g33, g31 + g32}
set{group3, count(g33 equals 2, 1)}
add column group3

/*4. Group 4 criteria:
a. Market is Dow 30
b. Day change > 1.5% (Dow 30 stocks are also part of S&P 500 and Nasdaq 100, but their average day change is typically smaller since they are Blue Chip stocks, so any day change > 1.5% would be picked up right here.)*/
set{g41, count(market is dow 30, 1)}
set{g42, count(day change above 1.5, 1)}
set{g43, g41 + g42}
set{group4, count(g43 equals 2, 1)}
add column group4

set{t1, group1 + group2}
set{t2, t1 + group3}
set{tot, t2 + group4}
tot above 0
]



styliten
294 posts
msg #149567
Ignore styliten
11/10/2019 6:11:14 PM

Thank you compound_gains!

The only minor change I could think of is that there is a "market cap" keyword already, i.e., count(market cap > 300, 1) > 0.5

styliten
294 posts
msg #149573
Ignore styliten
modified
11/11/2019 1:21:14 PM

Issue solved.

Sorry.

StockFetcher Forums · Filter Exchange · Need help to write a combined list of stocks<< >>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.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.