Table of Contents

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 string

The path to the directory with data.

Properties

AvailableSecurities

Get all available instruments.

public override IEnumerable<SecurityId> AvailableSecurities { get; }

Property Value

IEnumerable<SecurityId>

Path

Path to market data.

public override string Path { get; set; }

Property Value

string

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 ILogReceiver

Logs. Can be null.

updateProgress Action<int, int>

Progress handler.

cancellationToken CancellationToken

CancellationToken

Returns

Task

Task

GetAvailableDataTypes(SecurityId, StorageFormats)

Get all available data types.

public override IEnumerable<DataType> GetAvailableDataTypes(SecurityId securityId, StorageFormats format)

Parameters

securityId SecurityId

Instrument identifier.

format StorageFormats

Format 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 string

The 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 string

The 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 string

Directory name.

Returns

DateTime

The date.

GetDirName(DateTime)

Convert the date to directory name.

public static string GetDirName(DateTime date)

Parameters

date DateTime

The date.

Returns

string

Directory name.

GetExtension(StorageFormats)

To get the file extension for the format.

public static string GetExtension(StorageFormats format)

Parameters

format StorageFormats

Format.

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 DataType

Data type info.

format StorageFormats?

Storage format. If set an extension will be added to the file name.

throwIfUnknown bool

Throw 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 SecurityId

Security 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 SecurityId

Security ID.

dataType DataType

Data type info.

format StorageFormats

Format 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 SecurityLookupMessage

Message security lookup for specified criteria.

securityProvider ISecurityProvider

The 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 TimeSpan

Time diff from prev index change.

Returns

TimeSpan?

Time taken by build process. null means no build happened.

Verify()

Verify settings.

public override void Verify()