StrategyHelper
Extension class for Strategy.
Методы
Cancel(IMarketRule, Order) : IMarketRule
To create an action, cancelling the order.
- rule
- Rule.
- order
- The order to be cancelled.
Возвращает: Rule.
ExecAsync(Strategy, Func<CancellationToken, ValueTask>, CancellationToken) : ValueTask<ValueTuple<bool, Exception>>
Execute strategy.
- strategy
- Strategy.
- extra
- Extra action.
- cancellationToken
- CancellationToken.
Возвращает: ValueTask.
Register(IMarketRule, Order) : IMarketRule
To create an action, registering the order.
- rule
- Rule.
- order
- The order to be registered.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: 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.
Возвращает: Rule.