Class TraderHelper
- Namespace
- StockSharp.Algo
- Assembly
- StockSharp.Algo.dll
The auxiliary class for provision of various algorithmic functionalities.
public static class TraderHelper
- Inheritance
-
TraderHelper
- Inherited Members
Properties
IndicatorValue
Indicator value.
public static DataType IndicatorValue { get; }
Property Value
UsdRateMinAvailableTime
The earliest date for which there is an indicative rate of US dollar to the Russian ruble. It is 2 November 2009.
[Obsolete]
public static DateTime UsdRateMinAvailableTime { get; }
Property Value
Methods
AddAdapter(Connector, Type, Action<IMessageAdapter>)
Create IMessageAdapter.
public static IMessageAdapter AddAdapter(this Connector connector, Type adapterType, Action<IMessageAdapter> init)
Parameters
connector
ConnectorThe class to create connections to trading systems.
adapterType
TypeAdapter type.
init
Action<IMessageAdapter>Initialize adapter.
Returns
- IMessageAdapter
The class to create connections to trading systems.
AddAdapter<TAdapter>(Connector, Action<TAdapter>)
Create IMessageAdapter.
public static TAdapter AddAdapter<TAdapter>(this Connector connector, Action<TAdapter> init) where TAdapter : IMessageAdapter
Parameters
connector
ConnectorThe class to create connections to trading systems.
init
Action<TAdapter>Initialize adapter.
Returns
- TAdapter
The class to create connections to trading systems.
Type Parameters
TAdapter
Adapter type.
AddOrderErrorLog(ILogReceiver, Order, string, Func<string>)
Write order error to the log.
public static void AddOrderErrorLog(this ILogReceiver receiver, Order order, string operation, Func<string> getAdditionalInfo = null)
Parameters
receiver
ILogReceiverLogs receiver.
order
OrderOrder.
operation
stringOrder action name.
getAdditionalInfo
Func<string>Extended order info.
AddOrderInfoLog(ILogReceiver, Order, string, Func<string>)
Write order info to the log.
public static void AddOrderInfoLog(this ILogReceiver receiver, Order order, string operation, Func<string> getAdditionalInfo = null)
Parameters
receiver
ILogReceiverLogs receiver.
order
OrderOrder.
operation
stringOrder action name.
getAdditionalInfo
Func<string>Extended order info.
ApplyOffset(Unit, Sides, Unit, Security)
To use shifting for price, depending on direction side
.
public static decimal ApplyOffset(this Unit price, Sides side, Unit offset, Security security)
Parameters
price
UnitPrice.
side
SidesThe order direction, used as shift direction (for buy the shift is added, for sell - subtracted).
offset
UnitPrice shift.
security
SecuritySecurity.
Returns
- decimal
New price.
CancelOrders(IConnector, IEnumerable<Order>, bool?, Portfolio, Sides?, ExchangeBoard, Security, SecurityTypes?)
Cancel orders by filter.
public static void CancelOrders(this IConnector connector, IEnumerable<Order> orders, bool? isStopOrder = null, Portfolio portfolio = null, Sides? side = null, ExchangeBoard board = null, Security security = null, SecurityTypes? securityType = null)
Parameters
connector
IConnectorThe connection of interaction with trade systems.
orders
IEnumerable<Order>The group of orders, from which the required orders shall be found and cancelled.
isStopOrder
bool?true, if cancel only a stop orders, false - if regular orders, null - both.
portfolio
PortfolioPortfolio. If the value is equal to null, then the portfolio does not match the orders cancel filter.
side
Sides?Order side. If the value is null, the direction does not use.
board
ExchangeBoardTrading board. If the value is equal to null, then the board does not match the orders cancel filter.
security
SecurityInstrument. If the value is equal to null, then the instrument does not match the orders cancel filter.
securityType
SecurityTypes?Security type. If the value is null, the type does not use.
Compile(string, AssemblyLoadContextTracker)
Compile mathematical formula.
public static ExpressionFormula<decimal> Compile(this string expression, AssemblyLoadContextTracker tracker)
Parameters
expression
stringText expression.
tracker
AssemblyLoadContextTrackerEcng.Compilation.AssemblyLoadContextTracker
Returns
- ExpressionFormula<decimal>
Compiled mathematical formula.
Compile<TResult>(string, AssemblyLoadContextTracker)
Compile mathematical formula.
public static ExpressionFormula<TResult> Compile<TResult>(this string expression, AssemblyLoadContextTracker tracker)
Parameters
expression
stringText expression.
tracker
AssemblyLoadContextTrackerEcng.Compilation.AssemblyLoadContextTracker
Returns
- ExpressionFormula<TResult>
Compiled mathematical formula.
Type Parameters
TResult
Result type.
Contains(BasketSecurity, ISecurityProvider, Security)
To check whether specified instrument is used now.
public static bool Contains(this BasketSecurity basketSecurity, ISecurityProvider securityProvider, Security security)
Parameters
basketSecurity
BasketSecurityInstruments basket.
securityProvider
ISecurityProviderThe provider of information about instruments.
security
SecurityThe instrument that should be checked.
Returns
CreateProcessor(IBasketSecurityProcessorProvider, Security)
Create market data processor for basket securities.
public static IBasketSecurityProcessor CreateProcessor(this IBasketSecurityProcessorProvider processorProvider, Security security)
Parameters
processorProvider
IBasketSecurityProcessorProviderBasket security processors provider.
security
SecurityBasket security.
Returns
- IBasketSecurityProcessor
Market data processor for basket securities.
DeleteAll(ISecurityStorage)
To delete all instruments.
public static void DeleteAll(this ISecurityStorage storage)
Parameters
storage
ISecurityStorageSecurities meta info storage.
Download<TResult>(IMessageAdapter, Message, out byte[])
Download data.
public static IEnumerable<TResult> Download<TResult>(this IMessageAdapter adapter, Message request, out byte[] archive) where TResult : Message
Parameters
adapter
IMessageAdapterAdapter.
request
MessageRequest.
archive
byte[]Result data was sent as archive.
Returns
- IEnumerable<TResult>
Downloaded data.
Type Parameters
TResult
Result message.
EmulateTrades(MarketDepth, IEnumerable<ExecutionMessage>)
To delete in order book levels, which shall disappear in case of trades occurrence trades
.
[Obsolete]
public static void EmulateTrades(this MarketDepth depth, IEnumerable<ExecutionMessage> trades)
Parameters
depth
MarketDepthThe order book to be cleared.
trades
IEnumerable<ExecutionMessage>Trades.
FillFortsJumps(ExpirationContinuousSecurity, ISecurityProvider, string, DateTime, DateTime)
To fill transitions ExpirationJumps.
public static void FillFortsJumps(this ExpirationContinuousSecurity continuousSecurity, ISecurityProvider provider, string baseCode, DateTime from, DateTime to)
Parameters
continuousSecurity
ExpirationContinuousSecurityContinuous security.
provider
ISecurityProviderThe provider of information about instruments.
baseCode
stringThe base part of the instrument code.
from
DateTimeThe start of the expiration range.
to
DateTimeThe end of the expiration range.
Filter(IEnumerable<MyTrade>, Security)
To filter own trades for the given instrument.
public static IEnumerable<MyTrade> Filter(this IEnumerable<MyTrade> myTrades, Security security)
Parameters
myTrades
IEnumerable<MyTrade>All own trades, in which the required shall be looked for.
security
SecurityThe instrument, on which the trades shall be found.
Returns
- IEnumerable<MyTrade>
Filtered trades.
Filter(IEnumerable<Order>, Security)
To filter orders for the given instrument.
public static IEnumerable<Order> Filter(this IEnumerable<Order> orders, Security security)
Parameters
orders
IEnumerable<Order>All orders, in which the required shall be searched for.
security
SecurityThe instrument, for which the orders shall be filtered.
Returns
- IEnumerable<Order>
Filtered orders.
Filter(IEnumerable<Position>, Security)
To filter positions for the given instrument.
public static IEnumerable<Position> Filter(this IEnumerable<Position> positions, Security security)
Parameters
positions
IEnumerable<Position>All positions, in which the required shall be searched for.
security
SecurityThe instrument, for which positions shall be filtered.
Returns
- IEnumerable<Position>
Filtered positions.
Filter(IEnumerable<Trade>, Security)
To filter orders for the given instrument.
[Obsolete("Use ITickTradeMessage.")]
public static IEnumerable<Trade> Filter(this IEnumerable<Trade> trades, Security security)
Parameters
trades
IEnumerable<Trade>All trades, in which the required shall be searched for.
security
SecurityThe instrument, for which the trades shall be filtered.
Returns
- IEnumerable<Trade>
Filtered trades.
GenerateId(SecurityIdGenerator, string, ExchangeBoard)
Generate SecurityId security.
public static string GenerateId(this SecurityIdGenerator generator, string secCode, ExchangeBoard board)
Parameters
generator
SecurityIdGeneratorsecCode
stringSecurity code.
board
ExchangeBoardSecurity board.
Returns
GetAllSecurity(ISecurityProvider)
Find AllSecurity instance in the specified provider.
public static Security GetAllSecurity(this ISecurityProvider provider)
Parameters
provider
ISecurityProviderThe provider of information about instruments.
Returns
- Security
Found instance.
GetAveragePrice(Order, IConnector)
To get weighted mean price of order matching.
[Obsolete]
public static decimal GetAveragePrice(this Order order, IConnector connector)
Parameters
order
OrderThe order, for which the weighted mean matching price shall be got.
connector
IConnectorThe connection of interaction with trade systems.
Returns
- decimal
The weighted mean price. If no order exists no trades, 0 is returned.
GetAveragePrice(IEnumerable<MyTrade>)
To get the weighted mean price of matching by own trades.
[Obsolete]
public static decimal GetAveragePrice(this IEnumerable<MyTrade> trades)
Parameters
trades
IEnumerable<MyTrade>Trades, for which the weighted mean price of matching shall be got.
Returns
- decimal
The weighted mean price. If no trades, 0 is returned.
GetCandles(IMessageAdapter, SecurityId, TimeSpan, DateTimeOffset, DateTimeOffset, long?, Level1Fields?, SecurityTypes?)
To download candles.
public static IEnumerable<TimeFrameCandleMessage> GetCandles(this IMessageAdapter adapter, SecurityId securityId, TimeSpan timeFrame, DateTimeOffset from, DateTimeOffset to, long? count = null, Level1Fields? buildField = null, SecurityTypes? secType = null)
Parameters
adapter
IMessageAdapterAdapter.
securityId
SecurityIdSecurity ID.
timeFrame
TimeSpanTime-frame.
from
DateTimeOffsetBegin period.
to
DateTimeOffsetEnd period.
count
long?Candles count.
buildField
Level1Fields?Extra info for the BuildFrom.
secType
SecurityTypes?
Returns
- IEnumerable<TimeFrameCandleMessage>
Downloaded candles.
GetCurrentPrice(MarketDepthPair, Sides, decimal?, MarketPriceTypes)
To calculate the current price based on the best pair of quotes, depending on the order direction.
public static Unit GetCurrentPrice(this MarketDepthPair bestPair, Sides side, decimal? priceStep, MarketPriceTypes priceType = MarketPriceTypes.Following)
Parameters
bestPair
MarketDepthPairThe best pair of quotes, used for the current price calculation.
side
SidesThe order direction. If it is a buy, Ask value is used, otherwise Bid.
priceStep
decimal?priceType
MarketPriceTypesThe type of current price.
Returns
Remarks
For correct operation of the method the order book export shall be launched.
GetCurrentPrice(Security, IMarketDataProvider, Sides?)
To calculate the current price by the instrument depending on the order direction.
public static Unit GetCurrentPrice(this Security security, IMarketDataProvider provider, Sides? direction = null)
Parameters
security
SecurityThe instrument used for the current price calculation.
provider
IMarketDataProviderThe market data provider.
direction
Sides?Order side.
Returns
GetCurrentPrice(IOrderBookMessage, Sides, decimal?, MarketPriceTypes, IEnumerable<Order>)
To calculate the current price by the order book depending on the order direction.
public static Unit GetCurrentPrice(this IOrderBookMessage depth, Sides side, decimal? priceStep, MarketPriceTypes priceType = MarketPriceTypes.Following, IEnumerable<Order> orders = null)
Parameters
depth
IOrderBookMessageThe order book for the current price calculation.
side
SidesThe order direction. If it is a buy, BestAsk value is used, otherwise BestBid.
priceStep
decimal?priceType
MarketPriceTypesThe type of current price.
orders
IEnumerable<Order>Orders to be ignored.
Returns
Remarks
For correct operation of the method the order book export shall be launched.
GetDirection(Position)
To get the order direction for the position.
public static Sides? GetDirection(this Position position)
Parameters
position
PositionThe position value.
Returns
- Sides?
Order side.
Remarks
GetDirection(decimal)
To get the order direction for the position.
public static Sides? GetDirection(this decimal position)
Parameters
position
decimalThe position value.
Returns
- Sides?
Order side.
Remarks
GetFortsEndOfDay(string, DateTime, DateTime)
It returns a list of the data at the end of day (EOD, End-Of-Day) by the selected instrument for the specified period.
[Obsolete]
public static IEnumerable<Level1ChangeMessage> GetFortsEndOfDay(this string securityName, DateTime fromDate, DateTime toDate)
Parameters
Returns
- IEnumerable<Level1ChangeMessage>
Historical market-data.
GetFortsJumps(ExpirationContinuousSecurity, ISecurityProvider, string, DateTime, DateTime, bool)
To get real expiration instruments for the continuous instrument.
public static IEnumerable<Security> GetFortsJumps(this ExpirationContinuousSecurity continuousSecurity, ISecurityProvider provider, string baseCode, DateTime from, DateTime to, bool throwIfNotExists = true)
Parameters
continuousSecurity
ExpirationContinuousSecurityContinuous security.
provider
ISecurityProviderThe provider of information about instruments.
baseCode
stringThe base part of the instrument code.
from
DateTimeThe start of the expiration range.
to
DateTimeThe end of the expiration range.
throwIfNotExists
boolTo generate exception, if some of instruments for passed
continuousSecurity
are not available.
Returns
- IEnumerable<Security>
Expiration instruments.
GetFortsJumps(string, DateTime, DateTime, Func<string, Security>, bool)
To get real expiration instruments for base part of the code.
public static IEnumerable<Security> GetFortsJumps(this string baseCode, DateTime from, DateTime to, Func<string, Security> getSecurity, bool throwIfNotExists = true)
Parameters
baseCode
stringThe base part of the instrument code.
from
DateTimeThe start of the expiration range.
to
DateTimeThe end of the expiration range.
getSecurity
Func<string, Security>The function to get instrument by the code.
throwIfNotExists
boolTo generate exception, if some of instruments are not available.
Returns
- IEnumerable<Security>
Expiration instruments.
GetFortsRate(SecurityId, DateTime, DateTime)
To get an indicative exchange rate of a currency pair.
[Obsolete]
public static IDictionary<DateTimeOffset, decimal> GetFortsRate(this SecurityId securityId, DateTime fromDate, DateTime toDate)
Parameters
securityId
SecurityIdSecurity ID.
fromDate
DateTimeBegin period.
toDate
DateTimeEnd period.
Returns
- IDictionary<DateTimeOffset, decimal>
The indicative rate of US dollar to the Russian ruble.
GetFortsYesterdayEndOfDay(string)
It returns yesterday's data at the end of day (EOD, End-Of-Day) by the selected instrument.
[Obsolete]
public static Level1ChangeMessage GetFortsYesterdayEndOfDay(this string securityName)
Parameters
securityName
stringSecurity name.
Returns
- Level1ChangeMessage
Yesterday's market-data.
Remarks
Date is determined by the system time.
GetInnerSecurities(BasketSecurity, ISecurityProvider)
Find inner security instances.
public static IEnumerable<Security> GetInnerSecurities(this BasketSecurity security, ISecurityProvider securityProvider)
Parameters
security
BasketSecurityInstruments basket.
securityProvider
ISecurityProviderThe provider of information about instruments.
Returns
- IEnumerable<Security>
Instruments, from which this basket is created.
GetLevel1(IMessageAdapter, SecurityId, DateTime, DateTime, int?, IEnumerable<Level1Fields>, SecurityTypes?)
To get level1 market data.
public static IEnumerable<Level1ChangeMessage> GetLevel1(this IMessageAdapter adapter, SecurityId securityId, DateTime beginDate, DateTime endDate, int? maxCount = null, IEnumerable<Level1Fields> fields = null, SecurityTypes? secType = null)
Parameters
adapter
IMessageAdapterAdapter.
securityId
SecurityIdSecurity ID.
beginDate
DateTimeStart date.
endDate
DateTimeEnd date.
maxCount
int?fields
IEnumerable<Level1Fields>Market data fields.
secType
SecurityTypes?
Returns
- IEnumerable<Level1ChangeMessage>
Level1 market data.
GetMatchedVolume(Order, IConnector)
To calculate the implemented part of volume for order.
[Obsolete]
public static decimal GetMatchedVolume(this Order order, IConnector connector)
Parameters
order
OrderThe order, for which the implemented part of volume shall be calculated.
connector
IConnectorThe connection of interaction with trade systems.
Returns
- decimal
The implemented part of volume.
GetOrCreate(ISecurityStorage, SecurityId, Func<string, Security>, out bool)
Get or create (if not exist).
public static Security GetOrCreate(this ISecurityStorage storage, SecurityId id, Func<string, Security> creator, out bool isNew)
Parameters
storage
ISecurityStorageSecurities meta info storage.
id
SecurityIdSecurity ID.
creator
Func<string, Security>Creator.
isNew
boolIs newly created.
Returns
- Security
Security.
GetOrCreatePortfolio(IPositionStorage, string, Func<string, Portfolio>, out bool)
Get or create (if not exist).
public static Portfolio GetOrCreatePortfolio(this IPositionStorage storage, string portfolioName, Func<string, Portfolio> creator, out bool isNew)
Parameters
storage
IPositionStorageStorage.
portfolioName
stringPortfolio code name.
creator
Func<string, Portfolio>Creator.
isNew
boolIs newly created.
Returns
- Portfolio
Portfolio.
GetOrCreatePosition(IPositionStorage, Portfolio, Security, string, Sides?, string, string, TPlusLimits?, Func<Portfolio, Security, string, Sides?, string, string, TPlusLimits?, Position>, out bool)
Get or create (if not exist).
public static Position GetOrCreatePosition(this IPositionStorage storage, Portfolio portfolio, Security security, string strategyId, Sides? side, string clientCode, string depoName, TPlusLimits? limitType, Func<Portfolio, Security, string, Sides?, string, string, TPlusLimits?, Position> creator, out bool isNew)
Parameters
storage
IPositionStorageStorage.
portfolio
PortfolioPortfolio.
security
SecuritySecurity.
strategyId
stringStrategy ID.
side
Sides?Side.
clientCode
stringClient code.
depoName
stringDepo name.
limitType
TPlusLimits?Limit type.
creator
Func<Portfolio, Security, string, Sides?, string, string, TPlusLimits?, Position>Creator.
isNew
boolIs newly created.
Returns
- Position
Position.
GetOrderLog(IMessageAdapter, SecurityId, DateTime, DateTime, int?, SecurityTypes?)
To get order log.
public static IEnumerable<ExecutionMessage> GetOrderLog(this IMessageAdapter adapter, SecurityId securityId, DateTime beginDate, DateTime endDate, int? maxCount = null, SecurityTypes? secType = null)
Parameters
adapter
IMessageAdapterAdapter.
securityId
SecurityIdSecurity ID.
beginDate
DateTimeStart date.
endDate
DateTimeEnd date.
maxCount
int?secType
SecurityTypes?
Returns
- IEnumerable<ExecutionMessage>
Order log.
GetPnL(Portfolio)
To calculate profit-loss based on the portfolio.
public static decimal? GetPnL(this Portfolio portfolio)
Parameters
portfolio
PortfolioThe portfolio, for which the profit-loss shall be calculated.
Returns
- decimal?
Profit-loss.
GetPosition(MyTrade)
To get the position on own trade.
public static decimal GetPosition(this MyTrade trade)
Parameters
trade
MyTradeOwn trade, used for position calculation. At buy the trade volume Volume is taken with positive sign, at sell - with negative.
Returns
- decimal
Position.
GetPosition(ExecutionMessage, bool)
To get the position on own trade.
[Obsolete]
public static decimal? GetPosition(this ExecutionMessage message, bool byOrder)
Parameters
message
ExecutionMessageOwn trade, used for position calculation. At buy the trade volume TradeVolume is taken with positive sign, at sell - with negative.
byOrder
boolTo check implemented volume by order balance (Balance) or by received trades. The default is checked by the order.
Returns
- decimal?
Position.
GetSecurities(IMessageAdapter, SecurityLookupMessage)
Download all securities.
public static IEnumerable<SecurityMessage> GetSecurities(this IMessageAdapter adapter, SecurityLookupMessage lookupMsg)
Parameters
adapter
IMessageAdapterAdapter.
lookupMsg
SecurityLookupMessageMessage security lookup for specified criteria.
Returns
- IEnumerable<SecurityMessage>
All securities.
GetSecurityCriteria(Connector, SecurityLookupMessage, IExchangeInfoProvider)
To create the search criteria Security from SecurityLookupMessage.
public static Security GetSecurityCriteria(this Connector connector, SecurityLookupMessage criteria, IExchangeInfoProvider exchangeInfoProvider)
Parameters
connector
ConnectorConnection to the trading system.
criteria
SecurityLookupMessageThe criterion which fields will be used as a filter.
exchangeInfoProvider
IExchangeInfoProviderExchanges and trading boards provider.
Returns
- Security
Search criterion.
GetSecurityValue<T>(IMarketDataProvider, Security, Level1Fields)
To get the value of market data for the instrument.
public static T GetSecurityValue<T>(this IMarketDataProvider provider, Security security, Level1Fields field)
Parameters
provider
IMarketDataProviderThe market data provider.
security
SecuritySecurity.
field
Level1FieldsMarket-data field.
Returns
- T
The field value. If no data, the null will be returned.
Type Parameters
T
The type of the market data field value.
GetSecurityValues(IMarketDataProvider, Security)
To get all market data values for the instrument.
public static IDictionary<Level1Fields, object> GetSecurityValues(this IMarketDataProvider provider, Security security)
Parameters
provider
IMarketDataProviderThe market data provider.
security
SecuritySecurity.
Returns
- IDictionary<Level1Fields, object>
Filed values. If there is no data, null is returned.
GetTheoreticalTrades(MarketDepth, Order)
To get probable trades for order book for the given order.
[Obsolete]
public static IEnumerable<MyTrade> GetTheoreticalTrades(this MarketDepth depth, Order order)
Parameters
depth
MarketDepthThe order book, reflecting situation on market at the moment of function call.
order
OrderThe order, for which probable trades shall be calculated.
Returns
- IEnumerable<MyTrade>
Probable trades.
GetTheoreticalTrades(MarketDepth, Sides, decimal)
To get probable trades by the order book for the market price and given volume.
[Obsolete]
public static IEnumerable<MyTrade> GetTheoreticalTrades(this MarketDepth depth, Sides orderDirection, decimal volume)
Parameters
depth
MarketDepthThe order book, reflecting situation on market at the moment of function call.
orderDirection
SidesOrder side.
volume
decimalThe volume, supposed to be implemented.
Returns
- IEnumerable<MyTrade>
Probable trades.
GetTheoreticalTrades(MarketDepth, Sides, decimal, decimal)
To get probable trades by order book for given price and volume.
[Obsolete]
public static IEnumerable<MyTrade> GetTheoreticalTrades(this MarketDepth depth, Sides side, decimal volume, decimal price)
Parameters
depth
MarketDepthThe order book, reflecting situation on market at the moment of function call.
side
SidesOrder side.
volume
decimalThe volume, supposed to be implemented.
price
decimalThe price, based on which the order is supposed to be forwarded. If it equals 0, option of market order will be considered.
Returns
- IEnumerable<MyTrade>
Probable trades.
GetTicks(IMessageAdapter, SecurityId, DateTime, DateTime, int?, SecurityTypes?)
To get tick data.
public static IEnumerable<ExecutionMessage> GetTicks(this IMessageAdapter adapter, SecurityId securityId, DateTime beginDate, DateTime endDate, int? maxCount = null, SecurityTypes? secType = null)
Parameters
adapter
IMessageAdapterAdapter.
securityId
SecurityIdSecurity ID.
beginDate
DateTimeStart date.
endDate
DateTimeEnd date.
maxCount
int?secType
SecurityTypes?
Returns
- IEnumerable<ExecutionMessage>
Tick data.
GetTrades(Order, IConnector)
To get order trades.
[Obsolete]
public static IEnumerable<MyTrade> GetTrades(this Order order, IConnector connector)
Parameters
order
OrderOrders.
connector
IConnectorThe connection of interaction with trade systems.
Returns
- IEnumerable<MyTrade>
Trades.
IsAssociated(SecurityId, ExchangeBoard)
Is specified security id associated with the board.
public static bool IsAssociated(this SecurityId securityId, ExchangeBoard board)
Parameters
securityId
SecurityIdSecurity ID.
board
ExchangeBoardBoard info.
Returns
IsBasket(Security)
Is specified security is basket.
public static bool IsBasket(this Security security)
Parameters
security
SecuritySecurity.
Returns
- bool
Check result.
IsContinuous(Security)
Is specified security is continuous.
public static bool IsContinuous(this Security security)
Parameters
security
SecuritySecurity.
Returns
- bool
Check result.
IsContinuous(SecurityMessage)
Is specified security is continuous.
public static bool IsContinuous(this SecurityMessage security)
Parameters
security
SecurityMessageSecurity.
Returns
- bool
Check result.
IsIndex(Security)
Is specified security is index.
public static bool IsIndex(this Security security)
Parameters
security
SecuritySecurity.
Returns
- bool
Check result.
IsMicex(ExchangeBoard)
Is MICEX board.
public static bool IsMicex(this ExchangeBoard board)
Parameters
board
ExchangeBoardBoard to check.
Returns
- bool
Check result.
IsRequiredType(Type, Type)
Is type compatible.
public static bool IsRequiredType(this Type type, Type required)
Parameters
Returns
- bool
Check result.
IsRequiredType<T>(Type)
Is type compatible.
public static bool IsRequiredType<T>(this Type type)
Parameters
type
TypeType.
Returns
- bool
Check result.
Type Parameters
T
Required type.
IsSame(Portfolio, string)
Determines the specified portfolio is required.
public static bool IsSame(this Portfolio portfolio, string uniqueId)
Parameters
Returns
- bool
Check result.
IsStockSharp(News)
Determines whether the specified news related with StockSharp.
public static bool IsStockSharp(this News news)
Parameters
news
NewsNews.
Returns
- bool
Check result.
IsTradeTime(ExchangeBoard, DateTimeOffset)
To check, whether the time is traded (has the session started, ended, is there a clearing).
public static bool IsTradeTime(this ExchangeBoard board, DateTimeOffset time)
Parameters
board
ExchangeBoardBoard info.
time
DateTimeOffsetThe passed time to be checked.
Returns
IsTradeTime(ExchangeBoard, DateTimeOffset, out bool?, out WorkingTimePeriod)
To check, whether the time is traded (has the session started, ended, is there a clearing).
public static bool IsTradeTime(this ExchangeBoard board, DateTimeOffset time, out bool? isWorkingDay, out WorkingTimePeriod period)
Parameters
board
ExchangeBoardBoard info.
time
DateTimeOffsetThe passed time to be checked.
isWorkingDay
bool?true, if the date is traded, otherwise, is not traded.
period
WorkingTimePeriodCurrent working time period.
Returns
IsUxStock(ExchangeBoard)
Is the UX exchange stock market board.
public static bool IsUxStock(this ExchangeBoard board)
Parameters
board
ExchangeBoardBoard to check.
Returns
- bool
Check result.
Lookup(ISecurityProvider, Security)
Lookup securities by criteria criteria
.
public static IEnumerable<Security> Lookup(this ISecurityProvider provider, Security criteria)
Parameters
provider
ISecurityProviderThe provider of information about instruments.
criteria
SecurityThe instrument whose fields will be used as a filter.
Returns
- IEnumerable<Security>
Found instruments.
LookupAll(Connector)
Lookup securities, portfolios and orders.
public static void LookupAll(this Connector connector)
Parameters
connector
ConnectorThe connection of interaction with trade systems.
LookupAll(ISecurityProvider)
Get all available instruments.
public static IEnumerable<Security> LookupAll(this ISecurityProvider provider)
Parameters
provider
ISecurityProviderThe provider of information about instruments.
Returns
- IEnumerable<Security>
All available instruments.
LookupBoards(ISubscriptionProvider, ExchangeBoard, IMessageAdapter, MessageOfflineModes)
To find boards that match the filter criteria
. Found boards will be passed through the event LookupBoardsResult.
[Obsolete("Use ISubscriptionProvider.Subscribe method.")]
public static Subscription LookupBoards(this ISubscriptionProvider provider, ExchangeBoard criteria, IMessageAdapter adapter = null, MessageOfflineModes offlineMode = MessageOfflineModes.None)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
ExchangeBoardThe criterion which fields will be used as a filter.
adapter
IMessageAdapterTarget adapter. Can be null.
offlineMode
MessageOfflineModesOffline mode handling message.
Returns
- Subscription
Subscription.
LookupBoards(ISubscriptionProvider, BoardLookupMessage)
To find boards that match the filter criteria
. Found boards will be passed through the event LookupBoardsResult.
[Obsolete("Use ISubscriptionProvider.Subscribe method.")]
public static Subscription LookupBoards(this ISubscriptionProvider provider, BoardLookupMessage criteria)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
BoardLookupMessageThe criterion which fields will be used as a filter.
Returns
- Subscription
Subscription.
LookupByCode(ISecurityProvider, string, SecurityTypes?)
To get the instrument by the instrument code.
public static IEnumerable<Security> LookupByCode(this ISecurityProvider provider, string code, SecurityTypes? type = null)
Parameters
provider
ISecurityProviderThe provider of information about instruments.
code
stringSecurity code.
type
SecurityTypes?Security type.
Returns
- IEnumerable<Security>
The got instrument. If there is no instrument by given criteria, null is returned.
LookupByNativeId(ISecurityProvider, INativeIdStorage, string, object)
To get the instrument by the system identifier.
public static Security LookupByNativeId(this ISecurityProvider provider, INativeIdStorage nativeIdStorage, string storageName, object nativeId)
Parameters
provider
ISecurityProviderThe provider of information about instruments.
nativeIdStorage
INativeIdStorageSecurity native identifier storage.
storageName
stringStorage name.
nativeId
objectNative (internal) trading system security id.
Returns
LookupOrders(ISubscriptionProvider, Order, IMessageAdapter, MessageOfflineModes)
To find orders that match the filter criteria
. Found orders will be passed through the event NewOrder.
[Obsolete("Use ISubscriptionProvider.Subscribe method.")]
public static Subscription LookupOrders(this ISubscriptionProvider provider, Order criteria, IMessageAdapter adapter = null, MessageOfflineModes offlineMode = MessageOfflineModes.None)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
OrderThe order which fields will be used as a filter.
adapter
IMessageAdapterTarget adapter. Can be null.
offlineMode
MessageOfflineModesOffline mode handling message.
Returns
- Subscription
Subscription.
LookupOrders(ISubscriptionProvider, OrderStatusMessage)
To find orders that match the filter criteria
. Found orders will be passed through the event NewOrder.
[Obsolete("Use ISubscriptionProvider.Subscribe method.")]
public static Subscription LookupOrders(this ISubscriptionProvider provider, OrderStatusMessage criteria)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
OrderStatusMessageThe order which fields will be used as a filter.
Returns
- Subscription
Subscription.
LookupPortfolios(ISubscriptionProvider, Portfolio, IMessageAdapter, MessageOfflineModes)
To find portfolios that match the filter criteria
. Found portfolios will be passed through the event LookupPortfoliosResult.
[Obsolete("Use ISubscriptionProvider.Subscribe method.")]
public static Subscription LookupPortfolios(this ISubscriptionProvider provider, Portfolio criteria, IMessageAdapter adapter = null, MessageOfflineModes offlineMode = MessageOfflineModes.None)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
PortfolioThe criterion which fields will be used as a filter.
adapter
IMessageAdapterTarget adapter. Can be null.
offlineMode
MessageOfflineModesOffline mode handling message.
Returns
- Subscription
Subscription.
LookupPortfolios(ISubscriptionProvider, PortfolioLookupMessage)
To find portfolios that match the filter criteria
. Found portfolios will be passed through the event LookupPortfoliosResult.
[Obsolete("Use ISubscriptionProvider.Subscribe method.")]
public static Subscription LookupPortfolios(this ISubscriptionProvider provider, PortfolioLookupMessage criteria)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
PortfolioLookupMessageThe criterion which fields will be used as a filter.
Returns
- Subscription
Subscription.
LookupSecurities(ISubscriptionProvider, Security, IMessageAdapter, MessageOfflineModes)
To find instruments that match the filter criteria
. Found instruments will be passed through the event LookupSecuritiesResult.
public static Subscription LookupSecurities(this ISubscriptionProvider provider, Security criteria, IMessageAdapter adapter = null, MessageOfflineModes offlineMode = MessageOfflineModes.None)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
SecurityThe criterion which fields will be used as a filter.
adapter
IMessageAdapterTarget adapter. Can be null.
offlineMode
MessageOfflineModesOffline mode handling message.
Returns
- Subscription
Subscription.
LookupSecurities(ISubscriptionProvider, SecurityLookupMessage)
To find instruments that match the filter criteria
. Found instruments will be passed through the event LookupSecuritiesResult.
public static Subscription LookupSecurities(this ISubscriptionProvider provider, SecurityLookupMessage criteria)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
SecurityLookupMessageThe criterion which fields will be used as a filter.
Returns
- Subscription
Subscription.
LookupTimeFrames(ISubscriptionProvider, TimeFrameLookupMessage)
To find time-frames that match the filter criteria
. Found time-frames will be passed through the event LookupTimeFramesResult.
[Obsolete("Use ISubscriptionProvider.Subscribe method.")]
public static Subscription LookupTimeFrames(this ISubscriptionProvider provider, TimeFrameLookupMessage criteria)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
TimeFrameLookupMessageThe criterion which fields will be used as a filter.
Returns
- Subscription
Subscription.
ShrinkPrice(Order, ShrinkRules)
To cut the price for the order, to make it multiple of the minimal step, also to limit number of decimal places.
public static void ShrinkPrice(this Order order, ShrinkRules rule = ShrinkRules.Auto)
Parameters
order
OrderThe order for which the price will be cut Price.
rule
ShrinkRulesThe price rounding rule.
ShrinkPrice(Security, decimal, ShrinkRules)
To cut the price, to make it multiple of minimal step, also to limit number of signs after the comma.
public static decimal ShrinkPrice(this Security security, decimal price, ShrinkRules rule = ShrinkRules.Auto)
Parameters
security
SecurityThe instrument from which the PriceStep and Decimals values are taken.
price
decimalThe price to be made multiple.
rule
ShrinkRulesThe price rounding rule.
Returns
- decimal
The multiple price.
SubscribeBoard(ISubscriptionProvider, ExchangeBoard, DateTimeOffset?, DateTimeOffset?, long?, IMessageAdapter, long?)
Subscribe on the board changes.
public static Subscription SubscribeBoard(this ISubscriptionProvider provider, ExchangeBoard board, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, IMessageAdapter adapter = null, long? skip = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
board
ExchangeBoardBoard for subscription.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Max count.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
Returns
- Subscription
Subscription.
SubscribeCandles(ISubscriptionProvider, CandleSeries, DateTimeOffset?, DateTimeOffset?, long?, long?, IMessageAdapter, long?, FillGapsDays?)
Subscribe to receive new candles.
public static Subscription SubscribeCandles(this ISubscriptionProvider provider, CandleSeries series, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, long? transactionId = null, IMessageAdapter adapter = null, long? skip = null, FillGapsDays? fillGaps = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
series
CandleSeriesCandles series.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Candles count.
transactionId
long?Transaction ID.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
fillGaps
FillGapsDays?
Returns
- Subscription
Subscription.
SubscribeFilteredMarketDepth(ISubscriptionProvider, Security)
To start getting filtered quotes (order book) by the instrument. Quotes values are available through the event OrderBookReceived.
public static Subscription SubscribeFilteredMarketDepth(this ISubscriptionProvider provider, Security security)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which quotes getting should be started.
Returns
- Subscription
Subscription.
SubscribeLevel1(ISubscriptionProvider, Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter, long?, FillGapsDays?)
public static Subscription SubscribeLevel1(this ISubscriptionProvider provider, Security security, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, MarketDataBuildModes buildMode = MarketDataBuildModes.LoadAndBuild, DataType buildFrom = null, IMessageAdapter adapter = null, long? skip = null, FillGapsDays? fillGaps = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which new information getting should be started.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Max count.
buildMode
MarketDataBuildModesBuild mode.
buildFrom
DataTypeWhich market-data type is used as a source value.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
fillGaps
FillGapsDays?
Returns
- Subscription
Subscription.
SubscribeMarketData(ISubscriptionProvider, Security, MarketDataMessage)
To subscribe to get market data by the instrument.
public static Subscription SubscribeMarketData(this ISubscriptionProvider provider, Security security, MarketDataMessage message)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which new information getting should be started.
message
MarketDataMessageThe message that contain subscribe info.
Returns
- Subscription
Subscription.
SubscribeMarketData(ISubscriptionProvider, MarketDataMessage)
To subscribe to get market data.
public static Subscription SubscribeMarketData(this ISubscriptionProvider provider, MarketDataMessage message)
Parameters
provider
ISubscriptionProviderSubscription provider.
message
MarketDataMessageThe message that contain subscribe info.
Returns
- Subscription
Subscription.
SubscribeMarketDepth(ISubscriptionProvider, Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, int?, TimeSpan?, IOrderLogMarketDepthBuilder, bool, IMessageAdapter, long?, FillGapsDays?)
To start getting quotes (order book) by the instrument. Quotes values are available through the event MarketDepthChanged.
public static Subscription SubscribeMarketDepth(this ISubscriptionProvider provider, Security security, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, MarketDataBuildModes buildMode = MarketDataBuildModes.LoadAndBuild, DataType buildFrom = null, int? maxDepth = null, TimeSpan? refreshSpeed = null, IOrderLogMarketDepthBuilder depthBuilder = null, bool passThroughOrderBookIncrement = false, IMessageAdapter adapter = null, long? skip = null, FillGapsDays? fillGaps = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which quotes getting should be started.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Max count.
buildMode
MarketDataBuildModesBuild mode.
buildFrom
DataTypeWhich market-data type is used as a source value.
maxDepth
int?Max depth of requested order book.
refreshSpeed
TimeSpan?Interval for data refresh.
depthBuilder
IOrderLogMarketDepthBuilderOrder log to market depth builder.
passThroughOrderBookIncrement
boolPass through incremental QuoteChangeMessage.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
fillGaps
FillGapsDays?
Returns
- Subscription
Subscription.
SubscribeNews(ISubscriptionProvider, Security, DateTimeOffset?, DateTimeOffset?, long?, IMessageAdapter, long?)
Subscribe on news.
public static Subscription SubscribeNews(this ISubscriptionProvider provider, Security security = null, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, IMessageAdapter adapter = null, long? skip = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecuritySecurity for subscription.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Max count.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
Returns
- Subscription
Subscription.
SubscribeOrderLog(ISubscriptionProvider, Security, DateTimeOffset?, DateTimeOffset?, long?, IMessageAdapter, long?, FillGapsDays?)
Subscribe on order log for the security.
public static Subscription SubscribeOrderLog(this ISubscriptionProvider provider, Security security, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, IMessageAdapter adapter = null, long? skip = null, FillGapsDays? fillGaps = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecuritySecurity for subscription.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Max count.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
fillGaps
FillGapsDays?
Returns
- Subscription
Subscription.
SubscribeOrders(ISubscriptionProvider, Security, DateTimeOffset?, DateTimeOffset?, long?, IEnumerable<OrderStates>, IMessageAdapter, long?, FillGapsDays?)
Subscribe on orders changes.
public static Subscription SubscribeOrders(this ISubscriptionProvider provider, Security security = null, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, IEnumerable<OrderStates> states = null, IMessageAdapter adapter = null, long? skip = null, FillGapsDays? fillGaps = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecuritySecurity for subscription.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Max count.
states
IEnumerable<OrderStates>Filter order by the specified states.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
fillGaps
FillGapsDays?
Returns
- Subscription
Subscription.
SubscribeOrders(ISubscriptionProvider, OrderStatusMessage)
To find orders that match the filter criteria
. Found orders will be passed through the event NewOrder.
public static Subscription SubscribeOrders(this ISubscriptionProvider provider, OrderStatusMessage criteria)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
OrderStatusMessageThe order which fields will be used as a filter.
Returns
- Subscription
Subscription.
SubscribePositions(ISubscriptionProvider, Security, Portfolio, DateTimeOffset?, DateTimeOffset?, long?, IMessageAdapter, long?, FillGapsDays?)
Subscribe on positions changes.
public static Subscription SubscribePositions(this ISubscriptionProvider provider, Security security = null, Portfolio portfolio = null, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, IMessageAdapter adapter = null, long? skip = null, FillGapsDays? fillGaps = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument on which the position should be found.
portfolio
PortfolioThe portfolio on which the position should be found.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Max count.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
fillGaps
FillGapsDays?
Returns
- Subscription
Subscription.
SubscribePositions(ISubscriptionProvider, PortfolioLookupMessage)
To find portfolios that match the filter criteria
. Found portfolios will be passed through the event LookupPortfoliosResult.
public static Subscription SubscribePositions(this ISubscriptionProvider provider, PortfolioLookupMessage criteria)
Parameters
provider
ISubscriptionProviderSubscription provider.
criteria
PortfolioLookupMessageThe criterion which fields will be used as a filter.
Returns
- Subscription
Subscription.
SubscribeTrades(ISubscriptionProvider, Security, DateTimeOffset?, DateTimeOffset?, long?, MarketDataBuildModes, DataType, IMessageAdapter, long?, FillGapsDays?)
To start getting trades (tick data) by the instrument. New trades will come through the event NewTrade.
public static Subscription SubscribeTrades(this ISubscriptionProvider provider, Security security, DateTimeOffset? from = null, DateTimeOffset? to = null, long? count = null, MarketDataBuildModes buildMode = MarketDataBuildModes.LoadAndBuild, DataType buildFrom = null, IMessageAdapter adapter = null, long? skip = null, FillGapsDays? fillGaps = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which trades getting should be started.
from
DateTimeOffset?The initial date from which you need to get data.
to
DateTimeOffset?The final date by which you need to get data.
count
long?Max count.
buildMode
MarketDataBuildModesBuild mode.
buildFrom
DataTypeWhich market-data type is used as a source value.
adapter
IMessageAdapterTarget adapter. Can be null.
skip
long?Skip count.
fillGaps
FillGapsDays?
Returns
- Subscription
Subscription.
ToBasket(Security, IBasketSecurityProcessorProvider)
Convert Security to BasketSecurity value.
public static BasketSecurity ToBasket(this Security security, IBasketSecurityProcessorProvider processorProvider)
Parameters
security
SecuritySecurity.
processorProvider
IBasketSecurityProcessorProviderBasket security processors provider.
Returns
- BasketSecurity
Instruments basket.
ToBasket<TBasketSecurity>(Security)
Convert Security to BasketSecurity value.
public static TBasketSecurity ToBasket<TBasketSecurity>(this Security security) where TBasketSecurity : BasketSecurity, new()
Parameters
security
SecuritySecurity.
Returns
- TBasketSecurity
Instruments basket.
Type Parameters
TBasketSecurity
Basket security type.
ToBasket<TMessage>(IEnumerable<TMessage>, Security, IBasketSecurityProcessorProvider)
Convert inner securities messages to basket.
public static IEnumerable<TMessage> ToBasket<TMessage>(this IEnumerable<TMessage> innerSecMessages, Security security, IBasketSecurityProcessorProvider processorProvider) where TMessage : Message
Parameters
innerSecMessages
IEnumerable<TMessage>Inner securities messages.
security
SecurityBasket security.
processorProvider
IBasketSecurityProcessorProviderBasket security processors provider.
Returns
- IEnumerable<TMessage>
Messages of basket securities.
Type Parameters
TMessage
Message type.
ToChannelState(ProcessStates)
Convert ProcessStates value to ChannelStates.
public static ChannelStates ToChannelState(this ProcessStates state)
Parameters
state
ProcessStatesProcessStates value.
Returns
- ChannelStates
ChannelStates value.
ToPositionManager(Position)
Convert the position object to the type IPositionManager.
[Obsolete]
public static IPositionManager ToPositionManager(this Position position)
Parameters
position
PositionPosition.
Returns
- IPositionManager
Position calc manager.
ToProcessState(ChannelStates)
Convert ChannelStates value to ProcessStates.
public static ProcessStates ToProcessState(this ChannelStates state)
Parameters
state
ChannelStatesChannelStates value.
Returns
- ProcessStates
ProcessStates value.
ToSubscription(DataType)
Convert DataType to Subscription value.
public static Subscription ToSubscription(this DataType dataType)
Parameters
dataType
DataTypeData type info.
Returns
- Subscription
Subscription.
ToTimeQuotes(QuoteChangeMessage)
Convert depth to quotes.
public static IEnumerable<TimeQuoteChange> ToTimeQuotes(this QuoteChangeMessage message)
Parameters
message
QuoteChangeMessageDepth.
Returns
- IEnumerable<TimeQuoteChange>
Quotes.
ToTimeQuotes(IEnumerable<QuoteChangeMessage>)
Convert depths to quotes.
public static IEnumerable<TimeQuoteChange> ToTimeQuotes(this IEnumerable<QuoteChangeMessage> messages)
Parameters
messages
IEnumerable<QuoteChangeMessage>Depths.
Returns
- IEnumerable<TimeQuoteChange>
Quotes.
TryGetAdapter(IPortfolioMessageAdapterProvider, IMessageAdapterProvider, Portfolio)
Get adapter by portfolio.
public static IMessageAdapter TryGetAdapter(this IPortfolioMessageAdapterProvider portfolioProvider, IMessageAdapterProvider adapterProvider, Portfolio portfolio)
Parameters
portfolioProvider
IPortfolioMessageAdapterProviderThe portfolio based message adapter's provider.
adapterProvider
IMessageAdapterProviderThe message adapter's provider.
portfolio
PortfolioPortfolio.
Returns
- IMessageAdapter
Found adapter or null.
TryGetAdapter(IPortfolioMessageAdapterProvider, IEnumerable<IMessageAdapter>, Portfolio)
Get adapter by portfolio.
public static IMessageAdapter TryGetAdapter(this IPortfolioMessageAdapterProvider portfolioProvider, IEnumerable<IMessageAdapter> adapters, Portfolio portfolio)
Parameters
portfolioProvider
IPortfolioMessageAdapterProviderThe portfolio based message adapter's provider.
adapters
IEnumerable<IMessageAdapter>All available adapters.
portfolio
PortfolioPortfolio.
Returns
- IMessageAdapter
Found adapter or null.
UnSubscribe(ISubscriptionProvider, long)
Unsubscribe.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribe(this ISubscriptionProvider provider, long subscriptionId)
Parameters
provider
ISubscriptionProviderSubscription provider.
subscriptionId
longSubscription id.
UnSubscribeBoard(ISubscriptionProvider, ExchangeBoard)
Unsubscribe from the board changes.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribeBoard(this ISubscriptionProvider provider, ExchangeBoard board)
Parameters
provider
ISubscriptionProviderSubscription provider.
board
ExchangeBoardBoard for unsubscription.
UnSubscribeCandles(ISubscriptionProvider, CandleSeries)
To stop the candles receiving subscription, previously created by SubscribeCandles(ISubscriptionProvider, CandleSeries, DateTimeOffset?, DateTimeOffset?, long?, long?, IMessageAdapter, long?, FillGapsDays?).
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribeCandles(this ISubscriptionProvider provider, CandleSeries series)
Parameters
provider
ISubscriptionProviderSubscription provider.
series
CandleSeriesCandles series.
UnSubscribeLevel1(ISubscriptionProvider, Security)
To stop getting new information.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribeLevel1(this ISubscriptionProvider provider, Security security)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which new information getting should be stopped.
UnSubscribeMarketData(ISubscriptionProvider, Security, MarketDataMessage)
To unsubscribe from getting market data by the instrument.
public static void UnSubscribeMarketData(this ISubscriptionProvider provider, Security security, MarketDataMessage message)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which new information getting should be started.
message
MarketDataMessageThe message that contain unsubscribe info.
UnSubscribeMarketData(ISubscriptionProvider, MarketDataMessage)
To unsubscribe from getting market data.
public static void UnSubscribeMarketData(this ISubscriptionProvider provider, MarketDataMessage message)
Parameters
provider
ISubscriptionProviderSubscription provider.
message
MarketDataMessageThe message that contain unsubscribe info.
UnSubscribeMarketDepth(ISubscriptionProvider, Security)
To stop getting quotes by the instrument.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribeMarketDepth(this ISubscriptionProvider provider, Security security)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which quotes getting should be stopped.
UnSubscribeNews(ISubscriptionProvider, Security)
Unsubscribe from news.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribeNews(this ISubscriptionProvider provider, Security security = null)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecuritySecurity for subscription.
UnSubscribeOrderLog(ISubscriptionProvider, Security)
Unsubscribe from order log for the security.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribeOrderLog(this ISubscriptionProvider provider, Security security)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecuritySecurity for unsubscription.
UnSubscribeOrders(ISubscriptionProvider, long)
Unsubscribe from orders changes.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribeOrders(this ISubscriptionProvider provider, long originalTransactionId = 0)
Parameters
provider
ISubscriptionProviderSubscription provider.
originalTransactionId
longID of the original message SubscribeOrders(ISubscriptionProvider, OrderStatusMessage) for which this message is a response.
UnSubscribePositions(ISubscriptionProvider, long)
Unsubscribe from positions changes.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribePositions(this ISubscriptionProvider provider, long originalTransactionId = 0)
Parameters
provider
ISubscriptionProviderSubscription provider.
originalTransactionId
longID of the original message SubscribePositions(ISubscriptionProvider, PortfolioLookupMessage) for which this message is a response.
UnSubscribeTrades(ISubscriptionProvider, Security)
To stop getting trades (tick data) by the instrument.
[Obsolete("Use ISubscriptionProvider.UnSubscribe method.")]
public static void UnSubscribeTrades(this ISubscriptionProvider provider, Security security)
Parameters
provider
ISubscriptionProviderSubscription provider.
security
SecurityThe instrument by which trades getting should be stopped.
Upload<TMessage>(IMessageAdapter, IEnumerable<TMessage>)
Upload data.
public static void Upload<TMessage>(this IMessageAdapter adapter, IEnumerable<TMessage> messages) where TMessage : Message
Parameters
adapter
IMessageAdapterAdapter.
messages
IEnumerable<TMessage>Messages.
Type Parameters
TMessage
Request type.
ValidateId(ref string)
To check the correctness of the entered identifier.
public static string ValidateId(ref string id)
Parameters
id
stringSecurity ID.