Class PortfolioPnLManager
The profit-loss manager, related for specified PortfolioName.
Namespace: StockSharp.Algo.PnL
Assembly: StockSharp.Algo.dll
Syntax
public class PortfolioPnLManager : Object, IPnLManager, IPersistable
Constructors
PortfolioPnLManager(String)
Initializes a new instance of the PortfolioPnLManager.
Declaration
public PortfolioPnLManager(string portfolioName)
Parameters
Type | Name | Description |
---|---|---|
String | portfolioName | Portfolio name. |
Properties
PnL
Total profit-loss.
Declaration
public Decimal PnL { get; }
Property Value
Type | Description |
---|---|
Decimal |
PortfolioName
Portfolio name.
Declaration
public string PortfolioName { get; }
Property Value
Type | Description |
---|---|
String |
RealizedPnL
The value of realized profit-loss.
Declaration
public virtual Decimal RealizedPnL { get; }
Property Value
Type | Description |
---|---|
Decimal |
UnrealizedPnL
The value of unrealized profit-loss.
Declaration
public Nullable<Decimal> UnrealizedPnL { get; }
Property Value
Type | Description |
---|---|
Nullable<Decimal> |
Methods
ProcessMessage(Message)
To process the message, containing market data.
Declaration
public bool ProcessMessage(Message message)
Parameters
Type | Name | Description |
---|---|---|
Message | message | The message, containing market data. |
Returns
Type | Description |
---|---|
Boolean | PnL was changed. |
ProcessMyTrade(ExecutionMessage, out PnLInfo)
To calculate trade profitability. If the trade was already processed earlier, previous information returns.
Declaration
public bool ProcessMyTrade(ExecutionMessage trade, out PnLInfo info)
Parameters
Type | Name | Description |
---|---|---|
ExecutionMessage | trade | Trade. |
PnLInfo | info | Information on new trade. |
Returns
Type | Description |
---|---|
Boolean | true, if new trade received, otherwise, false. |
Reset()
To zero PnL.
Declaration
public void Reset()
Explicit Interface Implementations
IPnLManager.ProcessMessage(Message, ICollection<PortfolioPnLManager>)
Declaration
PnLInfo IPnLManager.ProcessMessage(Message message, ICollection<PortfolioPnLManager> changedPortfolios)
Parameters
Type | Name | Description |
---|---|---|
Message | message | |
ICollection<PortfolioPnLManager> | changedPortfolios |
Returns
Type | Description |
---|---|
PnLInfo |
Implements
Ecng.Serialization.IPersistable