Back

ETF Region Rotation Strategy

Hi together,

I am referring to a research paper by Gary Antonacci, available for free here: http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1833722

Gary suggests to perform a rotation between regional ETFs, Gold and Treasuries:
IWB, IEV, EWJ, EPP, IEF, SHY, GLD

He suggests to determine the 6-Months-Momentum (e.g. about 120 days) and rebalance the portfolio every month by buying 2 or 3 ETFs with the highest Momentum(120d). He writes about annual returns of 15-30%.

My search in the forums and the help function yielded no results for this specific problem.

Could someone provide me with some help how to code this rotation strategy for backtesting? Unfortunately I am an absolute beginner to algorithmic programming and Python, but willing to learn. Some help at the start nonetheless would be great!

Thanks so much in advance, and sorry for my bad English - I am from Germany.
Best wishes,
Stephan
Update Backtest








Hey Stephan! Checkout this algorithm I shared a couple weeks ago. You can use it as the skeleton to create your own strategy. I've updated it to have a real Momentum indicator. This momentum indicator is the n-period percent change in the security. Also, in this algorithm I'm using a weighted average of the 30 day and the 90 day momentum to determine an objective score. Feel free to clone and modify to suit your needs!

If you have any specific questions on how to modify this please feel free to ask here!
1


Michael, where can we find the algorithm you talk about in your post ? There is no link in your comment or in your profile under the 'shared algorithms' section :-(
0

Hey Helmuth! In my post above there is an 'Edit Algorithm' button. Clicking this will clone the algorithm and allow you to run/edit it.
0

Thanks Michael. I 'discovered' it just after asking in my comment :-)
0

Hey Michel,
It's giving me a some errors trying to run this code, I think the new updates to LEAN broke this code. Unfortunately, I'm such a novice at C# and LEAN, I don't even know where to begin fixing the errors. For example, the first one says:

WindowIndicator takes one argument

I tried changing public class Momentum : WindowIndicator
to public class Momentum : WindowIndicator
or
public class Momentum : WindowIndicator
and it didn't work, I'm not sure what else to try.

there are some other errors, like

'WindowIndicator.WindowIndicator(string, int)' is inaccessible due to its protection level
: base("MOM" + period, period)

Operator '*' cannot be applied to operands of type 'decimal' and 'Momentum'
return (weight1 * OneMonthPerformance + weight2 * ThreeMonthPerformance) / (weight1 + weight2);

but no luck. If you have the time and energy, it would be really helpful to share how we can fix these problems.
Thanks,
Nate
0

Hey Nathan, this code is pretty old, from before we released our indicator library. So the compiler is complaining about Momentum being redefined as it's now included as part of the product

I've attached a new version which just removes the Momentum file.
1

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.


Update Backtest





0

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.


Loading...

This discussion is closed