Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help & Feedback on Basic Algo

Hey Quants,

Have a pretty simple strategy I'm working on. 3 core stocks: TMF, UPRO, and VYM.
50% to UPRO
25% to TMF
25% to VYM

This is a long term strategy with rebalance every 365 days. I've somewhat hacked the code together (still learning). There's a big pull back May 17th 2015 which is actually due to a 2:1 split on UPRO.

Here are my questions:
1) I would like only UPRO and TMF to to rebalance, whereas I'd like VYM to reinvest dividend yields into itself. Any guidance on how to do this?
2) Does it make more sense to rebalance every quarters vs. year?
3) Is this even a reasonable gain? Seems a little too high so wanted to get a gut check.

I'm striving to get a long term strategy with a balance between hedging against down turns, taking advantage of the S&P gains, and also modest dividend generation. I would also greatly appreciate any feedback or ideas on what I have. I'm still fairly new and learning, so constructive feedback would be awesome. Thanks!

2 responses

if the pullback is caused by the split then you have to report it to Q as that is an error

When it comes to the bench mark, you might want to take a leveraged benchmark you want to beat rather then the unleveraged SPY. Maybe set_benchmark(symbol('SPXL')) ?

returns seem in line with this type of risky strategy with high DD. next to the print error on the split there are other DDs in the 20's

I would also make the allocation more dynamic based on the market regime

Hi Ryan,

We are aware that URPO wasn't adjusted for the split in May 2015 - we're still digging into this one. We'll let you know once it's fixed in the backtester.

In your algo, I'd suggest to use schedule_function to handle the days and times you'd like to trade. Here are the docs in case you haven't seen them: https://www.quantopian.com/help#ide-schedulefunction

And if you'd like to begin developing a strategy for our hedge fund, here are some more things to add:
1. Simultaneously take long and short positions to hedge your strategy
2. Lower your beta to be between 0.3 and -0.3
3. Trade a dynamic universe of stocks instead of hard coding several securities. Select your universe by using fundamental data, DollarVolume, or choose a large bundle of tickers.

Then enter it in the contest and see how your algo stacks up against the competition.

Cheers,
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.