Coding for ETF Model

wwasilev, many–if not most–great discoveries happened by accident including antibiotics and rubber.

George and Tom, you can find the series ID of any series by using ShowVar in the screener.


After sleeping on it, I realized a few things:

  • The second version (and wwasilev modification with #NOTE3YR) needed updated rules because of the changed RS. I corrected my public simulation. The corrected version has better drawdown but lower returns. The corrected version of wwasilev’s system is here.

  • A chart of Close(0,#NOTE3YR)/Close(63,#NOTE3YR) in the screener (the # of stocks in the chart below) shows that it happened to spike during the financial crisis. That may explain a lot. The bar was set much higher just at the right time. Any good hedge timing system would probably have done well.
    (Parenthetically, it is interesting that short term rates spiked when they were needed to go down. That needs more investigation.)

  • Tom’s Custom Series is useful for new research but (I think) that it uses the daily time series of the interest rates which is not directly useful to analyze why the simulation worked.

  • I shared my results. If you discover anything directly from this research please let us know. Thank you.


Chipper,

I would not use a comparison of an ETF’s 2 month movement with the 5 year change in the yield on the 3 year note for much of anything. It’s a spurious correlation. There is no reason to expect this to be an effective short-term timing mechanism moving forward.

Can look up bond / stock correlations, I’ve posted these before. These aren’t stable over periods. The above is much less causally related then stock/bond pairings.

There are many timers you can build with the series I shared that at least have a stronger conceptual foundation. You can reset rebalance to weekly. These are the same data series the eval rule in your sim is using. You can look at them directly here.

Best,
Tom

Tom, I wouldn’t either. But for the purpose of taking apart the simulation and studying why it happened it was useful to me to study the original data. That’s how I learned that most of the value of that benchmark came from hedging the financial crisis, which points the way towards further improvements.

Stock/bond correlations vary. I did some research on this. Off the top of my head I seem to remember that stocks/Treasury bonds had negative correlations during bear markets and market corrections since 1987 but before that it was gold that was negatively correlated to stocks (my data goes back to the late 1960’s).

Chipper, so what is exactly the syntax to use?
Thanks

George,

  1. Create a new screen.
  2. Click ‘Add Free Form Rule’:
    ShowVar(@TLT, GetSeries(“TLT”))
  3. Click ‘Run Screen’.
  4. Select Report: “Screen Factors”.

You often have lots of good ideas. Please let us know what you come up with. Thanks.

In the sim sell rules if you are trying to target Friday with WeekDay = 5 then it should be WeekDay = 6. Sunday is WeekDay = 1 not Monday.

KJ

Thanks Chipper, nice trick to get the series id numbers.

Azinvestor,

That’s what I though too until I did a bit of debugging. It’s because Friday’s trades use Thursday’s data.

Chipper,

I played with this for an hour or two. I got to 15.5% returns with no buy rules and just the ‘risk on’, ‘risk off’ original ranking you had (comparing 3 months of LT treasuries to 3 months of everything else and using this as the ‘macro’ riskon, risky off switch. There is also something funky going on in the end of the month that your sell rule captures - that contributes a few % to the returns.

I actually did add one buy rule related to this.

So…this version has no signals with 3 Year note at all. This is much closer to tradable.

At first I thought that the ST interest rate surges (as price fell), were giving a nice ‘hurdle’ for every other equity instrument to have to be above - so a dynamic ‘momentum’ threshhold that makes it harder and harder to buy an ETF as the market surgest. However, this didn’t really prove to be the case.

I still think it’s a ‘spurious correlation’ type deal.

Best,
Tom

Chipper, would you mind posting your formula for $EOM?

Thanks much!
Zvi

Hi Zvi,

EOM:
InSet(Month,1,3,5,7,8,10,12)*31 + InSet(Month,4,6,9,11)*30 + ((Month=2)*28)

I had to revise the daily simulation again. This time I tested it first in the screener for accuracy. Sorry about that.

Thanks Chipper!
Zvi

Hi Chipper, Sorry, but where is the latest model?

Thanks,

Walter

Here it is.

Thanks!