Show / Hide Table of Contents

Class LocalMarketDataDrive

The file storage for market data.

Inheritance
Object
BaseMarketDataDrive
LocalMarketDataDrive
Implements
IMarketDataDrive
Ecng.Serialization.IPersistable
IDisposable
Inherited Members
BaseMarketDataDrive.GetNewsMessageStorage(IMarketDataSerializer<NewsMessage>)
BaseMarketDataDrive.GetSecurityDrive(Security)
BaseMarketDataDrive.Load(SettingsStorage)
BaseMarketDataDrive.Save(SettingsStorage)
BaseMarketDataDrive.ToString()
Namespace: StockSharp.Algo.Storages
Assembly: StockSharp.Algo.dll
Syntax
public class LocalMarketDataDrive : BaseMarketDataDrive, IMarketDataDrive, IPersistable, IDisposable

Constructors

LocalMarketDataDrive()

Initializes a new instance of the LocalMarketDataDrive.

Declaration
public LocalMarketDataDrive()

LocalMarketDataDrive(String)

Initializes a new instance of the LocalMarketDataDrive.

Declaration
public LocalMarketDataDrive(string path)
Parameters
Type Name Description
String path

The path to the directory with data.

Properties

AvailableSecurities

Get all available instruments.

Declaration
public override IEnumerable<SecurityId> AvailableSecurities { get; }
Property Value
Type Description
IEnumerable<SecurityId>
Overrides
BaseMarketDataDrive.AvailableSecurities

Path

Path to market data.

Declaration
public override string Path { get; set; }
Property Value
Type Description
String
Overrides
BaseMarketDataDrive.Path

Methods

GetAvailableDataTypes(SecurityId, StorageFormats)

Get all available data types.

Declaration
public override IEnumerable<DataType> GetAvailableDataTypes(SecurityId securityId, StorageFormats format)
Parameters
Type Name Description
SecurityId securityId

Instrument identifier.

StorageFormats format

Format type.

Returns
Type Description
IEnumerable<DataType>

Data types.

Overrides
BaseMarketDataDrive.GetAvailableDataTypes(SecurityId, StorageFormats)

GetAvailableSecurities(String)

Get all available instruments.

Declaration
public static IEnumerable<SecurityId> GetAvailableSecurities(string path)
Parameters
Type Name Description
String path

The path to the directory with data.

Returns
Type Description
IEnumerable<SecurityId>

All available instruments.

GetDataType(String)

Get data type and parameter for the specified file name.

Declaration
public static DataType GetDataType(string fileName)
Parameters
Type Name Description
String fileName

The file name.

Returns
Type Description
DataType

Data type and parameter associated with the type. For example, Arg.

GetDate(String)

Convert directory name to the date.

Declaration
public static DateTime GetDate(string dirName)
Parameters
Type Name Description
String dirName

Directory name.

Returns
Type Description
DateTime

The date.

GetDirName(DateTime)

Convert the date to directory name.

Declaration
public static string GetDirName(DateTime date)
Parameters
Type Name Description
DateTime date

The date.

Returns
Type Description
String

Directory name.

GetExtension(StorageFormats)

To get the file extension for the format.

Declaration
public static string GetExtension(StorageFormats format)
Parameters
Type Name Description
StorageFormats format

Format.

Returns
Type Description
String

The extension.

GetFileName(DataType, Nullable<StorageFormats>, Boolean)

To get the file name by the type of data.

Declaration
public static string GetFileName(DataType dataType, Nullable<StorageFormats> format = null, bool throwIfUnknown = true)
Parameters
Type Name Description
DataType dataType

Data type info.

Nullable<StorageFormats> format

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

Boolean throwIfUnknown

Throw exception if the specified type is unknown.

Returns
Type Description
String

The file name.

GetFileName(Type, Object, Nullable<StorageFormats>)

To get the file name by the type of data.

Declaration
public static string GetFileName(Type dataType, object arg, Nullable<StorageFormats> format = null)
Parameters
Type Name Description
Type dataType

Data type.

Object arg

The parameter associated with the dataType type. For example, Arg.

Nullable<StorageFormats> format

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

Returns
Type Description
String

The file name.

GetSecurityPath(SecurityId)

To get the path to the folder with market data for the instrument.

Declaration
public string GetSecurityPath(SecurityId securityId)
Parameters
Type Name Description
SecurityId securityId

Security ID.

Returns
Type Description
String

The path to the folder with market data.

GetStorageDrive(SecurityId, DataType, StorageFormats)

To get the storage for IMarketDataStorage.

Declaration
public override IMarketDataStorageDrive GetStorageDrive(SecurityId securityId, DataType dataType, StorageFormats format)
Parameters
Type Name Description
SecurityId securityId

Security ID.

DataType dataType

Data type info.

StorageFormats format

Format type.

Returns
Type Description
IMarketDataStorageDrive

Storage for IMarketDataStorage.

Overrides
BaseMarketDataDrive.GetStorageDrive(SecurityId, DataType, StorageFormats)

LookupSecurities(SecurityLookupMessage, ISecurityProvider, Action<SecurityMessage>, Func<Boolean>, Action<Int32, Int32>)

Download securities by the specified criteria.

Declaration
public override void LookupSecurities(SecurityLookupMessage criteria, ISecurityProvider securityProvider, Action<SecurityMessage> newSecurity, Func<bool> isCancelled, Action<int, int> updateProgress)
Parameters
Type Name Description
SecurityLookupMessage criteria

Message security lookup for specified criteria.

ISecurityProvider securityProvider

The provider of information about instruments.

Action<SecurityMessage> newSecurity

The handler through which a new instrument will be passed.

Func<Boolean> isCancelled

The handler which returns an attribute of search cancel.

Action<Int32, Int32> updateProgress

The handler through which a progress change will be passed.

Overrides
BaseMarketDataDrive.LookupSecurities(SecurityLookupMessage, ISecurityProvider, Action<SecurityMessage>, Func<Boolean>, Action<Int32, Int32>)

Verify()

Verify settings.

Declaration
public override void Verify()
Overrides
BaseMarketDataDrive.Verify()

Implements

IMarketDataDrive
Ecng.Serialization.IPersistable
System.IDisposable

Extension Methods

Paths.Serialize<T>(T, String)
Paths.Serialize<T>(T)
Extensions.TryGet<TMessage, TChange>(TMessage, TChange)
Extensions.TryGetDecimal<TMessage, TChange>(TMessage, TChange)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Object)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Decimal)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Int32)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Int64)
Extensions.Add<TMessage, TChange>(TMessage, TChange, SecurityStates)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<SecurityStates>)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, String)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Sides)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Sides>)
Extensions.Add<TMessage, TChange>(TMessage, TChange, CurrencyTypes)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<CurrencyTypes>)
Extensions.Add<TMessage, TChange>(TMessage, TChange, PortfolioStates)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<PortfolioStates>)
Extensions.Add<TMessage, TChange>(TMessage, TChange, DateTimeOffset)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<DateTimeOffset>)
Extensions.Add<TMessage, TChange>(TMessage, TChange, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Boolean>)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Decimal, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Decimal>, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Int32, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Int32>, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Int64, Boolean)
Extensions.TryAdd<TMessage, TChange>(TMessage, TChange, Nullable<Int64>, Boolean)
EditorExtensions.ToItemsSource(Object, Type, Nullable<Boolean>, Nullable<ListSortDirection>, Func<IItemsSourceItem, Boolean>, Func<Object, String>, Func<Object, String>)
XamlHelper.WpfCast<T>(Object)
XamlHelper.CopyToClipboard<T>(T)
XamlHelper.EnsureUIThread(Object)
☀
☾
In This Article
Back to top
Copyright © StockSharp.
☀
☾