gs_quant.markets.portfolio.Portfolio¶
- class Portfolio(priceables=(), name=None)[source]¶
A collection of instruments
Portfolio holds a collection of instruments in order to run pricing and risk scenarios
- __init__(priceables=(), name=None)[source]¶
Creates a portfolio object which can be used to hold instruments
- Parameters:
priceables (
Union
[PriceableImpl
,Iterable
[PriceableImpl
],dict
,None
]) – constructed with an instrument, portfolio, iterable of either, or a dictionary where key is name and value is a priceable
Methods
__init__
([priceables, name])Creates a portfolio object which can be used to hold instruments
append
(priceables)as_dict
([as_camel_case])Dictionary of the public, non-null properties and values
calc
(risk_measure[, fn])Calculate the value of the risk_measure
clone
([clone_instruments])Clone this object, overriding specified values
default_instance
()Construct a default instance of this type
dollar_price
()Present value in USD
extend
(portfolio)from_asset_id
(asset_id[, date])from_asset_name
(name)from_book
(book[, book_type, activity_type])from_csv
(csv_file[, mappings])from_eti
(eti)from_frame
(data[, mappings])from_instance
(instance)Copy the values from an existing instance of the same type to our self :type instance: :param instance: from which to copy: :return:
from_portfolio_id
(cls, portfolio_id)Deprecated since version 0.8.293: from_portfolio_id is now deprecated, please use Portfolio.get(portfolio_id=portfolio_id) instead.
from_portfolio_name
(cls, name)Deprecated since version 0.8.293: from_portfolio_name is now deprecated, please use Portfolio.get(portfolio_name=portfolio_name) instead.
from_quote
(quote_id)get
([portfolio_id, portfolio_name])market
()Market Data map of coordinates and values.
paths
(key)- rtype:
Tuple
[PortfolioPath
,...
]
pop
(item)- rtype:
PriceableImpl
price
([currency])Present value in local currency.
properties
()The public property names of this class
properties_init
()The public property names of this class
resolve
([in_place])Resolve non-supplied properties of an instrument
save
([overwrite])save_as_quote
([overwrite])- rtype:
str
save_to_shadowbook
(name)scale
(scaling[, in_place])subset
(paths[, name])to_csv
(csv_file[, mappings, ignored_cols])to_frame
([mappings])- rtype:
DataFrame
Attributes
all_instruments
all_paths
all_portfolios
id
instruments
portfolios
priceables
quote_id