RemoteStorageClient
The client for access to the history server.
Inherits: Disposable
Constructors
public RemoteStorageClient(IMessageAdapter adapter, int securityBatchSize)
remoteStorageClient = RemoteStorageClient(adapter, securityBatchSize)
Initializes a new instance of the RemoteStorageClient.
- adapter
- Message adapter.
- securityBatchSize
- The new instruments request block size.
Methods
public ValueTask DeleteAsync(SecurityId securityId, DataType dataType, StorageFormats format, DateTime date, CancellationToken cancellationToken)
result = remoteStorageClient.DeleteAsync(securityId, dataType, format, date, cancellationToken)
To remove market data on specified date from the storage.
- securityId
- Security ID.
- dataType
- Data type info.
- format
- Storage format.
- date
- Date.
- cancellationToken
- CancellationToken
Returns: ValueTask
protected override void DisposeManaged()
remoteStorageClient.DisposeManaged()
Release resources.
public IAsyncEnumerable<DataType> GetAvailableDataTypesAsync(SecurityId securityId, StorageFormats format)
result = remoteStorageClient.GetAvailableDataTypesAsync(securityId, format)
Get all available data types.
- securityId
- Instrument identifier.
- format
- Format type.
Returns: Data types.
public IAsyncEnumerable<SecurityId> GetAvailableSecuritiesAsync()
result = remoteStorageClient.GetAvailableSecuritiesAsync()
Get all available instruments as async stream.
Returns: Available instruments.
public ValueTask<IEnumerable<DateTime>> GetDatesAsync(SecurityId securityId, DataType dataType, StorageFormats format, CancellationToken cancellationToken)
result = remoteStorageClient.GetDatesAsync(securityId, dataType, format, cancellationToken)
To get all the dates for which market data are recorded.
- securityId
- Security ID.
- dataType
- Data type info.
- format
- Storage format.
- cancellationToken
- CancellationToken
Returns: Dates.
public ValueTask<Stream> LoadStreamAsync(SecurityId securityId, DataType dataType, StorageFormats format, DateTime date, CancellationToken cancellationToken)
result = remoteStorageClient.LoadStreamAsync(securityId, dataType, format, date, cancellationToken)
To load data in the format of StockSharp storage.
- securityId
- Security ID.
- dataType
- Data type info.
- format
- Storage format.
- date
- Date.
- cancellationToken
- CancellationToken
Returns: Data in the format of StockSharp storage. If no data exists, Null will be returned.
public IAsyncEnumerable<BoardMessage> LookupBoardsAsync(BoardLookupMessage criteria)
result = remoteStorageClient.LookupBoardsAsync(criteria)
Download boards by the specified criteria.
- criteria
- Message board lookup for specified criteria.
Returns: The sequence of found boards.
public IAsyncEnumerable<SecurityMessage> LookupSecuritiesAsync(SecurityLookupMessage criteria, ISecurityProvider securityProvider)
result = remoteStorageClient.LookupSecuritiesAsync(criteria, securityProvider)
Download securities by the specified criteria.
- criteria
- Message security lookup for specified criteria.
- securityProvider
- The provider of information about instruments.
Returns: The sequence of found instruments.
public ValueTask SaveSecuritiesAsync(IEnumerable<SecurityMessage> securities, CancellationToken cancellationToken)
result = remoteStorageClient.SaveSecuritiesAsync(securities, cancellationToken)
Save securities.
- securities
- Securities.
- cancellationToken
- CancellationToken
Returns: ValueTask
public ValueTask SaveStreamAsync(SecurityId securityId, DataType dataType, StorageFormats format, DateTime date, Stream stream, CancellationToken cancellationToken)
result = remoteStorageClient.SaveStreamAsync(securityId, dataType, format, date, stream, cancellationToken)
To save data in the format of StockSharp storage.
- securityId
- Security ID.
- dataType
- Data type info.
- format
- Storage format.
- date
- Date.
- stream
- cancellationToken
- CancellationToken
Returns: ValueTask
public ValueTask VerifyAsync(CancellationToken cancellationToken)
result = remoteStorageClient.VerifyAsync(cancellationToken)
Verify connection to the server. Connects and then disconnects to test connectivity.
- cancellationToken
- CancellationToken
Returns: ValueTask