LocalMarketDataDrive
The file storage for market data.
Inherits: BaseMarketDataDrive
Constructors
public LocalMarketDataDrive()
localMarketDataDrive = LocalMarketDataDrive()
Initializes a new instance of the LocalMarketDataDrive.
public LocalMarketDataDrive(string path)
localMarketDataDrive = LocalMarketDataDrive(path)
Initializes a new instance of the LocalMarketDataDrive.
- path
- The path to the directory with data.
public LocalMarketDataDrive(IFileSystem fileSystem, string path)
localMarketDataDrive = LocalMarketDataDrive(fileSystem, path)
Initializes a new instance of the LocalMarketDataDrive.
- fileSystem
- File system abstraction.
- path
- The path to the directory with data.
Properties
public IEnumerable<SecurityId> AvailableSecurities { get; }
value = localMarketDataDrive.AvailableSecurities
Available securities.
public override string Path { get; set; }
value = localMarketDataDrive.Path
localMarketDataDrive.Path = value
Path to market data.
Methods
public Task BuildIndexAsync(ILogReceiver logs, Action<int, int> updateProgress, CancellationToken cancellationToken)
result = localMarketDataDrive.BuildIndexAsync(logs, updateProgress, cancellationToken)
Build an index for fast performance of accessing available data types from the storage.
- logs
- Logs. Can be .
- updateProgress
- Progress handler.
- cancellationToken
- CancellationToken
Returns: Task
public override IAsyncEnumerable<DataType> GetAvailableDataTypesAsync(SecurityId securityId, StorageFormats format)
result = localMarketDataDrive.GetAvailableDataTypesAsync(securityId, format)
Get all available data types.
- securityId
- Instrument identifier.
- format
- Format type.
Returns: Data types.
public override IAsyncEnumerable<SecurityId> GetAvailableSecuritiesAsync()
result = localMarketDataDrive.GetAvailableSecuritiesAsync()
Get all available instruments.
Returns: Available instruments.
public static DataType GetDataType(string fileName)
result = LocalMarketDataDrive.GetDataType(fileName)
Get data type and parameter for the specified file name.
- fileName
- The file name.
Returns: Data type and parameter associated with the type. For example, candle arg.
public static DateTime GetDate(string dirName)
result = LocalMarketDataDrive.GetDate(dirName)
Convert directory name to the date.
- dirName
- Directory name.
Returns: The date.
public static string GetDirName(DateTime date)
result = LocalMarketDataDrive.GetDirName(date)
Convert the date to directory name.
- date
- The date.
Returns: Directory name.
public static string GetExtension(StorageFormats format)
result = LocalMarketDataDrive.GetExtension(format)
To get the file extension for the format.
- format
- Format.
Returns: The extension.
public static string GetFileName(DataType dataType, StorageFormats? format, bool throwIfUnknown)
result = LocalMarketDataDrive.GetFileName(dataType, format, throwIfUnknown)
To get the file name by the type of data.
- dataType
- Data type info.
- format
- Storage format. If set an extension will be added to the file name.
- throwIfUnknown
- Throw exception if the specified type is unknown.
Returns: The file name.
public string GetSecurityPath(SecurityId securityId)
result = localMarketDataDrive.GetSecurityPath(securityId)
To get the path to the folder with market data for the instrument.
- securityId
- Security ID.
Returns: The path to the folder with market data.
public override IMarketDataStorageDrive GetStorageDrive(SecurityId securityId, DataType dataType, StorageFormats format)
result = localMarketDataDrive.GetStorageDrive(securityId, dataType, format)
To get the storage for IMarketDataStorage.
- securityId
- Security ID.
- dataType
- Data type info.
- format
- Format type.
Returns: Storage for IMarketDataStorage.
public override IAsyncEnumerable<SecurityMessage> LookupSecuritiesAsync(SecurityLookupMessage criteria, ISecurityProvider securityProvider)
result = localMarketDataDrive.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 TimeSpan? TrySaveIndex(TimeSpan diff)
result = localMarketDataDrive.TrySaveIndex(diff)
Try save existing index.
- diff
- Time diff from prev index change.
Returns: Time taken by build process. means no build happened.
public override ValueTask VerifyAsync(CancellationToken cancellationToken)
result = localMarketDataDrive.VerifyAsync(cancellationToken)
Verify settings.
- cancellationToken
- CancellationToken
Returns: ValueTask