Table of Contents

Class SecurityRouteCache

Namespace
ATAS.DataFeedsCore
Assembly
ATAS.DataFeedsCore.dll

Set of SecurityRoute rules of one TradingOptions, indexed by exchange and code. Not thread-safe.

public class SecurityRouteCache
Inheritance
object
SecurityRouteCache
Extension Methods

Constructors

SecurityRouteCache(TradingOptions)

Initializes an empty set of rules for the trading options.

public SecurityRouteCache(TradingOptions tradingOptions)

Parameters

tradingOptions TradingOptions

The owner options; its Id is written to the rules returned by GetRoutes().

Exceptions

ArgumentNullException

tradingOptions is null.

Methods

Add(SecurityRoute)

Adds the rule, replacing an existing rule with the same exchange and code.

public void Add(SecurityRoute route)

Parameters

route SecurityRoute

The rule.

Add(IEnumerable<SecurityRoute>)

Adds the rules, replacing existing rules with the same exchange and code.

public void Add(IEnumerable<SecurityRoute> routes)

Parameters

routes IEnumerable<SecurityRoute>

The rules.

Clear()

Removes all rules.

public void Clear()

GetRoute(Security)

Finds the account to route orders for the security to. Rules for the security's exchange are used when there are any, otherwise the exchange rules; among them the rule for the security's code wins over the code rule.

Added in ATAS 8.0.15.

public string? GetRoute(Security security)

Parameters

security Security

The security of the order.

Returns

string

The account, or null when no rule matches.

GetRoutes()

Returns all rules, setting their TradingOptionsId to the owner options' identifier.

public IEnumerable<SecurityRoute> GetRoutes()

Returns

IEnumerable<SecurityRoute>

A materialized array of the rules.