Class ProtectiveController
- Namespace
- StockSharp.Algo.Strategies.Protective
- Assembly
- StockSharp.Algo.dll
Protective controller.
public class ProtectiveController : BaseLogReceiver, IPersistable, ILogReceiver, ILogSource, IDisposable
- Inheritance
-
ProtectiveController
- Implements
- 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)
Get IProtectivePositionController instance.
public IProtectivePositionController GetController(SecurityId securityId, string portfolioName, IProtectiveBehaviourFactory factory, Unit takeValue, Unit stopValue, bool isStopTrailing, TimeSpan takeTimeout, TimeSpan stopTimeout, bool useMarketOrders)
Parameters
securityIdSecurityIdportfolioNamestringfactoryIProtectiveBehaviourFactorytakeValueUnitTake offset.
stopValueUnitStop offset.
isStopTrailingboolWhether to use a trailing technique.
takeTimeoutTimeSpanTime limit. If protection has not worked by this time, the position will be closed on the market.
stopTimeoutTimeSpanTime limit. If protection has not worked by this time, the position will be closed on the market.
useMarketOrdersboolWhether to use market orders.
Returns
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
securityIdSecurityIdpricedecimalCurrent price.
timeDateTimeOffsetCurrent time.