Table of Contents

Interface IMarketRule

Namespace
StockSharp.Algo
Assembly
StockSharp.Algo.dll

The interface of the rule, activating action at occurrence of market condition.

public interface IMarketRule : IDisposable
Inherited Members
Extension Methods

Properties

Container

The rules container.

IMarketRuleContainer Container { get; set; }

Property Value

IMarketRuleContainer

ExclusiveRules

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

ISynchronizedCollection<IMarketRule> ExclusiveRules { get; }

Property Value

ISynchronizedCollection<IMarketRule>

IsActive

Is the rule currently activated.

bool IsActive { get; set; }

Property Value

bool

IsReady

Is the rule formed.

bool IsReady { get; }

Property Value

bool

IsSuspended

Is the rule suspended.

bool IsSuspended { get; set; }

Property Value

bool

LogLevel

The level to perform this rule logging.

LogLevels LogLevel { get; set; }

Property Value

LogLevels

Name

The name of the rule.

string Name { get; set; }

Property Value

string

Token

Token-rules, it is associated with (for example, for rule WhenRegistered(Order, ITransactionProvider) the order will be a token). If rule is not associated with anything, null will be returned.

object Token { get; }

Property Value

object

Methods

CanFinish()

Can the rule be ended.

bool CanFinish()

Returns

bool

true, if rule is not required any more. Otherwise, false.

Do(Action)

To add the action, activated at occurrence of condition.

IMarketRule Do(Action action)

Parameters

action Action

Action.

Returns

IMarketRule

Rule.

Do(Action<object>)

To add the action, activated at occurrence of condition.

IMarketRule Do(Action<object> action)

Parameters

action Action<object>

The action, taking a value.

Returns

IMarketRule

Rule.

Do<TResult>(Func<TResult>)

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

IMarketRule Do<TResult>(Func<TResult> action)

Parameters

action Func<TResult>

The action, returning a result.

Returns

IMarketRule

Rule.

Type Parameters

TResult

The type of returned result.

Until(Func<bool>)

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

IMarketRule Until(Func<bool> canFinish)

Parameters

canFinish Func<bool>

The criteria for end of periodicity.

Returns

IMarketRule

Rule.