QuantConnect Lean Algorithmic Trading Engine
Fields  Properties  Methods 


QuantConnect.Securities Namespace : SecurityPortfolioManager Class
SecurityPortfolioManager Class Members

The following tables list the members exposed by SecurityPortfolioManager.

Public Constructors
 NameDescription
Public Constructor Initialise security portfolio manager.  
Top
Public Fields
 NameDescription
Public Field Local access to the securities collection for the portfolio summation.  
Public Field Local access to the transactions collection for the portfolio summation and updates.  
Top
Public Properties
 NameDescription
Public Property Sum of all currencies in account in US dollars (only settled cash)  
Public Property Gets the cash book that keeps track of all currency holdings (only settled cash)  
Public Property Count the securities objects in the portfolio.  
Public Property Boolean flag indicating we have any holdings in the portfolio.  
Public Property Alias for HoldStock. Check if we have and holdings.  
Public Property Check if the underlying securities array is read only.  
Public PropertyOverloaded.  Indexer for the PortfolioManager class to access the underlying security holdings objects.  
Public Property Symbol keys collection of the underlying assets in the portfolio.  
Public PropertyGets or sets the MarginCallModel for the portfolio. This is used to executed margin call orders.  
Public Property Gets the remaining margin on the account in the account's currency  
Public Property Gets the total absolute holdings cost of the portfolio. This sums up the individual absolute cost of each holding  
Public Property Total fees paid during the algorithm operation across all securities in portfolio.  
Public Property Absolute sum the individual items in portfolio.  
Public Property Gets the total margin used across all securities in the account's currency  
Public Property Total portfolio value if we sold all holdings at current market rates.  
Public Property Sum of all gross profit across all securities in portfolio.  
Public Property Total sale volume since the start of algorithm operations.  
Public Property Absolute value of cash discounted from our total cash by the holdings we own.  
Public Property Get the total unrealised profit in our portfolio from the individual security unrealized profits.  
Public Property Get the total unrealised profit in our portfolio from the individual security unrealized profits.  
Public Property Sum of all currencies in account in US dollars (only unsettled cash)  
Public Property Gets the cash book that keeps track of all currency holdings (only unsettled cash)  
Public Property Collection of securities objects in the portfolio.  
Top
Public Methods
 NameDescription
Public MethodOverloaded.  Add a new securities string-security to the portfolio.  
Public Method Record the transaction value and time in a list to later be processed for statistics creation.  
Public Method Adds an item to the list of unsettled cash amounts  
Public Method Applies a dividend to the portfolio  
Public Method Applies a split to the portfolio  
Public Method Clear the portfolio of securities objects.  
Public Method Check if the key-value pair is in the portfolio.  
Public Method Check if the portfolio contains this symbol string.  
Public Method Copy contents of the portfolio collection to a new destination.  
Public MethodGets the margin available for trading a specific symbol in a specific direction. Alias for GetMarginRemaining  
Public Method Gets the margin available for trading a specific symbol in a specific direction.  
Public Method Calculate the new average price after processing a partial/complete order fill event.  
Public MethodOverloaded.  Remove this keyvalue pair from the portfolio.  
Public Method Scan the portfolio to check if unsettled funds should be settled  
Public Method Scan the portfolio and the updated data for a potential margin call situation which may get the holdings below zero! If there is a margin call, liquidate the portfolio immediately before the portfolio gets sub zero.  
Public MethodOverloaded.  Set the base currrency cash this algorithm is to manage.  
Public Method Attempt to get the value of the securities holding class if this symbol exists.  
Top
Extension Methods
 NameDescription
Public Extension Method Performs the specified selector before calling DefaultIfEmpty. This is just short hand for Select(selector).DefaultIfEmpty(defaultValue)
Public Extension Method Creates a new enumerable that will be distinct by the specified property selector
Public Extension Method Produces the set difference of two sequences by using the default equality comparer to compare values.
Public Extension Method Extension method to return the quantity of holdings, if no holdings are present, then zero is returned.
Public Extension Method Groups adjacent elements of the enumerale using the specified grouper function
Public Extension Method Returns true if the specified enumerable is null or has no elements
Public Extension MethodOverloaded.  Gets the median value in the collection
Public Extension Method Wraps the specified enumerable such that it will only be enumerated once
Public Extension MethodOverloaded. Creates a new HashSet from the elements in the specified enumerable
Top
See Also