Back to Community
Combining momentum, value, profitability, and growth long/short equity

This algorithm, whose framework is based off of "A weekly view of 'A simple momentum rotation system for stocks'", is a high school senior year project. It incorporates Value, Profitability, Earnings Growth, and cash flow factors to improve on a traditional momentum strategy by selecting stocks whose upward momentum is founded upon strong fundamentals, rather than speculation.

There's still a long way to go for this algorithm, with many additional improvements I plan on implementing as I become better at using Python. I will post updated and cleaner versions of this algorithm as well as a more detailed explanation of its function in days and months to come.

Clone Algorithm
Backtest from to with initial capital
Total Returns
Max Drawdown
Benchmark Returns
Returns 1 Month 3 Month 6 Month 12 Month
Alpha 1 Month 3 Month 6 Month 12 Month
Beta 1 Month 3 Month 6 Month 12 Month
Sharpe 1 Month 3 Month 6 Month 12 Month
Sortino 1 Month 3 Month 6 Month 12 Month
Volatility 1 Month 3 Month 6 Month 12 Month
Max Drawdown 1 Month 3 Month 6 Month 12 Month
# Backtest ID: 5a171ba7534c1e43b71aaffe
There was a runtime error.
3 responses

I ran the tear sheet to look further at your results. It looks like the algorithm allocates to a tech and industrials pretty heavily.

Loading notebook preview...
Notebook previews are currently unavailable.

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Hi David,

Thanks for the algorithm, and please allow me to mention that there are two WARNINGs as below

2003-01-02 23:00 DEPRECATION WARNING Line 932: Evaluating inclusion in security_lists is deprecated. Use sid in <security_list>.current_securities(dt) instead. Learn more here.
2003-01-02 23:00 DEPRECATION WARNING Line 942: Evaluating inclusion in security_lists is deprecated. Use sid in <security_list>.current_securities(dt) instead. Learn more here.



Now using QTradableStocksUS so I haven't used these in awhile:

eftlist = security_lists.leveraged_etf_list.current_securities(get_datetime())


class ETFScreen(CustomFactor):  
    inputs = [] ; window_length = 1  
    def compute(self, today, asset_ids, out):  
        out[:] = asset_ids.isin(security_lists.leveraged_etf_list.current_securities(get_datetime()))  

... however above surely this ought to work under set portfolis parameters:


And then elsewhere try this with get_datetime() in place of dt in the warning...

        if stock in security_lists.leveraged_etf_list.current_securities(get_datetime()):