Table of Contents

Class ProtectiveController

Namespace
StockSharp.Algo.Strategies.Protective
Assembly
StockSharp.Algo.dll

Protective controller.

public class ProtectiveController : BaseLogReceiver, IPersistable, ILogReceiver, ILogSource, IDisposable
Inheritance
ProtectiveController
Implements
IPersistable
Inherited Members
Extension Methods

Constructors

ProtectiveController()

public ProtectiveController()

Methods

Clear()

Clear state.

public void Clear()

GetController(SecurityId, string, IProtectiveBehaviourFactory, Unit, Unit, bool, TimeSpan, TimeSpan, bool)

public IProtectivePositionController GetController(SecurityId securityId, string portfolioName, IProtectiveBehaviourFactory factory, Unit takeValue, Unit stopValue, bool isStopTrailing, TimeSpan takeTimeout, TimeSpan stopTimeout, bool useMarketOrders)

Parameters

securityId SecurityId

SecurityId

portfolioName string

PortfolioName

factory IProtectiveBehaviourFactory

IProtectiveBehaviourFactory

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.

Returns

IProtectivePositionController

IProtectivePositionController

TryActivate(SecurityId, decimal, DateTimeOffset)

Try activate protection.

public IEnumerable<(bool isTake, Sides side, decimal price, decimal volume, OrderCondition condition)> TryActivate(SecurityId securityId, decimal price, DateTimeOffset time)

Parameters

securityId SecurityId

SecurityId

price decimal

Current price.

time DateTimeOffset

Current time.

Returns

IEnumerable<(bool isTake, Sides side, decimal price, decimal volume, OrderCondition condition)>

Registration order info.