High yield bond rotation screen --> simulation

Hey there. I’ve created a screen to replicate the strategy by Toma Hentea on SeekingAlpha. He’s basically using two timers and when they both go south, the portfolio moves from high yield / convertible ETFs to treasuries. I got it working on the SCREEN function, but when I copy the buy rules to Simulation, it gives me an error related to the ShowVar function. I’d like to get it in Simulation, so that I can put it into a book and see how it works with other strategies. Is ShowVar a function that only works with screens?

seeking alpha link → JNK: Momentum Strategies For A Bond Portfolio (NYSEARCA:JNK) | Seeking Alpha

Slightly Modified Rules:
Risk Timer #1: If UUP > DBB for last 77 days then risk off
Risk Timer #2: If XLP > XLY for last 77 days, then risk off
Rebalance: Weekly
Time period: 1/2/2008 to current

If both timers are risk on, then Tickers are -->CWB,JNK,ICVT,ANGL
If one time is risk off, then Tickers are → TLT,IEF,TLH,UST,TYD,ANGL
If both timers are risk off, then Tickers are → TLT,IEF,UST,TLH,TYD

Only 2 rules, hold top 2 ETFs based on last 100 days total return

showVar(@SFTY,(Ret%Chg(77,0,GetSeries(“XLP”)) > Ret%Chg(77,0,GetSeries(“XLY”))) + (Ret%Chg(77,0,GetSeries(“UUP”)) > Ret%Chg(77,0,GetSeries(“DBB”))))
Eval(@SFTY=2,Ticker(“TLT,IEF,UST,TLH,TYD”),Eval(@SFTY=0,Ticker(“CWB,JNK,ICVT,ANGL”),na) or Eval(@SFTY=1,Ticker(“TLT,IEF,TLH,UST,TYD,ANGL”),na))


I think you can solve this by using formulas instead of variables: under “Research” on the top of the P123 page, select “Formulas”. Then define a new formula, and refer to it in the simulation (remember to use a dollar sign before the name of the formula).

For simulation rules you want to use SetVar rather than ShowVar.

Thank you Yuval. The SetVar function allows the sim to work correctly.


scrichley, I am curious to see the results of your experiment. Will you let us know what you find?

I get 18% return with a better ranking system.


That’s a pretty attractive equity curve Georg. I just sorted by 100 day total return. Sharp ratio doesn’t seem to help either. I’d consider some kind of one week mean reversion as well, but would expect turnover to increase quite a bit. Other than that I don’t have any good ETF ranking system.


HY bond ranking.jpg

Why does this not work in a sim buy rule?

EVAL( Ret%Chg(80,0,#NONCYCLICALS) > Ret%Chg(80,0,#CYCLICAL),@bonds,@stocks)

This is supposed to buy bond ETFs when the return over 80 days of the sector NONCYCLICALS is greater than the return over 80 days of the sector CYCLICAL, otherwise buy stock ETFs.

I figured it: Rule should be:
EVAL(Ret%Chg(80,0,$SPALLCNS) > Ret%Chg(80,0,$SPALLCND),@bonds,@stocks)

This is actually a good market timer for risk-on and risk-off.
Works best with Ret%Chg over 77 days, same as in the referenced SA article which can only work from 2008 onward because of the inception dates of the ETFs used.

My timer works from April-1999 onward.


Very interesting, Georg - Can you share the formula you’re using to calculate 13 Week Growth Momentum? Thank you.