Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
help with etf pairs trading algorithm

Hello forum,
I created this horribly simple algo since i am still fairly new to trading and programming, my english might aswell not be flawless since i'm not a native speaker :/
This algorithm is supposed to enter a dollar neutral position as soon as the discrepancy of the two etfs exceeds the discrepancy of the 30 day moving averages multiplied by two and sell when the discrepancy has decreased to less than 1,2 times of the 30 day moving average discrepancy! Also trades should not be executed when the cash supply is zero.
According to the backtest something went terribly wrong, help would be much appreciated!
thaks in advance
Jakob

4 responses

here's the algo

Hi Jakob (and anyone else viewing this thread):

I was investigating why the backtest widget wasn't loading, and it turns out that this backtest is still running. Turns out that when you click "Add Backtest" when replying to a thread, we erroneously let you attach a backtest that's still running.

Sorry about that, and we'll fix that bug soon.

Once the backtest is done, it'll start loading in the thread here.

thanks,
Jean
Quantopian

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.

Thank you Jean, I appreciate it!
Regards,
Jakob

Hi Jakob,

Would you mind posting your backtest again? It seems you ran into a bug and it didn't get posted properly the first time. Then we'd be happy to help out!

Thanks,
Alisa

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.