This is my attempt at implementing STS (Seasonal Timing Strategy using MACD and seasonality) to buy/sell on the Dow (DIA) and when out of the market 1/2 of the time buying a bond etf. It seems so easy to buy and sell once a year and seems to work very well unless I'm missing something here.? When you run it before 2007 it does even better than buy/hold and almost doubles the CAGR due to avoiding most of the 2008-10 losses. I'm curious what methods people are using that are better than this one? Or did I make a mistake in the code.?
JayJayD
Nice algorithm!
The code seems right; I didn't come up with some detail that worth to make a change.
The 73% win rate is great, the problem is the drawdown.
Robert Hillman
THanks JayJayD. I modified it to improve returns although it didn't help with the drawdown, check this one out. Any ideas how I can simulate this since the ETF hasn't been around before 2010 and I'd like to see how it works with a bear market? Any suggestions on reducing the drawdown? 12x return in about 7 years. The seasonal trading STS method should reduce the drawdowns a lot compared to just hoding the UDOW. Also if you simulate the first project all the way back to 2000 it does pretty well through both downturns.
JayJayD
> Any ideas how I can simulate this since the ETF hasn't been around before 2010 and I'd like to see how it works with a bear market?
What do you mean by that? isn't the data available as security? If that's the case you can try with Qandl.
> Any suggestions on reducing the drawdown?
Use some kind of risk manager. I implemented one for Forex, but IIRC it can be used with stocks, the code is available in the DailyFx algorithm shared in broadcast.
Petter Hansson
UDOW has 3x leverage implied, but if trading on IB they will count this against your margin as if you had been 3x DOW yourself (and max portfolio leverage they permit overnight is 2x...).
Keep in mind these leveraged ETFs rebalance daily and so will suffer from decay where, even if the underlying instrument is flat after an up move cancelling a down move, the ETF will be down. If you intend to hold long term, it might be better to hold a non-leveraged ETF that you can rebalance manually using your portfolio margin.
Also, I wouldn't recommend tweaking algo for higher returns on the same data unless you have a sound explanation for why a given tweak should perform better. That is the path to curve fitting/over-optimization, which is arguably the most common problem in trading system development.
As for risk management, it is also a bit of a philosophical discussion as well as having technical aspects.
Robert Hillman
Thanks JayJayD and Petter for your comments. This method was written in 1999 by Sy Harding called "Seasonal Timing Strategy" (STS). He wrote the book "Riding the Bear" that was published in 1999. What I find amazing is that since then the returns with such a simple method are pretty darned good (I'm using it for my IRA). See backtest below. This is just with DIA and unfortunately the ETF i'm using for 'bond' in the off season wasn't around till 2003 so it would do better than this i just didn't have an easy fund to put it in back then. Also the 'drawdown' I don't think is a totally fair comparison of risk. If you look at each years performance, the STS method never lost more than about 7% in any year back to 2000. It is true you are fully exposed to the full volatility of DIA for 6 months, but those are the favorable 6 months, and you get much higher returns being OUT of the market the unfavorable 6 months and drawdowns in favorable seasons seem to rebound quickly. Know of any easy methods that would work better or similar to this, I'd love to pair this with another method that combined might reduce drawdowns and risk further.
Robert Hillman
Also if this algorithm is only better than 46% of the community and this is ranked 238,137 , and my other algorithms that do very poorly are ranked more like 44%, so i'm not sure how the ranking is working. And creating an algorithm to backtest knowing we were already in a long bull run seems to me can't be fairly compared to an algorithm like STS which has been around before 2000. How does one truly rate their algorithm fairly?
ForeverYoungNow
amazing @Robert Hillman
Jared Broad
The ranking formula is fairly arbitary; but combines sharpe and drawdown. The rank is "238,137th equal" -- there are millions of algorithms.
Its also fairly sharply skewed so a small improvement should help your rank jump. Really though you should judge your algorithm based on your own financial goals.
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Robert Hillman
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!