Class Portfolio
java.lang.Object
com.quantfinlib.risk.Portfolio
Multi-asset portfolio of positions with live price updates.
Thread-safe: prices may be updated concurrently from a market data feed
while analytics read valuations.
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddPosition(String symbol, double quantity, double price) intsize()doublevoidupdatePrice(String symbol, double price) Updates the mark price of an existing position (no-op for unknown symbols).weights()Current weights by symbol (insertion order not guaranteed).
-
Constructor Details
-
Portfolio
public Portfolio()
-
-
Method Details
-
addPosition
-
updatePrice
Updates the mark price of an existing position (no-op for unknown symbols). -
totalValue
public double totalValue() -
weights
-
position
-
positions
-
size
public int size()
-