Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
APT&Pairs Trading by PCA between SPY and 10 US market sectors

Hi All,

Nice to meet you. I'm new here. I really love the Quantopian Community. I have designed an algorithm using the strategy both of APT and Pairs Trading by PCA. For it's my first time here, the result is not robust. Thanks for any suggestions.And Thanks a lot for Delaney's suggestions about my first algo here.

3 responses

Hi Sihan,

Welcome to Quantopian! It looks like you're off to a good start. I do have a couple of pointers for you:
1. Try recording your strategy's leverage by adding adding context.account.leverage to record().
2. My suspicion is that you're highly leveraged. Sometimes, orders can take time to fill so you might be placing multiple orders before your original order filled. You can track your open orders using get_open_orders() - make sure you're not making duplicate orders.

Keep up the good work!

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.

Hi Jamie,

Thanks a lot for your points. I have simply tripled my order so the leverage is so high, for I haven't found a better way or method to decide how to place orders. I will work on it and find a smarter method to place orders.

Hi Sihan,

Check out this tutorial on ordering securities, and try out the order_target_percent() method!