Class LocalMarketDataDrive
The file storage for market data.
Inherited Members
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
Path
Path to market data.
Declaration
public override string Path { get; set; }
Property Value
Type | Description |
---|---|
String |
Overrides
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
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 |
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
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
Verify()
Verify settings.
Declaration
public override void Verify()