Table of Contents

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, ILogReceiver)

Initialize ProtectiveProcessor.

public ProtectiveProcessor(Sides protectiveSide, decimal protectivePrice, bool isUpTrend, bool isTrailing, Unit protectiveLevel, bool useMarketOrders, Unit priceOffset, TimeSpan timeout, ILogReceiver logs)

Parameters

protectiveSide Sides

Protected position side.

protectivePrice decimal

Protected position price.

isUpTrend bool

To track price increase or falling.

isTrailing bool

Trailing mode.

protectiveLevel Unit

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.

useMarketOrders bool

Whether to use Market for protection.

priceOffset Unit

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).

timeout TimeSpan

Time limit. If protection has not worked by this time, the position will be closed on the market.

logs ILogReceiver

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

currentPrice decimal?
currentTime DateTimeOffset

Returns

decimal?

Remarks

If the price is equal to null then the activation is not required.