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)
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
securityId
SecurityIdportfolioName
stringfactory
IProtectiveBehaviourFactorytakeValue
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.
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
securityId
SecurityIdprice
decimalCurrent price.
time
DateTimeOffsetCurrent time.