Class PortfolioPnLManager
- Namespace
- StockSharp.Algo.PnL
- Assembly
- StockSharp.Algo.dll
The profit-loss manager, related for specified PortfolioName.
public class PortfolioPnLManager : IPnLManager, IPersistable
- Inheritance
-
PortfolioPnLManager
- Implements
-
IPersistable
- Inherited Members
- Extension Methods
Constructors
PortfolioPnLManager(string, Func<SecurityId, Level1ChangeMessage>)
Initializes a new instance of the PortfolioPnLManager.
public PortfolioPnLManager(string portfolioName, Func<SecurityId, Level1ChangeMessage> getSecDefinition)
Parameters
portfolioName
stringPortfolio name.
getSecDefinition
Func<SecurityId, Level1ChangeMessage>Get security definition function.
Properties
PnL
Total profit-loss.
public decimal PnL { get; }
Property Value
PortfolioName
Portfolio name.
public string PortfolioName { get; }
Property Value
RealizedPnL
The value of realized profit-loss.
public decimal RealizedPnL { get; }
Property Value
UnrealizedPnL
The value of unrealized profit-loss.
public decimal UnrealizedPnL { get; }
Property Value
Methods
ProcessMessage(Message)
To process the message, containing market data.
public bool ProcessMessage(Message message)
Parameters
message
MessageThe message, containing market data.
Returns
ProcessMyTrade(ExecutionMessage, out PnLInfo)
To calculate trade profitability. If the trade was already processed earlier, previous information returns.
public bool ProcessMyTrade(ExecutionMessage trade, out PnLInfo info)
Parameters
trade
ExecutionMessageTrade.
info
PnLInfoInformation on new trade.
Returns
Reset()
To zero PnL.
public void Reset()
UpdateSecurity(Level1ChangeMessage)
Update the security information.
public void UpdateSecurity(Level1ChangeMessage l1Msg)