EntitiesExtensions
Extension class for BusinessEntities.
Свойства
AllCandleMessageTypes : IEnumerable<Type>
All registered candle message types.
AllSecurity : Security
"All securities" instance.
TrySecurityProvider : ISecurityProvider
ISecurityProvider
Методы
AddOrSubtractTradingDays(ExchangeBoard, DateTime, int, bool) : DateTime
To get date of day T +/- of N trading days.
- board
- Board info.
- date
- The start T date, to which are added or subtracted N trading days.
- n
- The N size. The number of trading days for the addition or subtraction.
- checkHolidays
- Whether to check the passed date for a weekday (Saturday and Sunday are days off, returned value for them is ).
Возвращает: The end T +/- N date.
ApplyChanges(ExchangeBoard, BoardMessage)
To convert the message into board.
- board
- Board.
- message
- Message.
Возвращает: Board.
ApplyChanges(Portfolio, PositionChangeMessage, IExchangeInfoProvider)
Apply changes to the portfolio object.
- portfolio
- Portfolio.
- message
- Portfolio change message.
- exchangeInfoProvider
- Exchanges and trading boards provider.
ApplyChanges(Position, PositionChangeMessage)
Apply changes to the position object.
- position
- Position.
- message
- Position change message.
ApplyChanges(Security, IEnumerable<KeyValuePair<Level1Fields, object>>, DateTime, DateTime, Action<Security, Level1Fields, object>)
Apply change to the security object.
- security
- Security.
- changes
- Changes.
- serverTime
- Change server time.
- localTime
- Local timestamp when a message was received/created.
- defaultHandler
- Default handler.
ApplyChanges(Security, Level1ChangeMessage)
Apply change to the security object.
- security
- Security.
- message
- Changes.
ApplyChanges(Security, SecurityMessage, IExchangeInfoProvider, bool)
Apply change to the security object.
- security
- Security.
- message
- Meta info.
- exchangeInfoProvider
- Exchanges and trading boards provider.
- isOverride
- Override previous security data by new values.
ApplyNewState(Order, OrderStates, ILogReceiver)
Check the possibility order's state change.
- order
- Order.
- state
- Current order's state.
- logs
- Logs.
CreateCancelMessage(Order, SecurityId, long) : OrderCancelMessage
To create the message of cancelling old order.
- order
- Order.
- securityId
- Security ID.
- transactionId
- The transaction number.
Возвращает: Message.
CreateRegisterMessage(Order, SecurityId?) : OrderRegisterMessage
To create the message of new order registration.
- order
- Order.
- securityId
- Security ID.
Возвращает: Message.
CreateReplaceMessage(Order, Order, SecurityId) : OrderReplaceMessage
To create the message of replacing old order with new one.
- oldOrder
- Old order.
- newOrder
- New order.
- securityId
- Security ID.
Возвращает: Message.
FillMessage``1(Security, T)
To convert the instrument into message.
- security
- Security.
- message
- Message.
Возвращает: Message.
Filter(IEnumerable<Security>, Security) : IEnumerable<Position>
To filter instruments by the given criteria.
- securities
- Securities.
- criteria
- The instrument whose fields will be used as a filter.
Возвращает: Instruments filtered.
Filter(IEnumerable<ExchangeBoard>, BoardLookupMessage) : IEnumerable<Position>
Filter boards by code criteria.
- boards
- All boards.
- criteria
- Criteria.
Возвращает: Found boards.
Filter(IEnumerable<Security>, ExchangeBoard) : IEnumerable<Position>
To filter instruments by the trading board.
- securities
- Securities.
- board
- Trading board.
Возвращает: Instruments filtered.
Filter(IEnumerable<Portfolio>, PortfolioLookupMessage) : IEnumerable<Position>
Filter portfolios by the specified criteria.
- portfolios
- All portfolios.
- criteria
- Criteria.
Возвращает: Found portfolios.
Filter(IEnumerable<MyTrade>, Order) : IEnumerable<Position>
To filter own trades for the given order.
- myTrades
- All own trades, in which the required shall be looked for.
- order
- The order, for which trades shall be filtered.
Возвращает: Filtered orders.
Filter(IEnumerable<MyTrade>, Portfolio) : IEnumerable<Position>
To filter own trades for the given portfolio.
- myTrades
- All own trades, in which the required shall be looked for.
- portfolio
- The portfolio, for which the trades shall be filtered.
Возвращает: Filtered trades.
Filter(IEnumerable<Position>, Portfolio) : IEnumerable<Position>
To filter positions for the given portfolio.
- positions
- All positions, in which the required shall be searched for.
- portfolio
- The portfolio, for which positions shall be filtered.
Возвращает: Filtered positions.
Filter(IEnumerable<Order>, Sides) : IEnumerable<Position>
To filter orders for the given direction.
- orders
- All orders, in which the required shall be searched for.
- side
- Order side.
Возвращает: Filtered orders.
Filter(IEnumerable<Order>, OrderStates) : IEnumerable<Position>
To filter orders for the given condition.
- orders
- All orders, in which the required shall be searched for.
- state
- Order state.
Возвращает: Filtered orders.
Filter(IEnumerable<Order>, Portfolio) : IEnumerable<Position>
To filter orders for the given portfolio.
- orders
- All orders, in which the required shall be searched for.
- portfolio
- The portfolio, for which the orders shall be filtered.
Возвращает: Filtered orders.
Filter(IEnumerable<Security>, SecurityLookupMessage) : IEnumerable<Position>
To filter instruments by the given criteria.
- securities
- Securities.
- criteria
- Message security lookup for specified criteria.
Возвращает: Instruments filtered.
Filter(IEnumerable<Position>, PortfolioLookupMessage) : IEnumerable<Position>
Filter positions the specified criteria.
- positions
- All positions.
- criteria
- Criteria.
Возвращает: Found positions.
FindSubscriptions(ISubscriptionProvider, Security, DataType) : IEnumerable<Subscription>
Find subscriptions for the specified security and data type.
- provider
- Subscription provider.
- security
- Security.
- dataType
- Data type info.
Возвращает: Subscriptions.
FindSubscriptions(ISubscriptionProvider, SecurityId, DataType) : IEnumerable<Subscription>
Find subscriptions for the specified security and data type.
- provider
- Subscription provider.
- securityId
- SecurityId
- dataType
- Data type info.
Возвращает: Subscriptions.
GetAveragePrice(IEnumerable<MyTrade>) : decimal
To get the weighted mean price of matching by own trades.
- trades
- Trades, for which the weighted mean price of matching shall be got.
Возвращает: The weighted mean price. If no trades, 0 is returned.
GetExpiryDates(DateTime, DateTime) : IEnumerable<DateTime>
To get the expiration date for Forts.
- from
- The start of the expiration range.
- to
- The end of the expiration range.
Возвращает: Expiration dates.
GetOrCreateBoard(IExchangeInfoProvider, string, Func<string, ExchangeBoard>) : ExchangeBoard
To get a board by its code. If board with the passed name does not exist, then it will be created.
- exchangeInfoProvider
- Exchanges and trading boards provider.
- code
- Board code.
- createBoard
- The handler creating a board, if it is not found. If the value is , then the board is created by default initialization.
Возвращает: Exchange board.
GetOrCreateBoard(IExchangeInfoProvider, string, bool, Func<string, ExchangeBoard>) : ExchangeBoard
To get a board by its code. If board with the passed name does not exist, then it will be created.
- exchangeInfoProvider
- Exchanges and trading boards provider.
- code
- Board code.
- isNew
- Is newly created.
- createBoard
- The handler creating a board, if it is not found. If the value is , then the board is created by default initialization.
Возвращает: Exchange board.
HasExternalId(SecurityId) : bool
To check, if SecurityId contains identifiers of external sources.
- securityId
- Security ID.
Возвращает: , if there are identifiers of external sources, otherwise, .
IsAllSecurity(Security) : bool
Check if the specified security is AllSecurity.
- security
- Security.
Возвращает: , if the specified security is AllSecurity, otherwise, .
IsLookupAll(Security) : bool
Determine the contains lookup all filter.
- criteria
- The instrument whose fields will be used as a filter.
Возвращает: Check result.
Lookup(ISecurityProvider, SecurityLookupMessage) : IEnumerable<Security>
Lookup securities by criteria .
- provider
- ISecurityProvider
- criteria
- Message security lookup for specified criteria.
Возвращает: Found instruments.
LookupBoards(IExchangeInfoProvider, BoardLookupMessage) : IEnumerable<ExchangeBoard>
Filter boards by code criteria.
- provider
- The exchange boards provider.
- criteria
- Criteria.
Возвращает: Found boards.
LookupBoards2(IExchangeInfoProvider, BoardLookupMessage) : IEnumerable<BoardMessage>
Filter boards by code criteria.
- provider
- The exchange boards provider.
- criteria
- Criteria.
Возвращает: Found boards.
LookupById(ISecurityProvider, string) : Security
To get the instrument by the identifier.
- provider
- The provider of information about instruments.
- id
- Security ID.
Возвращает: The got instrument. If there is no instrument by given criteria, is returned.
LookupById(ISecurityProvider, SecurityId) : Security
To get the instrument by the identifier.
- provider
- ISecurityProvider
- id
- Security ID.
Возвращает: The got instrument. If there is no instrument by given criteria, is returned.
Pips(int, Security) : Unit
To create from Int32 the pips values.
- value
- Int32 value.
- security
- The instrument from which information about the price increment is taken.
Возвращает: Pips.
Pips(double, Security) : Unit
To create from Double the pips values.
- value
- Double value.
- security
- The instrument from which information about the price increment is taken.
Возвращает: Pips.
Pips(decimal, Security) : Unit
To create from Decimal the pips values.
- value
- Decimal value.
- security
- The instrument from which information about the price increment is taken.
Возвращает: Pips.
Points(double, Security) : Unit
To create from Double the points values.
- value
- Double value.
- security
- The instrument from which information about the price increment cost is taken.
Возвращает: Points.
Points(int, Security) : Unit
To create from Int32 the points values.
- value
- Int32 value.
- security
- The instrument from which information about the price increment cost is taken.
Возвращает: Points.
Points(decimal, Security) : Unit
To create from Decimal the points values.
- value
- Decimal value.
- security
- The instrument from which information about the price increment cost is taken.
Возвращает: Points.
RequestNewsStory(ISubscriptionProvider, News)
Request news story subscription.
- provider
- Subscription provider.
- news
- News item to subscribe to.
ReRegisterClone(Order, decimal?, decimal?) : Order
To create copy of the order for re-registration.
- oldOrder
- The original order.
- newPrice
- Price of the new order.
- newVolume
- Volume of the new order.
Возвращает: New order.
ReRegisterOrder(ITransactionProvider, Order, decimal, decimal) : Order
Reregister the order.
- provider
- The transactional provider.
- oldOrder
- Changing order.
- price
- Price of the new order.
- volume
- Volume of the new order.
Возвращает: New order.
ReRegisterOrderEx(ITransactionProvider, Order, Order)
Reregister the order.
- provider
- The transactional provider.
- order
- Order.
- clone
- Changes.
ShrinkPrice(Security, decimal) : decimal
To cut the price, to make it multiple of minimal step, also to limit number of signs after the comma.
- security
- Security
- price
- The price to be made multiple.
Возвращает: The multiple price.
ToBoard(BoardMessage) : ExchangeBoard
To convert the message into board.
- message
- Message.
Возвращает: Board.
ToChangeMessage(Position, long) : PositionChangeMessage
To convert the position into message.
- position
- Position.
- originalTransactionId
- ID of original transaction, for which this message is the answer.
Возвращает: Message.
ToChangeMessage(Portfolio) : PositionChangeMessage
To convert the portfolio into message.
- portfolio
- Portfolio.
Возвращает: Message.
ToDataTypeString(MarketDataMessage) : string
Format data type into into human-readable string.
- message
- Market-data message (uses as a subscribe/unsubscribe in outgoing case, confirmation event in incoming case).
Возвращает: String.
ToExchange(BoardMessage) : Exchange
To convert the message into exchange.
- message
- Message.
Возвращает: Exchange.
ToExchange(BoardMessage, Exchange) : Exchange
To convert the message into exchange.
- message
- Message.
- exchange
- Exchange.
Возвращает: Exchange.
ToExternalId(SecurityId) : SecurityExternalId
Cast SecurityId to the SecurityExternalId.
- securityId
- SecurityId.
Возвращает: SecurityExternalId.
ToLookupCriteria(SecurityLookupMessage, IExchangeInfoProvider) : Security
Convert SecurityLookupMessage message to Security criteria.
- message
- Message.
- exchangeInfoProvider
- Exchanges and trading boards provider.
Возвращает: Criteria.
ToLookupCriteria(Order, decimal?, Sides?) : OrderStatusMessage
Convert Order to OrderStatusMessage value.
- criteria
- The criterion which fields will be used as a filter.
- volume
- Volume.
- side
- Order side.
Возвращает: A message requesting current registered orders and trades.
ToLookupCriteria(Portfolio) : PortfolioLookupMessage
Convert Portfolio to PortfolioLookupMessage value.
- criteria
- The criterion which fields will be used as a filter.
Возвращает: Message portfolio lookup for specified criteria.
ToLookupMessage(Security) : SecurityLookupMessage
Convert Security criteria to SecurityLookupMessage.
- criteria
- Criteria.
Возвращает: Message.
ToMessage(Security, SecurityId?, long, bool) : SecurityMessage
To convert the instrument into message.
- security
- Security.
- securityId
- Security ID.
- originalTransactionId
- ID of original transaction, for which this message is the answer.
- copyExtendedId
- Copy ExternalId and Type.
Возвращает: Message.
ToMessage(OrderFail, long) : BoardMessage
To convert the error description into message.
- fail
- Error details.
- originalTransactionId
- ID of original transaction, for which this message is the answer.
Возвращает: Message.
ToMessage(MyTrade) : NewsMessage
To convert the own trade into message.
- trade
- Own trade.
Возвращает: Message.
ToMessage(ExchangeBoard, long) : BoardMessage
To convert the board into message.
- board
- Board.
- originalTransactionId
- ID of original transaction, for which this message is the answer.
Возвращает: Message.
ToMessage(Portfolio, long) : BoardMessage
To convert the portfolio into message.
- portfolio
- Portfolio.
- originalTransactionId
- ID of original transaction, for which this message is the answer.
Возвращает: Message.
ToNews(NewsMessage, IExchangeInfoProvider) : News
Cast NewsMessage to the News.
- message
- Message.
- exchangeInfoProvider
- Exchanges and trading boards provider.
Возвращает: News.
ToOrder(ExecutionMessage, Security) : Order
To convert the message into order.
- message
- Message.
- security
- Security.
Возвращает: Order.
ToOrder(ExecutionMessage, Order) : Order
To convert the message into order.
- message
- Message.
- order
- The order.
Возвращает: Order.
ToPortfolio(PortfolioMessage, Portfolio, IExchangeInfoProvider) : Portfolio
Cast PortfolioMessage to the Portfolio.
- message
- Message.
- portfolio
- Portfolio.
- exchangeInfoProvider
- Exchanges and trading boards provider.
Возвращает: Portfolio.
ToSecurity(SecurityMessage, IExchangeInfoProvider) : Security
To convert the message into instrument.
- message
- Message.
- exchangeInfoProvider
- Exchanges and trading boards provider.
Возвращает: Security.
ToSecurityId(SecurityExternalId, string, string) : SecurityId
Cast SecurityExternalId to the SecurityId.
- externalId
- SecurityExternalId.
- securityCode
- Security code.
- boardCode
- Board code.
Возвращает: SecurityId.
ToSecurityId(SecurityExternalId, SecurityId) : SecurityId
Cast SecurityExternalId to the SecurityId.
- externalId
- SecurityExternalId.
- secId
- SecurityId.
Возвращает: SecurityId.
ToSecurityId(Security, SecurityIdGenerator, bool, bool) : SecurityId
To convert the instrument into SecurityId.
- security
- Security.
- idGenerator
- The instrument identifiers generator Id.
- boardIsRequired
- Board is required.
- copyExtended
- Copy ExternalId and Type.
Возвращает: Security ID.
TryGetSecurity(Subscription, ISecurityProvider) : Security
Try to get the security for the specified subscription.
- subscription
- Subscription
- provider
- ISecurityProvider
Возвращает: Security
Поля
LookupAllCriteria : Security
Lookup all securities predefined criteria.
MoneySecurity : Security
"Money" security instance.
NewsSecurity : Security
"News" security instance.