Class LocalMarketDataDrive
- Namespace
- StockSharp.Algo.Storages
- Assembly
- StockSharp.Algo.dll
The file storage for market data.
public class LocalMarketDataDrive : BaseMarketDataDrive, IMarketDataDrive, IPersistable, IDisposable
- Inheritance
-
LocalMarketDataDrive
- Implements
-
IPersistable
- Inherited Members
- Extension Methods
Constructors
LocalMarketDataDrive()
Initializes a new instance of the LocalMarketDataDrive.
public LocalMarketDataDrive()
LocalMarketDataDrive(string)
Initializes a new instance of the LocalMarketDataDrive.
public LocalMarketDataDrive(string path)
Parameters
path
stringThe path to the directory with data.
Properties
AvailableSecurities
Get all available instruments.
public override IEnumerable<SecurityId> AvailableSecurities { get; }
Property Value
Path
Path to market data.
public override string Path { get; set; }
Property Value
Methods
BuildIndexAsync(ILogReceiver, Action<int, int>, CancellationToken)
Build an index for fast performance of accessing available data types from the storage.
public Task BuildIndexAsync(ILogReceiver logs, Action<int, int> updateProgress, CancellationToken cancellationToken)
Parameters
logs
ILogReceiverLogs. Can be null.
updateProgress
Action<int, int>Progress handler.
cancellationToken
CancellationToken
Returns
GetAvailableDataTypes(SecurityId, StorageFormats)
Get all available data types.
public override IEnumerable<DataType> GetAvailableDataTypes(SecurityId securityId, StorageFormats format)
Parameters
securityId
SecurityIdInstrument identifier.
format
StorageFormatsFormat type.
Returns
- IEnumerable<DataType>
Data types.
GetAvailableSecurities(string)
Get all available instruments.
[Obsolete("Use AvailableSecurities property.")]
public static IEnumerable<SecurityId> GetAvailableSecurities(string path)
Parameters
path
stringThe path to the directory with data.
Returns
- IEnumerable<SecurityId>
All available instruments.
GetDataType(string)
Get data type and parameter for the specified file name.
public static DataType GetDataType(string fileName)
Parameters
fileName
stringThe file name.
Returns
- DataType
Data type and parameter associated with the type. For example, candle arg.
GetDate(string)
Convert directory name to the date.
public static DateTime GetDate(string dirName)
Parameters
dirName
stringDirectory name.
Returns
- DateTime
The date.
GetDirName(DateTime)
Convert the date to directory name.
public static string GetDirName(DateTime date)
Parameters
date
DateTimeThe date.
Returns
- string
Directory name.
GetExtension(StorageFormats)
To get the file extension for the format.
public static string GetExtension(StorageFormats format)
Parameters
format
StorageFormatsFormat.
Returns
- string
The extension.
GetFileName(DataType, StorageFormats?, bool)
To get the file name by the type of data.
public static string GetFileName(DataType dataType, StorageFormats? format = null, bool throwIfUnknown = true)
Parameters
dataType
DataTypeData type info.
format
StorageFormats?Storage format. If set an extension will be added to the file name.
throwIfUnknown
boolThrow exception if the specified type is unknown.
Returns
- string
The file name.
GetSecurityPath(SecurityId)
To get the path to the folder with market data for the instrument.
public string GetSecurityPath(SecurityId securityId)
Parameters
securityId
SecurityIdSecurity ID.
Returns
- string
The path to the folder with market data.
GetStorageDrive(SecurityId, DataType, StorageFormats)
To get the storage for IMarketDataStorage.
public override IMarketDataStorageDrive GetStorageDrive(SecurityId securityId, DataType dataType, StorageFormats format)
Parameters
securityId
SecurityIdSecurity ID.
dataType
DataTypeData type info.
format
StorageFormatsFormat type.
Returns
- IMarketDataStorageDrive
Storage for IMarketDataStorage.
LookupSecurities(SecurityLookupMessage, ISecurityProvider, Action<SecurityMessage>, Func<bool>, Action<int, int>)
Download securities by the specified criteria.
public override void LookupSecurities(SecurityLookupMessage criteria, ISecurityProvider securityProvider, Action<SecurityMessage> newSecurity, Func<bool> isCancelled, Action<int, int> updateProgress)
Parameters
criteria
SecurityLookupMessageMessage security lookup for specified criteria.
securityProvider
ISecurityProviderThe provider of information about instruments.
newSecurity
Action<SecurityMessage>The handler through which a new instrument will be passed.
isCancelled
Func<bool>The handler which returns an attribute of search cancel.
updateProgress
Action<int, int>The handler through which a progress change will be passed.
TrySaveIndex(TimeSpan)
Try save existing index.
public TimeSpan? TrySaveIndex(TimeSpan diff)
Parameters
diff
TimeSpanTime diff from prev index change.
Returns
Verify()
Verify settings.
public override void Verify()