PositionProtectDiagramElement
The element is used to automatically protect opened positions using stop loss and take-profit.
Inherits: DiagramElement
Constructors
public PositionProtectDiagramElement()
positionProtectDiagramElement = PositionProtectDiagramElement()
Initializes a new instance of the PositionProtectDiagramElement.
Properties
public override string IconName { get; }
value = positionProtectDiagramElement.IconName
Icon resource name.
public bool IsTrailingStopLoss { get; set; }
value = positionProtectDiagramElement.IsTrailingStopLoss
positionProtectDiagramElement.IsTrailingStopLoss = value
Whether to use a trailing technique.
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.
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.
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.
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.
public override Guid TypeId { get; }
value = positionProtectDiagramElement.TypeId
The unique identifier of the diagram element type.
public bool UseMarketOrders { get; set; }
value = positionProtectDiagramElement.UseMarketOrders
positionProtectDiagramElement.UseMarketOrders = value
Whether to use market orders.
public bool UseServer { get; set; }
value = positionProtectDiagramElement.UseServer
positionProtectDiagramElement.UseServer = value
Try use server-side stop orders if underlying connector provide it.
Methods
protected override void OnPrepare()
positionProtectDiagramElement.OnPrepare()
To prepare for starting the diagram element algorithm.
protected override void OnReseted()
positionProtectDiagramElement.OnReseted()
The method is called at re-initialisation of the diagram element state.