Class ProtectiveProcessor
- Namespace
- StockSharp.Algo.Strategies.Protective
- Assembly
- StockSharp.Algo.dll
Protective strategy processor.
public class ProtectiveProcessor- Inheritance
- 
      
      ProtectiveProcessor
- Inherited Members
- Extension Methods
Constructors
ProtectiveProcessor(Sides, decimal, bool, bool, Unit, bool, Unit, TimeSpan, DateTimeOffset, ILogReceiver)
Initialize ProtectiveProcessor.
public ProtectiveProcessor(Sides protectiveSide, decimal protectivePrice, bool isUpTrend, bool isTrailing, Unit protectiveLevel, bool useMarketOrders, Unit priceOffset, TimeSpan timeout, DateTimeOffset startedTime, ILogReceiver logs)Parameters
- protectiveSideSides
- Protected position side. 
- protectivePricedecimal
- Protected position price. 
- isUpTrendbool
- To track price increase or falling. 
- isTrailingbool
- Trailing mode. 
- protectiveLevelUnit
- The protective level. If the Type type is equal to Limit, then the given price is specified. Otherwise, the shift value from the protected trade Ticks is specified. 
- useMarketOrdersbool
- Whether to use Market for protection. 
- priceOffsetUnit
- The price shift for the registering order. It determines the amount of shift from the best quote (for the buy it is added to the price, for the sell it is subtracted). 
- timeoutTimeSpan
- Time limit. If protection has not worked by this time, the position will be closed on the market. 
- startedTimeDateTimeOffset
- The time when the protective strategy was started. 
- logsILogReceiver
- The log source. 
Methods
GetActivationPrice(decimal?, DateTimeOffset)
The absolute value of the price when the one is reached the protective strategy is activated.
public decimal? GetActivationPrice(decimal? currentPrice, DateTimeOffset currentTime)Parameters
- currentPricedecimal?
- The current price of the security. If the price is equal to null, then the activation is not required. 
- currentTimeDateTimeOffset
- The current time.