Click or drag to resize

ExtensionsProtect Method (MarketRuleOrder, MyTrade, Unit, Unit)

To create the action protecting orders by strategies TakeProfitStrategy and StopLossStrategy.

Namespace:  StockSharp.Algo.Strategies
Assembly:  StockSharp.Algo.Strategies (in StockSharp.Algo.Strategies.dll) Version: 4.4.16.0 (4.4.16)
Syntax
C#
public static MarketRule<Order, MyTrade> Protect(
	this MarketRule<Order, MyTrade> rule,
	Unit takePriceDelta,
	Unit stopPriceDelta
)

Parameters

rule
Type: StockSharp.AlgoMarketRuleOrder, MyTrade
The rule for new orders.
takePriceDelta
Type: StockSharp.MessagesUnit
The delta from the price of the protected order, by which the protective take profit order is to be registered.
stopPriceDelta
Type: StockSharp.MessagesUnit
The delta from the price of the protected order, by which the protective stop loss order is to be registered.

Return Value

Type: MarketRuleOrder, MyTrade
Rule.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type MarketRuleOrder, MyTrade. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also