Table of Contents

Interface IEntityFactory

Namespace
ATAS.DataFeedsCore
Assembly
ATAS.DataFeedsCore.dll

Creates the entities a connector produces, or returns existing instances, so that a host can share one instance per identifier (for example a database cache or a basket connector). The default connector implementation always calls the supplied factory.

public interface IEntityFactory
Extension Methods

Methods

CreateMarketDepth()

Creates a new market depth level.

MarketDepth CreateMarketDepth()

Returns

MarketDepth

CreateTrade()

Creates a new market trade (tick).

Trade CreateTrade()

Returns

Trade

GetOrCreateMyTrade(string, Func<string, MyTrade>)

Returns the own trade with the identifier, creating it with create when needed.

MyTrade GetOrCreateMyTrade(string id, Func<string, MyTrade> create)

Parameters

id string

The trade ID.

create Func<string, MyTrade>

Creates a new trade for the ID.

Returns

MyTrade

The existing or new trade.

GetOrCreateOrder(long, Func<long, Order>)

Returns the order with the ExtId, creating it with create when needed.

Order GetOrCreateOrder(long extId, Func<long, Order> create)

Parameters

extId long

The ExtId of the order.

create Func<long, Order>

Creates a new order for the identifier.

Returns

Order

The existing or new order.

GetOrCreatePortfolio(string, Func<string, Portfolio>)

Returns the portfolio with the account ID, creating it with create when needed.

Portfolio GetOrCreatePortfolio(string accountId, Func<string, Portfolio> create)

Parameters

accountId string

The account ID.

create Func<string, Portfolio>

Creates a new portfolio for the account ID.

Returns

Portfolio

The existing or new portfolio.

GetOrCreatePosition(Portfolio, Security, Func<Portfolio, Security, Position>)

Returns the position of the portfolio in the security, creating it with create when needed.

Position GetOrCreatePosition(Portfolio portfolio, Security security, Func<Portfolio, Security, Position> create)

Parameters

portfolio Portfolio

The portfolio.

security Security

The security.

create Func<Portfolio, Security, Position>

Creates a new position for the portfolio and security.

Returns

Position

The existing or new position.

GetOrCreateSecurity(string, Func<string, Security>)

Returns the security with the identifier, creating it with create when needed.

Security GetOrCreateSecurity(string id, Func<string, Security> create)

Parameters

id string

The security ID.

create Func<string, Security>

Creates a new security for the ID.

Returns

Security

The existing or new security.