Hi all,
How do I set the stocks that my algorithm looks for to just small cap (<$3.5B) companies?
Thanks in advance!
Hi all,
How do I set the stocks that my algorithm looks for to just small cap (<$3.5B) companies?
Thanks in advance!
Use pipeline to get any data you need as well as filter to the desired market cap. Maybe something like this
def make_pipeline():
# Create a universe filter which defines our baseline set of securities
us_equity_universe = Filters.default_us_equity_universe_mask()
# Create any basic data factors that your logic will use.
mkt_cap = MarketCap(mask=us_equity_universe)
# Define the columns and any screen which we want our pipeline to return
return Pipeline(
columns = {
'mkt_cap' : mkt_cap,
},
screen = (mkt_cap > SMALL_MKT_CAP_MIN) & (mkt_cap < SMALL_MKT_CAP_MAX)
)
See the attached algorithm. Note the log which records the lowest and highest market cap stock each day.