# The only market timer you need

For those who are interested here is my Stock-Gold timer backtested since 1967.
https://seekingalpha.com/article/4396238-stock-gold-switch-signals-from-yield-curve-and-federal-funds-rate

The exit rule from the stock market prior to recessions based on three rates is in P123 syntax:
LoopSum(“(SMA(5,CTR,##UST10yr)*5-SMA(5,CTR,##UST2yr))/(SMA(5,CTR,##UST10yr)4)=1.000",10,1,1)>=5 & loopsum("sma(20,CTR,##FEDFUNDS) < 1.00sma(100,CTR,##FEDFUNDS)”,10)>=5

The re-entry formula is a bit more complicated. Perhaps someone can do better than me. See Figure-2 in the article for the 1999-2020 performance of S&P500-Gold modeled in P123 which produced an annualized return of 17.7%.

1 Like

Hi Georg, no need for switching in and out of gold:

gold has beaten the S&P500 since the year 2000!

PS: how does the timer fare when the yield curve goes negative?

GOld has serious drawdowns on its own. Georg - your timer looks awesome.

That is the whole point of this timer. It is based on the yield curve getting inverted prior to recessions - 8-times since 1967, and 3-times since 1999.

Thank you for the code Georg! I’ve been trying to get the two halves of the sell rules to compute in Port123, but I can’t get the one half to run without an error. Any ideas on the error?

This runs ok → LoopSum(“SMA(20,CTR,##FEDFUNDS) < SMA(100,CTR,##FEDFUNDS)”,10) >= 5

Getting an error on this half → LoopSum(“(SMA(5,CTR,##UST10YR)*5-SMA(5,CTR,##UST2YR))/(SMA(5,CTR,##UST10YR)*4) < 1.000",10) >=5

I changed the = 1.000 to < 1.000 at the end of the original formula…

I’m looking to put together 4 or 5 different effective market timers to build a book with a very smooth low max DD equity curve…

Make sure all of your quotation marks are straight instead of curly, and that they’re all double quotation marks rather than 2 single ones. Perhaps that’s the reason for the error.

Thanks Yuval. I would have never found that! Just need to nail down the buys rules and get this sim working correctly