Variable Hedge-Ratio

Hi there!
I’m trying to use an imported Data Series with values between 0 and 1 to set the exposure of a Simulated Strategy dynamically, but cannot find a way to do it. Does anyone know how such a functionality could be backtested?

The closes feature I’ve found are Exposure Lists within the Research tab. From what I understand, they are binary, whereas I would like to allocate moving percentages.

If “moving percentage” means that you want to vary the percentage allocated to stocks vs cash in the strategy, then I dont know of any way to do that.

The closest functionality would be to use your imported data series in the strategies hedging rules. There doesn’t seem to be a way to control the cash %, but you could use short term bonds instead. These settings cause the strategy to sell 50% of the stocks and put that money in short term bonds based on my “recessions” series which consists of 0s and 1s:

I had margin turned off. If you turn margin on, it wont sell any of the stocks and just uses the margin to add the short term bonds.

I don’t know of any way in P123. But it shouldn’t be too difficult to download the equity curve into excel and then add your column with % exposure. Have a column of % daily return and multiply that by your exposure. It isn’t the best approach and it would be better inside P123 for sure. Especially if you have to start calculating stats like Max DD, CAGR, Sharpe and so on inside excel.

If I can assume that if your data series is 1 you’re fully invested and if it’s 0 you’re in cash, and if I can assume that your portfolio will hold, say, 50 stocks if you’re fully invested, 25 if you’re half invested, and none if you’re in cash, and if your imported data series is called ##exposure, then you could set your ideal size of a new position to 2%, add the buy rule ` RankPos <= 50*##exposure `, and add the sell rule ` RankPos >= 50*##exposure ` (make sure to make it an “and” rule or append it to any other sell rules). Then the portfolio will be in cash when your data series is 0, be half in cash when it’s 0.5, and be fully invested at 1. And you won’t have to reduce all your positions accordingly, which is a nice bonus.

That is a clever workaround! Ideally, I would like to change the size of the new position, but this is an excellent second-best!
Thanks, I really appreciate you taking the time!

That’s a great approach! I would have to replicate a few of the output metrics of portfolio123 in Excel, but it is doable!
Thanks a lot for the solution!

1 Like