Class BaseProtectiveBehaviour
- Namespace
- StockSharp.Algo.Strategies.Protective
- Assembly
- StockSharp.Algo.dll
Base implementation of IProtectiveBehaviour.
public abstract class BaseProtectiveBehaviour : BaseLogReceiver, IPersistable, ILogReceiver, IProtectiveBehaviour, ILogSource, IDisposable
- Inheritance
-
BaseProtectiveBehaviour
- Implements
-
IPersistable
- Inherited Members
- Extension Methods
Constructors
BaseProtectiveBehaviour(Unit, Unit, bool, TimeSpan, TimeSpan, bool)
Initializes a new instance of the BaseProtectiveBehaviour.
protected BaseProtectiveBehaviour(Unit takeValue, Unit stopValue, bool isStopTrailing, TimeSpan takeTimeout, TimeSpan stopTimeout, bool useMarketOrders)
Parameters
takeValue
UnitTake offset.
stopValue
UnitStop offset.
isStopTrailing
boolWhether to use a trailing technique.
takeTimeout
TimeSpanTime limit. If protection has not worked by this time, the position will be closed on the market.
stopTimeout
TimeSpanTime limit. If protection has not worked by this time, the position will be closed on the market.
useMarketOrders
boolWhether to use market orders.
Properties
IsStopTrailing
Whether to use a trailing technique.
protected bool IsStopTrailing { get; }
Property Value
Position
Current position value.
public abstract decimal Position { get; }
Property Value
StopTimeout
Time limit. If protection has not worked by this time, the position will be closed on the market.
protected TimeSpan StopTimeout { get; }
Property Value
StopValue
Stop offset.
protected Unit StopValue { get; }
Property Value
TakeTimeout
Time limit. If protection has not worked by this time, the position will be closed on the market.
protected TimeSpan TakeTimeout { get; }
Property Value
TakeValue
Take offset.
protected Unit TakeValue { get; }
Property Value
UseMarketOrders
Whether to use market orders.
protected bool UseMarketOrders { get; }
Property Value
Methods
TryActivate(decimal, DateTimeOffset)
Try activate protection.
public abstract (bool, Sides, decimal, decimal, OrderCondition)? TryActivate(decimal price, DateTimeOffset time)
Parameters
price
decimalCurrent price.
time
DateTimeOffsetCurrent time.
Returns
- (bool isTake, Sides side, decimal price, decimal volume, OrderCondition condition)?
Registration order info.
Update(decimal, decimal)
Update position difference.
public abstract (bool isTake, Sides side, decimal price, decimal volume, OrderCondition condition)? Update(decimal price, decimal value)