StrategyHelper

StockSharp.Algo.Strategies

Extension class for Strategy.

Métodos

Cancel(IMarketRule, Order) : IMarketRule

To create an action, cancelling the order.

rule
Rule.
order
The order to be cancelled.

Retorna: Rule.

ExecAsync(Strategy, Func<CancellationToken, ValueTask>, CancellationToken) : ValueTask<ValueTuple<bool, Exception>>

Execute strategy.

strategy
Strategy.
extra
Extra action.
cancellationToken
CancellationToken.

Retorna: ValueTask.

Register(IMarketRule, Order) : IMarketRule

To create an action, registering the order.

rule
Rule.
order
The order to be registered.

Retorna: Rule.

ReRegister(IMarketRule, Order, Order) : IMarketRule

To create an action, re-registering the order.

rule
Rule.
oldOrder
The order to be re-registered.
newOrder
Information about new order.

Retorna: Rule.

WhenError(Strategy, bool) : MarketRule<Strategy, Exception>

To create a rule for event of strategy error (transition of state ErrorState into Error).

strategy
The strategy, based on which error will be expected.
processChildStrategyErrors
Process the child strategies errors.

Retorna: Rule.

WhenNewMyTrade(Strategy) : MarketRule<Strategy, MyTrade>

To create a rule for the event of occurrence new strategy trade.

strategy
The strategy, based on which trade occurrence will be traced.

Retorna: Rule.

WhenOrderRegistered(Strategy) : MarketRule<Strategy, Order>

To create a rule for event of occurrence of new strategy order.

strategy
The strategy, based on which order occurrence will be traced.

Retorna: Rule.

WhenPnLChanged(Strategy) : MarketRule<Strategy, decimal>

To create a rule for event of profit change.

strategy
The strategy, based on which the profit change will be traced.

Retorna: Rule.

WhenPnLLess(Strategy, Unit) : MarketRule<Strategy, decimal>

To create a rule for event of profit reduction below the specified level.

strategy
The strategy, based on which the profit change will be traced.
value
The level. If the Type type equals to Absolute, specified price is set. Otherwise, shift value is specified.

Retorna: Rule.

WhenPnLMore(Strategy, Unit) : MarketRule<Strategy, decimal>

To create a rule for event of profit increase above the specified level.

strategy
The strategy, based on which the profit change will be traced.
value
The level. If the Type type equals to Absolute, specified price is set. Otherwise, shift value is specified.

Retorna: Rule.

WhenPositionChanged(Strategy) : MarketRule<Strategy, decimal>

To create a rule for the event of strategy position change.

strategy
The strategy, based on which position change will be traced.

Retorna: Rule.

WhenPositionLess(Strategy, Unit) : MarketRule<Strategy, decimal>

To create a rule for event of position event reduction below the specified level.

strategy
The strategy, based on which position change will be traced.
value
The level. If the Type type equals to Absolute, specified price is set. Otherwise, shift value is specified.

Retorna: Rule.

WhenPositionMore(Strategy, Unit) : MarketRule<Strategy, decimal>

To create a rule for event of position event increase above the specified level.

strategy
The strategy, based on which position change will be traced.
value
The level. If the Type type equals to Absolute, specified price is set. Otherwise, shift value is specified.

Retorna: Rule.

WhenStarted(Strategy) : MarketRule<Strategy, Strategy>

To create a rule for event of start of strategy operation.

strategy
The strategy, based on which the start of strategy operation will be expected.

Retorna: Rule.

WhenStopped(Strategy) : MarketRule<Strategy, Strategy>

To create a rule for event full stop of strategy operation.

strategy
The strategy, based on which the full stop will be expected.

Retorna: Rule.

WhenStopping(Strategy) : MarketRule<Strategy, Strategy>

To create a rule for event of beginning of the strategy operation stop.

strategy
The strategy, based on which the beginning of stop will be determined.

Retorna: Rule.

WhenWarning(Strategy) : MarketRule<Strategy, Strategy>

To create a rule for event of strategy warning (transition of state ErrorState into Warning).

strategy
The strategy, based on which the warning will be expected.

Retorna: Rule.