Regression formula in Hedge module not working

I use this formula to enter a hedge:

LinReg(`SMA(6,CTR,getseries("CAPE-MA35")`,10,1) & SLOPE < -0.1 & r2>0.8

and LinReg(`SMA(6,CTR,getseries("CAPE-MA35")`,10,1) & SLOPE > 0.1 & r2>0.8

This worked for several runs and suddenly stopped working. No error is reported.

Georg, Is the Aggregate Series in good standing and up to date?

Your LinReg is malformed - try;
LinReg(`SMA(6,CTR,getseries("CAPE-MA35") )` ,10,1) & SLOPE < -0.1 & r2>0.8

Yes, the series is good. Check the methodology used, it works great.

https://seekingalpha.com/article/4833530-im-cape-ma35-etf-rotation-strategy-with-4-etfs

1 Like

Walter, I don’t see the difference.

There are two parentheses after "CAPE-MA35"
I had a typo, too. Fixed now.

That is what I have in the hedge rules:

Can you check LinReg() in the screener and make sure it’s not returning a NA?

Works fine in the screener. No ranking. Returns annualized 28% with all the Tech stocks (about 80) of the universe during Uptrend, and switches to gold streamer RGLD for Downtrend periods, all as defined by the slope of the 6-mo moving average of my monthly CAPE-MA35 series.

Georg, I sent you a message via the forum.

I got it working by using a custom formula for the full LinReg() in the hedge module. Strange that the hedge module did not like the LinReg() in its rules.

It is strange. Would you be open to providing a portion of your GetSeries() for me to test? Maybe a monthly period?

It is a monthly period series because the Shiller CAPE is monthly. I have no idea why the hedge module does not like the complete LinReg(), but it is happy when I give it the LinReg() via a formula.