IMarketRule
The interface of the rule, activating action at occurrence of market condition.
Implements: IDisposable
Properties
public IMarketRuleContainer Container { get; set; }
value = iMarketRule.Container
iMarketRule.Container = value
The rules container.
public ISynchronizedCollection<IMarketRule> ExclusiveRules { get; }
value = iMarketRule.ExclusiveRules
Rules, opposite to given rule. They are deleted automatically at activation of this rule.
public bool IsActive { get; set; }
value = iMarketRule.IsActive
iMarketRule.IsActive = value
Is the rule currently activated.
public bool IsSuspended { get; set; }
value = iMarketRule.IsSuspended
iMarketRule.IsSuspended = value
Is the rule suspended.
public LogLevels LogLevel { get; set; }
value = iMarketRule.LogLevel
iMarketRule.LogLevel = value
The level to perform this rule logging.
public string Name { get; set; }
value = iMarketRule.Name
iMarketRule.Name = value
The name of the rule.
public object Token { get; }
value = iMarketRule.Token
Token-rules, it is associated with (for example, for rule ISubscriptionProvider) the order will be a token). If rule is not associated with anything, will be returned.
Methods
public bool CanFinish()
result = iMarketRule.CanFinish()
Can the rule be ended.
Returns: , if rule is not required any more. Otherwise, .
public IMarketRule Do(Action action)
result = iMarketRule.Do(action)
To add the action, activated at occurrence of condition.
- action
- Action.
Returns: Rule.
public IMarketRule Do(Action<object> action)
result = iMarketRule.Do(action)
To add the action, activated at occurrence of condition.
- action
- The action, taking a value.
Returns: Rule.
public IMarketRule Do<TResult>(Func<TResult> action)
result = iMarketRule.Do(action)
To add the action, returning result, activated at occurrence of condition.
- action
- The action, returning a result.
Returns: Rule.
public IMarketRule Until(Func<bool> canFinish)
result = iMarketRule.Until(canFinish)
To make the rule periodical (will be called until returns ).
- canFinish
- The criteria for end of periodicity.
Returns: Rule.