Click or drag to resize

ExtensionsProtect Method (MarketRuleOrder, MyTrade, FuncMyTrade, TakeProfitStrategy, FuncMyTrade, StopLossStrategy)

Создать действие, защищающее сделки стратегиями TakeProfitStrategy и StopLossStrategy.

Namespace:  StockSharp.Algo.Strategies
Assembly:  StockSharp.Algo.Strategies (in StockSharp.Algo.Strategies.dll) Version: 4.4.17.0 (4.4.17)
Syntax
C#
public static MarketRule<Order, MyTrade> Protect(
	this MarketRule<Order, MyTrade> rule,
	Func<MyTrade, TakeProfitStrategy> takeProfit,
	Func<MyTrade, StopLossStrategy> stopLoss
)

Parameters

rule
Type: StockSharp.AlgoMarketRuleOrder, MyTrade
Правило на появление новых сделок.
takeProfit
Type: SystemFuncMyTrade, TakeProfitStrategy
Функция, создающая по сделке стратегию TakeProfitStrategy.
stopLoss
Type: SystemFuncMyTrade, StopLossStrategy
Функция, создающая по сделке стратегию StopLossStrategy.

Return Value

Type: MarketRuleOrder, MyTrade
Правило.

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