ETF Weight Scaling?

OK - I just went back and tested the original problem and it works correctly now. So the problem was probably addressed sometime in the last year. but was not mentioned on the post for the reported error.

Sorry for the confusion. The world is as it should be.

SteveA

Georg:[quote]
In my opinion, market timing formulas are in principle similar to ranking system for stocks. Evaluating the economic environment with numerous measures is not much different to evaluating the likelihood of a stock performing well with various factors. That is why I don’t share the opinion of many that market timing does not work.
[/quote]
I heartily concur!

The one major difference is the odds. The odds that a stock will increase in price is a little under 50%. The odds that the market as a whole will go up over the next month is over 60% (63%, to be precise). So if you get your stock-ranking factors all wrong, you still have an almost even chance of doing just as well as the market as a whole. But if you get your market-timing factors all wrong, your chance of underperforming buy-and-hold is over 60%. As C. Thomas Howard writes, “since there is a 63% chance next month’s return will be positive, you must correctly forecast at least 63% of the months in order to increase your return relative to buying and holding. Research shows such accuracy in forecasting is very difficult to achieve.” (From his book Behavioral Portfolio Management)

I certainly won’t say that market timing is a fool’s errand or impossible. It’s just that it’s hard to do well, and, in my opinion, riskier than stock-picking.

I also don’t want to say that you’re doing anything wrong, Georg! I’m impressed with your work, and I know that a) you’re doing more than market-timing with your ETF selections and b) the goals of market-timing may be to decrease variability rather than to increase returns. I for one certainly have a lot to learn about market timing. But I did want to point out the difference in odds.

This is all my opinion, and not the opinion of P123. We are committed to helping both stock pickers and market timers here.

Yuval, the odds you quote are correct.

But for people who are not too greedy they can follow a simple S&P500 momentum strategy with equity (RSP) and fixed income (IEF). Nothing spectacular or unknown here. Everybody is familiar with the 50-200 golden cross, and I have added a shorter term 10-40 momentum as well.

Buy1: ticker(“rsp”)&(sma(50,0,$SP500)>=sma(200,0,$SP500)|sma(10,0,$SP500)>=sma(40,0,$SP500)) | ticker(“ief”)

Sell1: ticker(“rsp”) & (sma(50,0,$SP500)<sma(200,0,$SP500) | sma(10,0,$SP500)<sma(40,0,$SP500))
Sell2: ticker(“ief”) & (sma(50,0,$SP500)>sma(200,0,$SP500) | sma(10,0,$SP500)>sma(40,0,$SP500))

P123 ranking system: ETF Rotation - Conservative
Variable slippage
reconstitution and rebalancing weekly
Weight formula = 1

From Jan-99 to Nov-2019 this model shows an annualized return of 14.70% with a max D/D= -19.0% and Sharpe= 1.41.
Standard Deviation 8.73% vs 14.40% for SPY.

It would never have had a loss over any of the 20 calendar years. If one ran a fund based on this simple model you would have made a lot of money, because I don’t know of any fund manager doing better than this. Also there were only a total of 155 realized trades in this 20-year period.

That is why I don’t share the opinion of many that market timing does not work. You can add this model to your Portfolio123 Models lineup, if you wish - it will not disappoint, a lot less riskier than stock-picking.

year … return %
1999 … 6.27
2000 … 14.39
2001 … 11.26
2002 … 14.62
2003 … 39.39
2004 … 12.16
2005 … 17.94
2006 … 15.82
2007 … 10.61
2008 … 24.90
2009 … 16.65
2010 … 13.52
2011 … 3.46
2012 … 11.79
2013 … 33.48
2014 … 8.26
2015 … 11.34
2016 … 8.84
2017 … 15.36
2018 … 11.62
2019 … 11.04


Georg -

I tried to replicate this but got crap. See below. What am I doing wrong?

  • Yuval

Screenshot_2019-11-22 Simulated Strategy Trading System - Portfolio123.png


Yuval,
I made visibility public. No need to hide it - I have much better models than this in my lineup.
Also, I reduced number of trades by holding RSP for at least 3 weeks because of the odds you mentioned.

https://www.portfolio123.com/port_summary.jsp?portid=1590919

Thanks, Georg! I see my error now: I had “Allow Immediate Buyback” set to “No” instead of to “Yes.” Silly me!

Happens to me as well. Then one wonders why one gets nonsense.

BTW, look at my 5 pos small-med cap sim (MktCap > 130 and <1,800 and Price > 2). It uses some modified buy rules from your Small Cap Winner screen rules, which you recently posted. Uses, apart from the main ranking system, three other P123 ranking systems, two of which require the buy rank to be higher when my “$comp” market timer signals down-markets for stocks. Perhaps, this is another way to use market timing successfully.

Eval($comp<50,Rating (“Core: Sentiment”) > 75 ,Rating (“Core: Sentiment”) > 35)
Eval($comp<50,Rating (“Core: Quality”) > 65 ,Rating (“Core: Quality”) > 50)

This model shows an annualized return of almost 70%, max D/D= -32% (with Andreas’ market timer), and reasonable turnover of 490%. From Jan-2004 to Nov-2019 the initial investment of $10,000 goes to $43.6-million, with variable slippage.
I will launch it soon as a DM so we can watch it.


Hi Geov,

Thanks for providing an example.

What does " | " mean in your rules (it’s not listed in the P123 syntax)?

Thank you

Scott

Hi Scott,

I am sure someone will correct me if I am wrong. But it seem to mean the same thing as it does in python. It means “or” (actually the “bitwise or”) and it will give you the union. Just like “&” is the bitwise “and” that gives the intersection.

-Jim

“|” stands for “or”. It is useful when a rule is very long - one can then shorten it with “|” and “&” symbols.

For reference the Small Cap Winners screen is here; https://www.portfolio123.com/app/screen/summary/232655

Good that you posted it again.
BTW all the ranking systems used in my Small Cap Winners sim are public or have been posted in the forum. I changed nothing in them.
Attached are trading stats.
Note that Total Trading Cost / Ending Market Value = 8.5% which comes from variable slippage.


Georg, I appreciate your posting these ETF models. I have not used market price trends for timing but the results you show, with the elimination of online commissions allowing greater turnover, makes me take notice.

In duplicating your RSP versus IEF model using crossover timing, I rewrote your buy rule in a way that should be equivalent but the results are not nearly the same. Can you, or someone else, point out why these rules are not equivalent?

Your buy rule:
ticker(“rsp”)&(sma(50,0,$SP500)>=sma(200,0,$SP500)|sma(10,0,$SP500)>=sma(40,0,$SP500)) | ticker(“ief”)

My rule that is meant to be equivalent:
Eval((sma(50,0,$SP500)>=sma(200,0,$SP500))|(sma(10,0,$SP500)>=sma(40,0,$SP500)),ticker(“rsp”),ticker(“ief”))

I equate your buy rule to a generalized statement like:
ticker(x) AND (truth OR truth) OR ticker(y)

and I equate mine to a generalized statement like:
Eval((truth) OR (truth), ticker(x),ticker(y))

To me, both forms should be equivalent but the resulting transaction dates are very different. Please, what am I overlooking?

The rules are not equivalent.

Rule 1 says that if either of the moving avg crossovers (MACs) exist then the model can buy RSP or IEF, depending on the rank in the Ranking System, or if neither of the MACs exist then the model buys IEF.

Rule 2 says that if either of the moving avg crossovers (MACs) exist then the model must buys RSP , or if neither of the MACs exist then the model buys IEF. Rank is not considered.

If you want to use the Eval statement, then the buy rule eqivalent to Rule 1 would be:
Eval((sma(50,0,$SP500)>=sma(200,0,$SP500))|(sma(10,0,$SP500)>=sma(40,0,$SP500)),ticker(“rsp,ief”),ticker(“ief”))

Thanks for the explanation, Georg. I learned something!

Georg,

For the ETF model RSP-IEF → Great model considering the returns for something with so few trades and only 2 ETFs. I am thinking of using it for my “base / limited risk” portfolio in combination with an ETF model of mine. I prefer to use several simple models combined in a book rather than a super-convoluted one.

Do you remember when you first designed it and therefore for how long has it been running “live / forward testing”. My thoughts: you cannot be finger pointed for possible hindsight on sma(50,0,$SP500) versus sma(200,0,$SP500) - it is too well known / standard for that- but I do not think that the sma(10) vs sma(40) is that commonly used.

NB: as a possible improvement, it might be worth testing adding a layer of seasonality (e.g. summer = underweight RSP and overweight IEF). You might have already tried that.

For the 5 small caps model, if you make it a DM, could I suggest making it a 10-stock DM? You might go from 70% AR down to 60% but -for one- I would be interested in a 10-stock model but not 5.
Also at 60% AR, who needs more?

Jerome

Jerome, you just need a long and a short MAC such as 10-40, 5-40 even works better.
Best to keep it simple, an annualized return of 15% over 21 years is excellent, and also only positive returns for each of the 21 calendar years.

One can get a 15.55% annualized return by just relying on the ranking system and the sell rules.

Buy rule is just:
ticker(“rsp,ief”)

Sell rules:
ticker(“rsp”) & (sma(50,0,$SP500)<sma(200,0,$SP500) | sma(5,0,$SP500)<sma(40,0,$SP500)) & NODAYS>17
ticker(“ief”) & (sma(50,0,$SP500)>sma(200,0,$SP500) | sma(5,0,$SP500)>sma(40,0,$SP500))

This simple model out-performs all of the 7 Large-Cap P123 stock models for which performance is shown from Dec-18-2006 to Nov-22-2019.
https://www.portfolio123.com/app/investment/add-new?browse=1&step1=SS&sst=1

For the RSP-IEF model from Dec-18-2006 to Nov-22-2019 Total return= 477%, annualized return= 14.52% and max D/D= -19.0%, and only 81 realized trades over this period, which translates on average to only one buy or sell trade per month.
So who says market timing does not work?

I spent the last 30 min looking at the intricacies of the simpler system - the one with the 2-ticker buy-rule

  1. It uses EPS uptrend / downtrend as well as ERP to determine how to rank (NB: this implies that in a market of “irrational exuberance” where the ERP is small with people insensitive to risk, it will trail the market as it goes into the safer asset = IEF).
    I would actually use EPSCNY and not EPSCY to have a constant smooth forward EPS estimate

  2. Every week, the system will give (or not) a chance to the ranking system to reevaluate the EPS trend and ERP status and subsequently possibly change the ETF. This opportunity to reevaluate is given (or not) based on the price momentum of the SP500

There is some logic to the above approach (one is “economic”, one is price momentum driven). They both look forward (EPS is forecast) if we assume that momentum is likely to continue (as demonstrated in the litterature) so that a trending market will continue trending … till it stops.

However the hidden key is that it uses RSP as a big contributor to the perf. To really judge the validity of the timer, I replaced RSP by SPY. Unless I made a mistake it becomes less interesting (~12% AR) but still not bad at all. It still beats SPY but this is because it avoids the 2 major recessions which possibly might be doable just with the price moving averages. One might also test with IEI or SHY instead of IEF, just to avoid the benefits of the (very) long drop in interest rates since the early 80’s and see what we get. Who knows what interest rates will do in the next 20 years.

This was a bit of an unstructured post. In summary, I am not quite sure what to make of this as a timer. Maybe the best is what you already did elsewhere Georg i.e. put it together with a bunch of other timers and do a majority vote

Jerome

Jerome,
Use this buy rule: ticker(“rsp,ief,spy”)

The system will now buy RSP OR SPY depending on the rank.
I have added a VIX sell rule - Annualized return now 17.0%, but more importantly it outperforms SPY from 2009 on as well.