Closed thayes75 closed 1 week ago
Just a note, before I read in full. A dollar neutral portfolio has always cash position equal to 1. It is fully invested if its leverage is greater or equal than one. I know that cash accounting in Cvxportfolio is different than other portfolio optimization tool, we have developed a more accurate way to account for it in my opinion (read the self-financing condition in the paper).
Understood. I will look more into the accounting to see if I can get a better handle on it. The main problem is ensuring I've deployed, for example, 1MM long and 1MM short as a target outcome from a practical perspective.
So, if you want a 130/30 portfolio: cash should be 0 (use NoCash, not DollarNeutral). Leverage should be 1.6, so you fix that in LeverageLimit. I guess that's enough? That will give you a portfolio with 1.3 of capital employed in long holdings, and 0.3 in short holdings (assuming the leverage limit is hit, but you can make sure you do with appropriate risk penalization).
Other comments on your code: CashTarget
looks correct, you can use EqualityConstraint
if you want, but in any case it conflicts with DollarNeutral
, which requires the cash weight to be always equal to 1. The long notional limit is correct conceptually, there's a mistake (you'd need to use a CVXPY parameter and set its value attribute at each iteration). I think you can use direct CVXPY multiply function so no need to create internal parameter. But see my comment above, I don't think you need that if I understand what you're trying to do.
Appreciate the reply. Let me try it out and I'll revert back later today with the results
Just about to reply with little success. #181 looks like it might help. Happy to close this issue while the other one is open.
Forgot to close
Specifications
Description
The main problem I'm trying to solve for is a fully invested Long/Short, or 130/30 portfolio. I've tried several iterations employing the User Provided Forecasters example as a playground. Some potential implementations strategies I've tried include:
Indeed, most of the example plots always seem to have significant USDOLLAR holdings. In reading section 2.1 of the paper, the last paragraph mentions what I'd be trying to accomplish but I seem to be missing something on how the Cash Account is being used/managed.
How to reproduce
Additional information
Some example constraints I've tried to custom build (but don't work) include:
LongNotionalTarget Custom Constraint This one is getting the sign wrong but I provide it to help show my thought process.
CashTarget Custom Constraint As you probably guessed already, this is infeasible.
Output