PortfolioPnLManager

StockSharp.Algo.PnL

The profit-loss manager, related for specified PortfolioName.

Implements: IPnLManager, IPersistable, ICloneable<IPnLManager>, ICloneable

Constructors

PortfolioPnLManager
public PortfolioPnLManager(string portfolioName, Func<SecurityId, Level1ChangeMessage> getSecDefinition)
portfolioPnLManager = PortfolioPnLManager(portfolioName, getSecDefinition)

The profit-loss manager, related for specified PortfolioName.

portfolioName
Portfolio name.
getSecDefinition
Get security definition function.

Properties

PortfolioName
public string PortfolioName { get; }
value = portfolioPnLManager.PortfolioName

Portfolio name.

RealizedPnL
public decimal RealizedPnL { get; private set; }
value = portfolioPnLManager.RealizedPnL
portfolioPnLManager.RealizedPnL = value

The value of realized profit-loss.

UnrealizedPnL
public decimal UnrealizedPnL { get; }
value = portfolioPnLManager.UnrealizedPnL

The value of unrealized profit-loss.

Methods

Clone
public IPnLManager Clone()
result = portfolioPnLManager.Clone()

Creates a deep copy of a DataSeries

ProcessMessage
public bool ProcessMessage(Message message)
result = portfolioPnLManager.ProcessMessage(message)

To process the message, containing market data.

message
The message, containing market data.

Returns: PnL was changed.

ProcessMyTrade
public bool ProcessMyTrade(ExecutionMessage trade, PnLInfo info)
result = portfolioPnLManager.ProcessMyTrade(trade, info)

To calculate trade profitability. If the trade was already processed earlier, previous information returns.

trade
Trade.
info
Information on new trade.

Returns: , if new trade received, otherwise, .

Reset
public void Reset()
portfolioPnLManager.Reset()

To zero PnL.

UpdateSecurity
public void UpdateSecurity(Level1ChangeMessage l1Msg)
portfolioPnLManager.UpdateSecurity(l1Msg)

Update the security information.

l1Msg
Level1ChangeMessage