EntitiesExtensions

StockSharp.BusinessEntities

Extension class for BusinessEntities.

プロパティ

AllCandleMessageTypes : IEnumerable<Type>

All registered candle message types.

AllSecurity : Security

"All securities" instance.

メソッド

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.

EnumerateExchangeBoards() : IEnumerable<ExchangeBoard>

To get a list of boards.

戻り値: Boards.

EnumerateExchanges() : IEnumerable<Exchange>

To get a list of exchanges.

戻り値: Exchanges.

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(Order) : NewsMessage

To convert the order into message.

order
Order.

戻り値: 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(News) : NewsMessage

To convert news into message.

news
News.

戻り値: 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.