Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Negative cash flow getting through fcf filters?

Just had a look at my transaction log and noticed some unwanted stocks slipping through.

I tried using two filters to find stocks with positive cash flow
1. (valuation.enterprise / cash_flow_statement.free_cash_flow) to calculate ev/fcf
2. free_cash_flow > 0

RAIL was purchased in may of this year and was free cash flow negative for most recent quarter and on an annual/ttm basis.

Here is a copy of my code (query includes free cash flow and ev)

        .filter(fundamentals.income_statement.ebitda > 0) # Positive EBITDA  
        .filter(fundamentals.cash_flow_statement.free_cash_flow > 0) # Positive FCF  
        .filter(fundamentals.valuation_ratios.ev_to_ebitda < 10) # < 10 EV/EBITDA  
        .filter((fundamentals.valuation.enterprise_value / fundamentals.cash_flow_statement.free_cash_flow) < 10) # < 10 EV/FCF  

Pretty confused as all the other filters worked properly.

4 responses

I would check this for myself but I have to get to work soon...
Did you check to see what the number actually was? Was it reported as NaN? NaN passes comparative filters like > or <.

how do i check for nan in filters?

edit: nvm thought about how i could do it 30 seconds after posting:P

:) there ya go. I'm sure those that stumble on your thread will appreciate if you shared your code with us.

sadly it didnt work and i decided to go to bed