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
- 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
pathstringThe 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
logsILogReceiverLogs. Can be null.
updateProgressAction<int, int>Progress handler.
cancellationTokenCancellationToken
Returns
GetAvailableDataTypes(SecurityId, StorageFormats)
Get all available data types.
public override IEnumerable<DataType> GetAvailableDataTypes(SecurityId securityId, StorageFormats format)
Parameters
securityIdSecurityIdInstrument identifier.
formatStorageFormatsFormat type.
Returns
- IEnumerable<DataType>
Data types.
GetAvailableSecurities(string)
Get all available instruments.
[Obsolete("Use AvailableSecurities property.")]
public static IEnumerable<SecurityId> GetAvailableSecurities(string path)
Parameters
pathstringThe 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
fileNamestringThe 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
dirNamestringDirectory name.
Returns
- DateTime
The date.
GetDirName(DateTime)
Convert the date to directory name.
public static string GetDirName(DateTime date)
Parameters
dateDateTimeThe date.
Returns
- string
Directory name.
GetExtension(StorageFormats)
To get the file extension for the format.
public static string GetExtension(StorageFormats format)
Parameters
formatStorageFormatsFormat.
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
dataTypeDataTypeData type info.
formatStorageFormats?Storage format. If set an extension will be added to the file name.
throwIfUnknownboolThrow 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
securityIdSecurityIdSecurity 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
securityIdSecurityIdSecurity ID.
dataTypeDataTypeData type info.
formatStorageFormatsFormat 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
criteriaSecurityLookupMessageMessage security lookup for specified criteria.
securityProviderISecurityProviderThe provider of information about instruments.
newSecurityAction<SecurityMessage>The handler through which a new instrument will be passed.
isCancelledFunc<bool>The handler which returns an attribute of search cancel.
updateProgressAction<int, int>The handler through which a progress change will be passed.
TrySaveIndex(TimeSpan)
Try save existing index.
public TimeSpan? TrySaveIndex(TimeSpan diff)
Parameters
diffTimeSpanTime diff from prev index change.
Returns
Verify()
Verify settings.
public override void Verify()