Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions on accounting model (e.g., for short positions) #131

Open
pcgm-team opened this issue Feb 1, 2024 · 3 comments
Open

Questions on accounting model (e.g., for short positions) #131

pcgm-team opened this issue Feb 1, 2024 · 3 comments
Labels

Comments

@pcgm-team
Copy link

Why is there the check:

        v = np.sum(h)

        if v < 0.:
            raise DataError(
                f"Holdings provided to {self.__class__.__name__}.execute "
                + " have negative sum.")

In the case where you are holding primarily short positions, shouldn't the optimizer handle that?

@enzbus
Copy link
Collaborator

enzbus commented Feb 1, 2024 via email

@enzbus enzbus added the question label Feb 1, 2024
@enzbus enzbus changed the title Calling Policy.execute() broken with short positions. Questions on accounting model (e.g., for short positions) Feb 1, 2024
@pcgm-team
Copy link
Author

I suppose I'd misinterpretted the cash to be free cash.

@enzbus
Copy link
Collaborator

enzbus commented Feb 2, 2024

Cvxportfolio's (the paper's) accounting model uses the self-financing condition, all asset purchases have a corresponding cash decrease, and sells have a corresponding cash increase. For example, if you start with $1M in your brokerage account, buy $1M in a long positions and sell $1M in a short positions, in our accounting your cash account has still 1 million, the weights vector is (1,-1,1), the portfolio value (sum of h) is one million, leverage is 2. Any fees associated with shorts or margin are to be modeled by HoldingCost, both in optimization and simulation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants