RustQuant icon indicating copy to clipboard operation
RustQuant copied to clipboard

Feature Request: Implement `get_weights()` method for `Portfolio`

Open 0xJepsen opened this issue 2 years ago • 1 comments

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

0xJepsen avatar Dec 21 '23 01:12 0xJepsen

Great idea, thank you. Go ahead :)

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

avhz avatar Dec 21 '23 03:12 avhz