Table of Contents

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 Unit

Take offset.

stopValue Unit

Stop offset.

isStopTrailing bool

Whether to use a trailing technique.

takeTimeout TimeSpan

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

stopTimeout TimeSpan

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

useMarketOrders bool

Whether to use market orders.

Properties

IsStopTrailing

Whether to use a trailing technique.

protected bool IsStopTrailing { get; }

Property Value

bool

Position

Current position value.

public abstract decimal Position { get; }

Property Value

decimal

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

TimeSpan

StopValue

Stop offset.

protected Unit StopValue { get; }

Property Value

Unit

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

TimeSpan

TakeValue

Take offset.

protected Unit TakeValue { get; }

Property Value

Unit

UseMarketOrders

Whether to use market orders.

protected bool UseMarketOrders { get; }

Property Value

bool

Methods

TryActivate(decimal, DateTimeOffset)

Try activate protection.

public abstract (bool, Sides, decimal, decimal, OrderCondition)? TryActivate(decimal price, DateTimeOffset time)

Parameters

price decimal

Current price.

time DateTimeOffset

Current 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)

Parameters

price decimal

Position difference price.

value decimal

Position difference value.

Returns

(bool isTake, Sides side, decimal price, decimal volume, OrderCondition condition)?

Registration order info.