Class PositionSnapshotHolder
- Namespace
- StockSharp.Messages
- Assembly
- StockSharp.Messages.dll
PositionChangeMessage snapshots holder.
public class PositionSnapshotHolder : BaseLogReceiver, IPersistable, ILogReceiver, ILogSource, IDisposable
- Inheritance
-
PositionSnapshotHolder
- Implements
- Inherited Members
- Extension Methods
Remarks
Returns a copy of the snapshot for the same position key (PortfolioName + SecurityId + StrategyId + Side + ClientCode + DepoName + LimitType).
Constructors
PositionSnapshotHolder()
Initializes a new instance of the PositionSnapshotHolder.
public PositionSnapshotHolder()
Methods
GetAllSnapshots()
Get cloned copies of all current position snapshots.
public IEnumerable<PositionChangeMessage> GetAllSnapshots()
Returns
Process(PositionChangeMessage)
Process PositionChangeMessage change.
public PositionChangeMessage Process(PositionChangeMessage posMsg)
Parameters
posMsgPositionChangeMessagePositionChangeMessage change.
Returns
- PositionChangeMessage
Position snapshot copy.
ResetSnapshot(string, SecurityId, string, Sides?, string, string, TPlusLimits?)
Reset snapshot for the specified position key.
public void ResetSnapshot(string portfolioName, SecurityId securityId = default, string strategyId = null, Sides? side = null, string clientCode = null, string depoName = null, TPlusLimits? limitType = null)
Parameters
portfolioNamestringPortfolio name. Use null to clear all snapshots.
securityIdSecurityIdSecurity ID.
strategyIdstringStrategy ID.
sideSides?Side.
clientCodestringClient code.
depoNamestringDepo name.
limitTypeTPlusLimits?Limit type.
TryGetSnapshot(PositionChangeMessage, out PositionChangeMessage)
Try get snapshot for the specified position message.
public bool TryGetSnapshot(PositionChangeMessage posMsg, out PositionChangeMessage snapshot)
Parameters
posMsgPositionChangeMessagePosition message to extract key from.
snapshotPositionChangeMessageSnapshot if exists, otherwise null.
Returns
- bool
trueif snapshot exists; otherwisefalse.
TryGetSnapshot(string, SecurityId, string, Sides?, string, string, TPlusLimits?, out PositionChangeMessage)
Try get snapshot for the specified position key.
public bool TryGetSnapshot(string portfolioName, SecurityId securityId, string strategyId, Sides? side, string clientCode, string depoName, TPlusLimits? limitType, out PositionChangeMessage snapshot)
Parameters
portfolioNamestringPortfolio name.
securityIdSecurityIdSecurity ID.
strategyIdstringStrategy ID.
sideSides?Side.
clientCodestringClient code.
depoNamestringDepo name.
limitTypeTPlusLimits?Limit type.
snapshotPositionChangeMessageSnapshot if exists, otherwise null.
Returns
- bool
trueif snapshot exists; otherwisefalse.