EntityCache

StockSharp.Algo

Entity cache for storing orders, trades, news and other trading entities.

Реализует: ISnapshotHolder

Конструкторы

EntityCache(ILogReceiver, Func<SecurityId?, Security>, IExchangeInfoProvider, IPositionProvider)

Entity cache for storing orders, trades, news and other trading entities.

logReceiver
Log receiver for logging messages.
tryGetSecurity
Function to get security by id.
exchangeInfoProvider
Exchange info provider.
positionProvider
Position provider.

Свойства

ExchangeInfoProvider : IExchangeInfoProvider

Exchange info provider.

MyTrades : IEnumerable<MyTrade>

All own trades.

News : IEnumerable<News>

All news.

OrderCancelFails : IEnumerable<OrderFail>

Order cancellation failures.

OrderEditFails : IEnumerable<OrderFail>

Order modification failures.

OrderRegisterFails : IEnumerable<OrderFail>

Order registration failures.

Orders : IEnumerable<Order>

All orders.

OrdersKeepCount : int

Maximum number of orders to keep in cache. Default is 1000.

Методы

AddFail(OrderOperations, OrderFail)

Add order fail.

operation
Operation.
fail
Fail.
AddOrderByCancelationId(Order, long)

Add order by cancelation transaction id.

order
Order.
transactionId
Transaction id.
AddOrderByEditionId(Order, long)

Add order by edition transaction id.

order
Order.
transactionId
Transaction id.
AddOrderByRegistrationId(Order)

Add order by registration transaction id.

order
Order.
AddOrderFailById(OrderFail, OrderOperations, long)

Add order fail by transaction id.

fail
Order fail.
operation
Order operation.
transactionId
Transaction id.
AddOrderStatusTransactionId(long)

Add order status transaction id.

transactionId
Transaction id.
Clear()

Clear all cached data.

GetLevel1Fields(Security) : IEnumerable<Level1Fields>

Get available Level1 fields for security.

security
Security.

Возвращает: Fields.

GetOrders(Security, OrderStates) : IEnumerable<Order>

Get orders by security and state.

security
Security.
state
Order state.

Возвращает: Orders.

GetSecurityValue(Security, Level1Fields) : object

Get security Level1 field value.

security
Security.
field
Field.

Возвращает: Value.

GetSecurityValues(Security, DateTime) : Level1Info

Get or create Level1 info for security.

security
Security.
serverTime
Server time.

Возвращает: Level1 info.

HasLevel1Info(Security) : bool

Check if security has Level1 info.

security
Security.

Возвращает: if has info.

IsMassCancelation(long) : bool

Check if transaction is mass cancelation.

transactionId
Transaction id.

Возвращает: if mass cancelation.

IsOrderStatusRequest(long) : bool

Check if transaction is order status request.

transactionId
Transaction id.

Возвращает: if order status request.

ProcessNewsMessage(Security, NewsMessage) : ValueTuple<News, bool>

Process news message.

security
Security.
message
Message.

Возвращает: News and is new flag.

ProcessOrderFailMessage(Order, Security, ExecutionMessage) : IEnumerable<ValueTuple<OrderFail, OrderOperations>>

Process order fail message.

order
Order.
security
Security.
message
Message.

Возвращает: Order fails with operations.

ProcessOrderMessage(Order, Security, ExecutionMessage, long, Func<string, Portfolio>) : IEnumerable<OrderChangeInfo>

Process order message.

order
Order.
security
Security.
message
Message.
transactionId
Transaction id.
getPortfolio
Function to get portfolio.

Возвращает: Order change info.

ProcessOwnTradeMessage(Order, Security, ExecutionMessage, long) : ValueTuple<MyTrade, bool>

Process own trade message.

order
Order.
security
Security.
message
Message.
transactionId
Transaction id.

Возвращает: Trade and is new flag.

RemoveOrderStatusTransactionId(long)

Remove order status transaction id.

transactionId
Transaction id.
TryAddMassCancelationId(long)

Try add mass cancelation transaction id.

transactionId
Transaction id.
TryGetAdapter(Order) : IMessageAdapter

Try get message adapter for order.

order
Order.

Возвращает: Adapter or .

TryGetOrder(long?, string) : Order

Try get order by id.

orderId
Order id.
orderStringId
Order string id.

Возвращает: Order or .

TryGetOrder(long, OrderOperations) : Order

Try get order by transaction id and operation.

transactionId
Transaction id.
operation
Operation.

Возвращает: Order or .

TrySetAdapter(Order, IMessageAdapter)

Try set message adapter for order.

order
Order.
adapter
Adapter.
UpdateOrderBookSnapshot(QuoteChangeMessage)

Update cached order book snapshot for a security.

message
Order book message.