ProtectiveController

StockSharp.Algo.Strategies.Protective

Protective controller.

Inherits: BaseLogReceiver

Methods

Clear
public void Clear()
protectiveController.Clear()

Clear state.

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

Get IProtectivePositionController instance.

securityId
SecurityId
portfolioName
PortfolioName
factory
IProtectiveBehaviourFactory
takeValue
Take offset.
stopValue
Stop offset.
isStopTrailing
Whether to use a trailing technique.
takeTimeout
Time limit. If protection has not worked by this time, the position will be closed on the market.
stopTimeout
Time limit. If protection has not worked by this time, the position will be closed on the market.
useMarketOrders
Whether to use market orders.

Returns: IProtectivePositionController

TryActivate
public IEnumerable<ValueTuple<bool, Sides, decimal, decimal, OrderCondition>> TryActivate(SecurityId securityId, decimal price, DateTime time)
result = protectiveController.TryActivate(securityId, price, time)

Try activate protection.

securityId
SecurityId
price
Current price.
time
Current time.

Returns: Registration order info.