This is the approach I use in one of my accounts where I have a shorter investment horizon and I might want to tap into some cash at some point for whatever reason. This account is not what I use to live on, so I want a better return than the ~3-5% or whatever I could get in a money market or treasury bill. I want to be in equities to beat inflation, but I want to err on the side of preserving capital over maximizing alpha in this particular lump of money. I gradually blend in and out of market exposure based on a collective sample of risk flags rather than risk getting whipsawed by an over-reliance on 1 market timing factor.
Let's say you have 5 risk signals. Create an Eval function for each signal that raises a 0 or 1 flag for each of them.
So in this case we'll use unemployment rate as a risk flag.
$Flag 1 = Eval(EMA(2,0,#UNEMP)<=EMA(2,3,#UNEMP),0,1) //Unemployment Risk Flag
If have four other risk flags like this, so then aggregate all 5 market risk flags out into one cash position Function ....
$CashPostion = $Flag1 + $Flag2 + $Flag3 + $Flag4 + $Flag5
Let's say hypothetically In a perfect risk on environment I wanted to go 90/10 portfolio of equities/cash. In total risk off environment I wanted to go 60/40.
In my portolio Buy Rules utilize the CashPct function
Eval($CashPosition=0,CashPct>9,Eval($CashPosition=1,CashPct>14,Eval($CashPosition=2,CashPct>19,Eval($CashPosition=3,CashPct>24,Eval($CashPosition=4,CashPct>29,Eval($CashPosition=5,CashPct>34,CashPct<39))))))
Reverse the operand logic n the Sell Rules...
Eval($CashPosition=0,CashPct<9,Eval($CashPosition=1,CashPct<14,Eval($CashPosition=2,CashPct<19,Eval($CashPosition=3,CashPct<24,Eval($CashPosition=4,CashPct<29,Eval($CashPosition=5,CashPct<34,CashPct<39))))))
One could break out the Carlos Risk Meter into individual components and blend in and out of cash as each one of them flips.
Of course you can put the cash position into whatever risk off hedge you wish. But just in the spirit of the simple heuristic "The best way to hedge is to own less of the thing you want to hedge against" it does the trick.