MarketRule

StockSharp.Algo

The rule, activating action at market condition occurrence.

Inherits: BaseLogReceiver

Implements: IMarketRule, IDisposable

Constructors

MarketRule
protected MarketRule(TToken token)
marketRule = MarketRule(token)

Initialize MarketRule.

token
Token rules.

Properties

Container
public IMarketRuleContainer Container { get; set; }
value = marketRule.Container
marketRule.Container = value

The rules container.

ExclusiveRules
public virtual ISynchronizedCollection<IMarketRule> ExclusiveRules { get; }
value = marketRule.ExclusiveRules

Rules, opposite to given rule. They are deleted automatically at activation of this rule.

IsActive
public bool IsActive { get; set; }
value = marketRule.IsActive
marketRule.IsActive = value

Is the rule currently activated.

IsReady
public bool IsReady { get; }
value = marketRule.IsReady

Is the rule formed.

IsSuspended
public virtual bool IsSuspended { get; set; }
value = marketRule.IsSuspended
marketRule.IsSuspended = value

Is the rule suspended.

Methods

Activate
protected virtual void Activate(TArg arg)
marketRule.Activate(arg)

To activate the rule.

arg
The value, which will be sent to processor, registered through Action{.
Activate
protected void Activate()
marketRule.Activate()

To activate the rule.

Activated
public MarketRule<TToken, TArg> Activated(Action handler)
result = marketRule.Activated(handler)

To add the processor, which will be called at action activation.

handler
The handler.

Returns: Rule.

Activated``1
public MarketRule<TToken, TArg> Activated<TResult>(Action<TResult> handler)
result = marketRule.Activated(handler)

To add the processor, accepting argument from Func{, which will be called at action activation.

handler
The handler.

Returns: Rule.

CanFinish
protected virtual bool CanFinish()
result = marketRule.CanFinish()

Can the rule be ended.

Returns: , if rule is not required any more. Otherwise, .

DisposeManaged
protected override void DisposeManaged()
marketRule.DisposeManaged()

Release resources.

Do
public MarketRule<TToken, TArg> Do(Action<TArg> action)
result = marketRule.Do(action)

To add the action, activated at occurrence of condition.

action
Action.

Returns: Rule.

Do
public MarketRule<TToken, TArg> Do(Action<MarketRule<TToken, TArg>, TArg> action)
result = marketRule.Do(action)

To add the action, activated at occurrence of condition.

action
Action.

Returns: Rule.

Do
public MarketRule<TToken, TArg> Do(Action action)
result = marketRule.Do(action)

To add the action, activated at occurrence of condition.

action
Action.

Returns: Rule.

Do``1
public MarketRule<TToken, TArg> Do<TResult>(Func<MarketRule<TToken, TArg>, TArg, TResult> action)
result = marketRule.Do(action)

To add the action, returning result, activated at occurrence of condition.

action
The action, returning a result.

Returns: Rule.

Do``1
public MarketRule<TToken, TArg> Do<TResult>(Func<TArg, TResult> action)
result = marketRule.Do(action)

To add the action, returning result, activated at occurrence of condition.

action
The action, returning a result.

Returns: Rule.

Do``1
public MarketRule<TToken, TArg> Do<TResult>(Func<TResult> action)
result = marketRule.Do(action)

To add the action, returning result, activated at occurrence of condition.

action
The action, returning a result.

Returns: Rule.

ToString
public override string ToString()
result = marketRule.ToString()

Преобразовать к строковому представлению.

Returns: Строковое представление.

Until
public MarketRule<TToken, TArg> Until(Func<bool> canFinish)
result = marketRule.Until(canFinish)

To make the rule periodical (will be called until returns ).

canFinish
The criteria for end of periodicity.

Returns: Rule.