Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
A experiment with momentum

This is an attempt to capture momentum baskets and trade them every week.

7 responses

Elegant algo! Thanks for sharing

Disclaimer

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.

Satyapravin, are there any statistical functions being used that can inject any randomness? I don't understand why my clone of that has a different result. (Took a little over two hours btw). Or maybe something changed in get_fundamentals() over the last couple of days?
So it's tough to comment b/c I'm not sure it is apples-to-apples however in both my run of this algo and the other that you posted elsewhere a bit ago, they pull in 34 (and 51) securities and only trade on two of them, with a fair bit of shorting, not sure whether you wanted that.
You're deliberately into leverage and that's fine. Just keep in mind that the chart and metrics calculations are based on initial capital and do not take into account the negative cash (~$140K), not quite what it appears there. more about that

Hi Gary,

I am not using any function to inject randomness. Its strange that you are seeing different results. Let me try and dig into it to see what's happening.

Hi Satyapravin,

 I am also paper trading this algo. I do see that account goes into negative cash. Is there a way to define max amount I can borrow. My initial capital is 100,000K but now I am  negative $142,170.20.

Thank you,

Change line

W[i] = W[i] / Wsum * 250000

To below:

[i] = W[i] / Wsum * 100000

This is very impressive! I'm just starting out here... is there any chance you could explain the reasoning behind some of your calculations/code?

Unfortunately it performs very poorly in other periods. I think it has to do with the "sign" of the trade but I haven't figured out how to compute the correct one.

The reasoning is that we regress the returns to come up with an AR1 model and then maximize the predictability but the more I think it seems to be a one off fluke backtest.