Table of Contents

Class ProtectPositionDiagramElement

Namespace
StockSharp.Diagram.Elements
Assembly
StockSharp.Diagram.Core.dll

Open position protection element.

[Display(ResourceType = typeof(LocalizedStrings), Name = "PosProtection", Description = "PositionProtectionElementDescription", GroupName = "Common")]
public class ProtectPositionDiagramElement : DiagramElement, ILogReceiver, ILogSource, IDisposable, INotifyPropertyChanging, INotifyPropertyChanged, ICustomTypeDescriptor, INotifyPropertiesChanged, IPersistable
Inheritance
ProtectPositionDiagramElement
Implements
INotifyPropertiesChanged
IPersistable
Inherited Members
Extension Methods

Constructors

ProtectPositionDiagramElement()

Initializes a new instance of the ProtectPositionDiagramElement.

public ProtectPositionDiagramElement()

Properties

IconName

Icon resource name.

public override string IconName { get; }

Property Value

string

IsTrailingStopLoss

Whether to use a trailing technique.

public bool IsTrailingStopLoss { get; set; }

Property Value

bool

Remarks

The default is off.

IsTrailingTakeProfit

Whether to use a trailing technique.

public bool IsTrailingTakeProfit { get; set; }

Property Value

bool

Remarks

The default is off.

StopLossTimeOut

Time limit. If protection has not worked by this time, the position will be closed on the market.

public TimeSpan StopLossTimeOut { get; set; }

Property Value

TimeSpan

Remarks

The default is off.

StopValue

The protective level for the stop loss. The default level is 0, which means the disabled.

public Unit StopValue { get; set; }

Property Value

Unit

TakeProfitTimeOut

Time limit. If protection has not worked by this time, the position will be closed on the market.

public TimeSpan TakeProfitTimeOut { get; set; }

Property Value

TimeSpan

Remarks

The default is off.

TakeValue

The protective level for the take profit. The default level is 0, which means the disabled.

public Unit TakeValue { get; set; }

Property Value

Unit

TypeId

The unique identifier of the diagram element type.

public override Guid TypeId { get; }

Property Value

Guid

UseMarketOrders

Whether to use market orders.

public bool UseMarketOrders { get; set; }

Property Value

bool

UseServer

Try use server-side stop orders if underlying connector provide it.

public bool UseServer { get; set; }

Property Value

bool

Remarks

It is disabled by default.

Methods

OnReseted()

The method is called at re-initialisation of the diagram element state.

protected override void OnReseted()

OnStart(DateTimeOffset)

The method is called at the start of the diagram element algorithm.

protected override void OnStart(DateTimeOffset time)

Parameters

time DateTimeOffset