Hi there, before I start I appreciate everyone who lends a hand. That being said, here is my problem. I am filtering a pipeline to give me stocks between 500 million and 2 billion market cap. However, the filter doesn't seem to work, as the output shows securities way over 2 billion.
Attached is my notebook and my code is below.
Here is my code:
from quantopian.pipeline import Pipeline
from quantopian.research import run_pipeline
from quantopian.pipeline.data import morningstar
from quantopian.pipeline.data import Fundamentals
million = 1000000000
billion = 1000000000000
market_cap = morningstar.valuation.market_cap.latest
low = market_cap > 500 * million
high = market_cap < 2 * billion
small_cap = low & high
pe = Fundamentals.forward_pe_ratio.latest
my_pipe = Pipeline(
columns={
'market_cap': market_cap,
'fpe': pe,
},
screen= small_cap
)
date = '8/31/2017'
result = run_pipeline(my_pipe, date, date)
result.head()
Thank you for the help!