Table of Contents

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 the same reference for the same position key (PortfolioName + SecurityId + StrategyId + Side + ClientCode + DepoName + LimitType).

Constructors

PositionSnapshotHolder()

Initializes a new instance of the PositionSnapshotHolder.

public PositionSnapshotHolder()

Methods

Process(PositionChangeMessage)

Process PositionChangeMessage change.

public PositionChangeMessage Process(PositionChangeMessage posMsg)

Parameters

posMsg PositionChangeMessage

PositionChangeMessage change.

Returns

PositionChangeMessage

Position snapshot. Returns the same reference for the same position key.

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

portfolioName string

Portfolio name. Use null to clear all snapshots.

securityId SecurityId

Security ID.

strategyId string

Strategy ID.

side Sides?

Side.

clientCode string

Client code.

depoName string

Depo name.

limitType TPlusLimits?

Limit type.

TryGetSnapshot(PositionChangeMessage, out PositionChangeMessage)

Try get snapshot for the specified position message.

public bool TryGetSnapshot(PositionChangeMessage posMsg, out PositionChangeMessage snapshot)

Parameters

posMsg PositionChangeMessage

Position message to extract key from.

snapshot PositionChangeMessage

Snapshot if exists, otherwise null.

Returns

bool

true if snapshot exists; otherwise false.

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

portfolioName string

Portfolio name.

securityId SecurityId

Security ID.

strategyId string

Strategy ID.

side Sides?

Side.

clientCode string

Client code.

depoName string

Depo name.

limitType TPlusLimits?

Limit type.

snapshot PositionChangeMessage

Snapshot if exists, otherwise null.

Returns

bool

true if snapshot exists; otherwise false.