Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
changed Wassaf's long-term algo to use an ETF

I cloned Wassaf's long-term hold algorithm that he used on EMC. I wanted to see how it did with a full technology ETF.

The answer is: not good.

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.

10 responses

Wow, strange that it didn't make such a difference.

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.

@Dan Dunn - in all of this backtesting, are you using mid-point or bid-ask data?

We're doing something a bit more complicated. We're doing the backtesting off of minute bars. Each bar has a high, and a low, and the volume. When you place the order, we look at the close price on the following bar (to avoid look-ahead bias). We look at the size of your order and the size of the volume traded. Depending on their relative size, we adjust the price according to your order - price is higher if you're buying, lower if you're selling. And, we cap the amount of the volume that capture on any minute. Larger orders therefore take longer to fill, and at a higher price.

@JJ, great question. Similar questions about the simulator came up in a separate thread, and I provided an explanation and links to the simulator source code. You might like to have a look at the discussion there.

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.

ohlc (open high low close) is not the same as bid ask. google level 2 data

and the first hit is Ernest Chang, what a surprise!

Quite right that bid/ask data is different from minute bars. We're driving the backtester off bars, not bid/ask. I was trying to say that we're doing something more complicated that the mid-point of a bar.

The real test of course is going to be how the backtester compares to real trading, once we have that enabled.

why are you trading every other minute(?):

"data[stock].datetime.minute % 2 == 0"

@vishal - because even minutes have a higher rate of return (j/k)

I did it in my original algorithm so that I could simulate a consumer buying and selling without going into negatives (no shorting). Since trades execute on the minute after you order them and the algorithm doesn't want to go into a negative cash balance, the easiest way was to just trade every other minute.