I think you are somehow using returns as a surrogate for volatility. PV doesn't report volatility, so you need to externally pull down the daily returns and calculate the standard deviations yourself.

For those looking for the Excel approach (consider Google Sheets too, which directly downloads returns):

Formulas for one-month lookback when

- column A is UPRO daily adjusted price
- column B is TMF daily adjusted price
- one trading month (21 days + 1 end of last month) are rows 2 through 23
- targU is a target annualized volatility

Construct new columns C and D for daily returns

C3 = (A3/A2) - 1, C4 = (A4/A3) - 1, ...

D3 = (B3/B2) - 1, D4 = (B4/B3) - 1, ...

If working with downward-only volatility (some like this measure) replace with

C3 = IF(A3<A2,"",A3-A2)

Calculate annualized volatility

SDU = stdev(C3:C23) * sqrt(252)

SDT = stdev(D3:D23) * sqrt(252)

(the sqrt(252) is only needed to match target volatility)

rSDU = 1/SDU

rSDT = 1/SDT

Risk parity (volatility):

fracU = rSDU/(rSDU + rSDT)

Risk parity (variance):

fracU = rSDU^2/(rSDU^2 + rSDT^2)

Target volatility:

fracU = min(targU/SDU, fracUmax)

where fracUmax is the maximum UPRO fraction allowed (e.g., 0.8)

In all cases

fracT = 1 - fracU

The risk parity formulas assume that UPRO and TMF are both assigned half of the risk budget. One can also adaptively change the risk budget, perhaps based on the unemployment rate index (UEI).

Assume the fraction of risk assigned to UPRO is riskfracU.

While UEI is falling (signal for non-recession), perhaps riskfracU might be 0.7 or 0.8, and while UEI is rising and accelerating (signal for recession), perhaps riskfracU might be 0 to 0.3. Adjusting riskfracU step by step over several months may lessen whipsaw.

Risk parity (volatility):

rSDU = riskfracU * rSDU

Risk parity (variance):

rSDU = sqrt(riskfracU) * rSDU

I think these are right, folks with more experience please confirm so I don't inadvertently mislead.

Edit: Of course I was wrong right and left to start. That's what I get for doing this off the top of my head. Thanks OCRtech. I've fixed the formulas above.