StorageHelper

StockSharp.Algo.Storages

Extension class for storage.

Методы

ClearDatesCache(IMarketDataStorageDrive)

Synchronous wrapper for CancellationToken).

drive
Market data storage drive.
Delete(ISecurityStorage, Security)

Synchronous wrapper for CancellationToken).

storage
Security storage.
security
Security.
Delete(IMarketDataStorageDrive, DateTime)

Synchronous wrapper for CancellationToken).

drive
Market data storage drive.
date
Date, for which all data shall be deleted.
Delete(IMarketDataStorage, IEnumerable<Message>)

Synchronous wrapper for CancellationToken).

storage
Market data storage.
data
Market data to be deleted.
Delete(IMarketDataStorage, DateTime)

Synchronous wrapper for CancellationToken).

storage
Market data storage.
date
Date, for which all data shall be deleted.
Delete(IMarketDataStorage, DateTime?, DateTime?) : bool

To delete market data from the storage for the specified time period.

storage
Market-data storage.
from
The start time for data deleting. If the value is not specified, the data will be deleted starting from the date GetDatesAsync.
to
The end time, up to which the data shall be deleted. If the value is not specified, data will be deleted up to the end date GetDatesAsync, inclusive.

Возвращает: if data was deleted, data not exist for the specified period.

DeleteAsync(IMarketDataStorage, DateTime?, DateTime?, CancellationToken) : ValueTask<bool>

To delete market data from the storage for the specified time period.

storage
Market-data storage.
from
The start time for data deleting. If the value is not specified, the data will be deleted starting from the date GetDatesAsync.
to
The end time, up to which the data shall be deleted. If the value is not specified, data will be deleted up to the end date GetDatesAsync, inclusive.
cancellationToken
CancellationToken

Возвращает: if data was deleted, data not exist for the specified period.

DeleteBy(ISecurityStorage, SecurityLookupMessage)

Synchronous wrapper for CancellationToken).

storage
Security storage.
criteria
The criterion.
DeleteByIdAsync(ISecurityStorage, string, CancellationToken) : ValueTask

Delete instrument by identifier.

securityStorage
Securities meta info storage.
securityId
Identifier.
cancellationToken
CancellationToken
DeleteByIdAsync(ISecurityStorage, SecurityId, CancellationToken) : ValueTask

Delete instrument by identifier.

securityStorage
Securities meta info storage.
securityId
Identifier.
cancellationToken
CancellationToken
DeleteRange(ISecurityStorage, IEnumerable<Security>)

Synchronous wrapper for CancellationToken).

storage
Security storage.
securities
Securities.
Delete``1(IMarketDataStorage<T>, IEnumerable<T>)

Synchronous wrapper for CancellationToken).

storage
Market data storage.
data
Market data to be deleted.
FolderNameToSecurityId(string) : string

The inverse conversion from the String) method.

folderName
Directory name.

Возвращает: Security ID.

GetAvailableDataTypes(IMarketDataDrive, SecurityId, StorageFormats) : IEnumerable<DataType>

Get all available data types.

drive
IMarketDataDrive
securityId
Instrument identifier.
format
Format type.

Возвращает: Data types.

GetCandleMessageBuildableStorage(CandleBuilderProvider, IStorageRegistry, SecurityId, TimeSpan, IMarketDataDrive, StorageFormats, CancellationToken) : ValueTask<IMarketDataStorage<CandleMessage>>

To get the candles storage for the specified instrument. The storage will build candles from smaller time-frames if original time-frames is not exist.

provider
Candle builders provider.
registry
Market-data storage.
securityId
Security ID.
timeFrame
Time-frame.
drive
The storage. If a value is , DefaultDrive will be used.
format
The format type. By default Binary is passed.
cancellationToken
CancellationToken

Возвращает: The candles storage.

GetCandleMessageStorage(IStorageRegistry, Subscription, IMarketDataDrive, StorageFormats) : IMarketDataStorage<CandleMessage>

To get the candles storage for the specified instrument.

registry
IStorageRegistry.
subscription
Subscription.
drive
The storage.
format
The format type.

Возвращает: The candles storage.

GetCandleMessageStorage(IStorageRegistry, Type, SecurityId, object, IMarketDataDrive, StorageFormats) : IMarketDataStorage<CandleMessage>

To get the candles storage for the specified instrument.

registry
IStorageRegistry
candleMessageType
The type of candle message.
securityId
Security ID.
arg
Candle arg.
drive
The storage.
format
The format type.

Возвращает: The candles storage.

GetDates(IMarketDataStorage, DateTime?, DateTime?) : IEnumerable<DateTime>

To get all dates for stored market data for the specified range.

storage
Market-data storage.
from
The range start time. If the value is not specified, data will be loaded from the start date GetDatesAsync.
to
The range end time. If the value is not specified, data will be loaded up to the end date GetDatesAsync, inclusive.

Возвращает: All available data within the range.

GetDates(IMarketDataStorageDrive) : IEnumerable<DateTime>

Synchronous wrapper for GetDatesAsync.

drive
Market data storage drive.

Возвращает: Available dates.

GetDates(IMarketDataStorage) : IEnumerable<DateTime>

Synchronous wrapper for GetDatesAsync.

storage
Market data storage.

Возвращает: Available dates.

GetDatesAsync(IMarketDataStorage, DateTime?, DateTime?) : IAsyncEnumerable<DateTime>

To get all dates for stored market data for the specified range.

storage
Market-data storage.
from
The range start time. If the value is not specified, data will be loaded from the start date GetDatesAsync.
to
The range end time. If the value is not specified, data will be loaded up to the end date GetDatesAsync, inclusive.

Возвращает: All available data within the range.

GetExecutionMessageStorage(IStorageRegistry, SecurityId, ExecutionTypes, IMarketDataDrive, StorageFormats) : IMarketDataStorage<ExecutionMessage>

To get the ExecutionMessage storage for the specified instrument.

registry
IStorageRegistry
securityId
Security ID.
type
Data type, information about which is contained in the ExecutionMessage.
drive
The storage.
format
The format type.

Возвращает: The ExecutionMessage storage.

GetFromDate(IMarketDataStorage) : DateTime?

To get the start date for market data, stored in the storage.

storage
Market-data storage.

Возвращает: The start date. If the value is not initialized, the storage is empty.

GetMetaInfo(IMarketDataStorage, DateTime) : IMarketDataMetaInfo

Synchronous wrapper for CancellationToken).

storage
Market data storage.
date
Date, for which meta-information on data shall be received.

Возвращает: Meta-information on data. If there is no such date in history, will be returned.

GetRange(IMarketDataStorage, DateTime?, DateTime?) : IRange<DateTime>

Get available date range for the specified storage.

storage
Storage.
from
The initial date from which you need to get data.
to
The final date by which you need to get data.

Возвращает: Date range

GetRangeAsync(IMarketDataStorage, DateTime?, DateTime?, CancellationToken) : ValueTask<IRange<DateTime>>

Get available date range for the specified storage.

storage
Storage.
from
The initial date from which you need to get data.
to
The final date by which you need to get data.
cancellationToken
CancellationToken

Возвращает: Date range

GetSnapshotStorage(ISnapshotRegistry, Type, object) : ISnapshotStorage

To get the snapshot storage.

registry
Snapshot storage registry.
dataType
Market data type.
arg
The parameter associated with the type. For example, candle arg.

Возвращает: The snapshot storage.

GetStorage(IStorageRegistry, SecurityId, Type, object, IMarketDataDrive, StorageFormats) : IMarketDataStorage

To get the market-data storage.

registry
IStorageRegistry
securityId
Security ID.
dataType
Market data type.
arg
The parameter associated with the type. For example, candle arg.
drive
The storage.
format
The format type.

Возвращает: Market-data storage.

GetStorage(IStorageRegistry, Security, Type, object, IMarketDataDrive, StorageFormats) : IMarketDataStorage

To get the market-data storage.

registry
IStorageRegistry
security
Security.
dataType
Market data type.
arg
The parameter associated with the type. For example, candle arg.
drive
The storage. If a value is , DefaultDrive will be used.
format
The format type. By default Binary is passed.

Возвращает: Market-data storage.

GetStorage(IStorageRegistry, Security, DataType, IMarketDataDrive, StorageFormats) : IMarketDataStorage

To get the market-data storage.

registry
Market-data storage.
security
Security.
dataType
Data type info.
drive
The storage. If a value is , DefaultDrive will be used.
format
The format type. By default Binary is passed.

Возвращает: Market-data storage.

GetTimeFrameCandleMessageStorage(IStorageRegistry, SecurityId, TimeSpan, IMarketDataDrive, StorageFormats) : IMarketDataStorage<CandleMessage>

To get the candles storage for the specified instrument.

registry
IStorageRegistry.
securityId
Security ID.
arg
Candle arg.
drive
The storage.
format
The format type.

Возвращает: The candles storage.

GetToDate(IMarketDataStorage) : DateTime?

To get the end date for market data, stored in the storage.

storage
Market-data storage.

Возвращает: The end date. If the value is not initialized, the storage is empty.

Load(IMarketDataStorage, DateTime) : IEnumerable<T>

Synchronous wrapper for DateTime).

storage
Market data storage.
date
Date, for which data shall be loaded.

Возвращает: Data. If there is no data, the empty set will be returned.

LoadAsync``1(IMarketDataStorage<T>, DateTime?, DateTime?)

To create an iterative loader of market data for the time range.

storage
Market-data storage.
from
The start time for data loading. If the value is not specified, data will be loaded from the starting time GetDatesAsync.
to
The end time for data loading. If the value is not specified, data will be loaded up to the GetDatesAsync date, inclusive.

Возвращает: The iterative loader of market data.

LoadMessages(StorageCoreSettings, CandleBuilderProvider, MarketDataMessage, Action<Message>) : ValueTuple?<DateTime?, long?>

Load messages.

settings
Storage settings.
candleBuilderProvider
Candle builders provider.
subscription
Market-data message (uses as a subscribe/unsubscribe in outgoing case, confirmation event in incoming case).
newOutMessage
New message event.

Возвращает: Last date.

LoadMessagesAsync(StorageCoreSettings, CandleBuilderProvider, MarketDataMessage, StorageLoadContext, CancellationToken) : IAsyncEnumerable<Message>

Load history messages from storage as async stream.

settings
Storage settings.
candleBuilderProvider
Candle builders provider.
subscription
Market-data message (uses as a subscribe/unsubscribe in outgoing case, confirmation event in incoming case).
context
Context that will be populated with load result metadata after enumeration.
cancellationToken
Cancellation token.

Возвращает: Async stream of messages.

LoadStream(IMarketDataStorageDrive, DateTime, bool) : Stream

Synchronous wrapper for CancellationToken).

drive
Market data storage drive.
date
Date, for which data shall be loaded.
readOnly
Get stream in read mode only.

Возвращает: Data in the format of StockSharp storage. If no data exists, Null will be returned.

Load``1(IMarketDataStorage<T>, DateTime)

Synchronous wrapper for DateTime).

storage
Market data storage.
date
Date, for which data shall be loaded.

Возвращает: Data. If there is no data, the empty set will be returned.

Load``1(IMarketDataStorage<T>, DateTime?, DateTime?)

To create an iterative loader of market data for the time range.

storage
Market-data storage.
from
The start time for data loading. If the value is not specified, data will be loaded from the starting time GetDatesAsync.
to
The end time for data loading. If the value is not specified, data will be loaded up to the GetDatesAsync date, inclusive.

Возвращает: The iterative loader of market data.

Save(IMarketDataStorage, IEnumerable<Message>) : int

Synchronous wrapper for CancellationToken).

storage
Market data storage.
data
Market data.

Возвращает: Count of saved data.

Save(ISecurityStorage, Security, bool)

Synchronous wrapper for CancellationToken).

storage
Security storage.
security
Security.
forced
Forced update.
SaveStream(IMarketDataStorageDrive, DateTime, Stream)

Synchronous wrapper for CancellationToken).

drive
Market data storage drive.
date
The date, for which data shall be saved.
stream
Data in the format of StockSharp storage.
Save``1(IMarketDataStorage<T>, IEnumerable<T>)

Synchronous wrapper for CancellationToken).

storage
Market data storage.
data
Market data.

Возвращает: Count of saved data.

SecurityIdToFolderName(string) : string

To convert the instrument identifier into the folder name, replacing reserved symbols.

id
Security ID.

Возвращает: Directory name.

SetAdapter``1(IMappingMessageAdapterProvider<T>, T, IMessageAdapter)

Make association with adapter.

provider
Message adapter's provider interface.
key
Key.
adapter
Adapter.

Возвращает: if the association is successfully changed, otherwise, .

Поля

SecurityBackslashSeparator : string

The delimiter, replacing '\\' in path for instruments with id like USD\\EUR. Is equal to '##BS##'.

SecurityColonSeparator : string

The delimiter, replacing ':' in the path for instruments with id like AA-CA:SPB@SPBEX. Is equal to '##COLON##'.

SecurityFirstDot : string

The delimiter, replacing first '.' in the path for instruments with id like .AA-CA@SPBEX. Is equal to '##DOT##'.

SecurityQuestionSeparator : string

The delimiter, replacing '?' in the path for instruments with id like AA-CA?SPB@SPBEX. Is equal to '##QSTN##'.

SecuritySlashSeparator : string

The delimiter, replacing '/' in path for instruments with id like USD/EUR. Is equal to '__'.

SecurityStarSeparator : string

The delimiter, replacing '*' in the path for instruments with id like C.BPO-*@CANADIAN. Is equal to '##STAR##'.

SecurityVerticalBarSeparator : string

The delimiter, replacing '|' in the path for instruments with id like AA-CA|SPB@SPBEX. Is equal to '##VBAR##'.