PositionProtectDiagramElement

StockSharp.Diagram.Elements

The element is used to automatically protect opened positions using stop loss and take-profit.

Inherits: DiagramElement

Constructors

PositionProtectDiagramElement
public PositionProtectDiagramElement()
positionProtectDiagramElement = PositionProtectDiagramElement()

Initializes a new instance of the PositionProtectDiagramElement.

Properties

IconName
public override string IconName { get; }
value = positionProtectDiagramElement.IconName

Icon resource name.

IsTrailingStopLoss
public bool IsTrailingStopLoss { get; set; }
value = positionProtectDiagramElement.IsTrailingStopLoss
positionProtectDiagramElement.IsTrailingStopLoss = value

Whether to use a trailing technique.

StopLossTimeOut
public TimeSpan StopLossTimeOut { get; set; }
value = positionProtectDiagramElement.StopLossTimeOut
positionProtectDiagramElement.StopLossTimeOut = value

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

StopValue
public Unit StopValue { get; set; }
value = positionProtectDiagramElement.StopValue
positionProtectDiagramElement.StopValue = value

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

TakeProfitTimeOut
public TimeSpan TakeProfitTimeOut { get; set; }
value = positionProtectDiagramElement.TakeProfitTimeOut
positionProtectDiagramElement.TakeProfitTimeOut = value

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

TakeValue
public Unit TakeValue { get; set; }
value = positionProtectDiagramElement.TakeValue
positionProtectDiagramElement.TakeValue = value

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

TypeId
public override Guid TypeId { get; }
value = positionProtectDiagramElement.TypeId

The unique identifier of the diagram element type.

UseMarketOrders
public bool UseMarketOrders { get; set; }
value = positionProtectDiagramElement.UseMarketOrders
positionProtectDiagramElement.UseMarketOrders = value

Whether to use market orders.

UseServer
public bool UseServer { get; set; }
value = positionProtectDiagramElement.UseServer
positionProtectDiagramElement.UseServer = value

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

Methods

OnPrepare
protected override void OnPrepare()
positionProtectDiagramElement.OnPrepare()

To prepare for starting the diagram element algorithm.

OnReseted
protected override void OnReseted()
positionProtectDiagramElement.OnReseted()

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