Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Long-term Fundamental Strategy 30% annual return

Thought I would share this in case anyone has ideas for improvement.

The Theory:
Companies with the best free cash flow yield are (generally) good investments but having improving free cash flow yield can be misleading if the market cap is decreasing.

Filter Criteria:
-In the top 10% by free cash flow yield
-free cash flow yield increased from last quarter
-market cap increased from last quarter
-free cash flow yield increased from last year
-market cap increased from last year

Rebalance biweekly.

8 responses

I ran that to the beginning of 2006. It is beating the benchmark but most of the apparent profit is impossible margin that no broker would allow.
Returns appear to be 320% when profit per dollar invested is actually just 66%, with benchmark at 50%.
So it's a strategy worth pursuing and hopefully someone will offer a way to bring margin under control.

Thank you for the insight.
Could you share how you were able to see profit per dollar was 66% through 2006?

Also, how did you come to your conclusion regarding the leverage? The recorded leverage shows values as high as 1.3 but that appears to occur infrequently and only during turnover.

Essentially this and this should do. I use a tool that integrates many different things (was just way too much work to give away for free).
I should add that http://quantopian.com/posts/track-orders can be helpful sometimes.

Anyone else want to offer a way to reign in the margin in that backtest?

Blue,
Here is a tweaked version backtested through 2006.

I changed it so that it checks leverage every minute and does not place any new buy orders until leverage has reached zero from closing out the previous positions. I recorded max_leverage as described in the link you shared and 1 is the highest value reached.

Unless I'm missing something else (usually the case), it looks like the bulk of the returns are still there without a boost from leverage.

Regarding PvR, maybe the value is degraded during turnover? I think it is also worth noting that part of the strategy is to have less dollars invested when there are significantly fewer stocks available that meet the criteria (which could indicate a troubled market). Perhaps that is skewing the PvR value as well.

The way you constrain your position size when the number of selected securities is less than 10 has the effect of leveraging the portfolio by a factor of longs/10 when the number of longs exceeds this target. Putting amount equal to portfolio_value/longs when len(longs) > 10 is probably what you intended.

With market cap as a proxy for price your strategy is essentially the long side of a conventional momentum factor ranked by free cash flow. It might be useful for you to rewrite it using a short/long approach and quantopian.optimize constraints.

Good going. We have liftoff.

This just adds PvR and it includes MxLv plus some other record options, in case it comes in handy sometime.
By the way I'd like everybody to click 'CashLow' in the custom chart below, click it once. Everyone should know how that works, great feature by Q and many could be unaware of it.

Chris,
I capped at 10 to try and avoid too much commission since it is rebalanced biweekly, but to be honest I haven't tried you're suggestion yet.
Concerning fundamentals used, I agree there's a contributing momentum factor from market cap but I think free cash flow is the meat of the strategy.

Blue,
Thanks for the utility functions and sharing the knowledge about Q's features. Very handy!

Hello,

I just full backtested your strategy, and looking on the transations that the strategy made, I'm a little bit confused.
The strategy sells everything every 2 weeks, and than in the same day buys back part of the securities(this will generate many unnecessary commissions)
I've made a change in the sell function, and added a new condition, to sell only if the security is not in the context.longs,
but now it seems that it underperforms the S&P500.
I think the trick is that when it sells all the securities, and than buys them back, it redistributes all the cash to all 10 securities.
I'll try to improve the strategy an post the result.

Good work, thank you!