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
CreateTrade()
Creates a new market trade (tick).
Trade CreateTrade()
Returns
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
idstringThe trade ID.
createFunc<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
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
accountIdstringThe account ID.
createFunc<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
portfolioPortfolioThe portfolio.
securitySecurityThe security.
createFunc<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
idstringThe security ID.
createFunc<string, Security>Creates a new security for the ID.
Returns
- Security
The existing or new security.