Class PositionProtectDiagramElement
- Namespace
- StockSharp.Diagram.Elements
- Assembly
- StockSharp.Diagram.Core.dll
The element is used to automatically protect opened positions using stop loss and take-profit.
[Display(ResourceType = typeof(LocalizedStrings), Name = "PosProtection", Description = "PositionProtectionElementDescription", GroupName = "Positions")]
public class PositionProtectDiagramElement : DiagramElement, ILogReceiver, ILogSource, IDisposable, INotifyPropertyChanging, INotifyPropertyChanged, ICustomTypeDescriptor, INotifyPropertiesChanged, IPersistable
- Inheritance
-
PositionProtectDiagramElement
- Implements
-
INotifyPropertiesChangedIPersistable
- Inherited Members
- Extension Methods
Constructors
PositionProtectDiagramElement()
Initializes a new instance of the PositionProtectDiagramElement.
public PositionProtectDiagramElement()
Properties
IconName
Icon resource name.
public override string IconName { get; }
Property Value
IsTrailingStopLoss
Whether to use a trailing technique.
public bool IsTrailingStopLoss { get; set; }
Property Value
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
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
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
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
TypeId
The unique identifier of the diagram element type.
public override Guid TypeId { get; }
Property Value
UseMarketOrders
Whether to use market orders.
public bool UseMarketOrders { get; set; }
Property Value
UseServer
Try use server-side stop orders if underlying connector provide it.
public bool UseServer { get; set; }
Property Value
Remarks
It is disabled by default.
Methods
OnPrepare()
To prepare for starting the diagram element algorithm.
protected override void OnPrepare()
OnReseted()
The method is called at re-initialisation of the diagram element state.
protected override void OnReseted()