I have a trading system with a portfolio of assets (long and shorts) with daily market returns.

I want to overlay a risk management to my trading system that calibrate my portfolio positions on a daily basis so that a monthly portfolio loss of lets say 20% only occurs 1% of the time (i.e. 1 out of a 100 months).

I would be interested to see what the maths and calculations looks like so that the risk can be calibrated to the above condition.

Any suggestions ideas would be much appreciated.

Thank you!