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
protectiveSide
SidesProtected position side.
protectivePrice
decimalProtected position price.
isUpTrend
boolTo track price increase or falling.
isTrailing
boolTrailing mode.
protectiveLevel
UnitThe 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.
useMarketOrders
boolWhether to use Market for protection.
priceOffset
UnitThe 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).
timeout
TimeSpanTime limit. If protection has not worked by this time, the position will be closed on the market.
startedTime
DateTimeOffsetThe time when the protective strategy was started.
logs
ILogReceiverThe 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
currentPrice
decimal?The current price of the security. If the price is equal to null, then the activation is not required.
currentTime
DateTimeOffsetThe current time.