Skip to main content

map_rest_portfolio

Function map_rest_portfolio 

Source
pub fn map_rest_portfolio(
    positions: &[PortfolioPosition],
    now: Instant,
) -> Portfolio
Expand description

Maps the REST portfolio to a [Portfolio].

A position of type moneyLimit is a balance (available is the quantity, blocked is the locked part, both 0 when missing). A position with a ticker and a board is a holding. A record with neither is dropped. Average price and current price are None when the broker leaves them out.