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

feat: Portfolio to have a get_weights() function or something similar #169

Open
0xJepsen opened this issue Dec 21, 2023 · 1 comment
Open

Comments

@0xJepsen
Copy link
Contributor

Idea

I am interested in measuring the performance of a variety of rebalance strategies (threshold / interval). For the threshold rebalances you rebalance if weights deviate from some target weight. It would be nice to maybe at a field to the portfolio to have a target weight for each position and an actual weight for each position. perhapses something like this

pub struct Portfolio {
    // other fields
    pub actual_weight: HashMap<Positions, f32>,
    pub target_weight: HashMap<Positions, f32>
}

Let me know what you think! I am happy to work on this

@avhz
Copy link
Owner

avhz commented Dec 21, 2023

Great idea, thank you. Go ahead :)

Probably need to impl Hash, Eq, and PartialEq for Position if you wanna use it for the keys.

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

No branches or pull requests

2 participants