CsvImporter

StockSharp.Algo.Import

从 CSV 格式的文本文件导入到存储的信件 。

继承自: CsvParser

构造函数

CsvImporter
public CsvImporter(DataType dataType, IEnumerable<FieldMapping> fields, ISecurityStorage securityStorage, IExchangeInfoProvider exchangeInfoProvider, Func<SecurityId, IMarketDataStorage> getStorage)
csvImporter = CsvImporter(dataType, fields, securityStorage, exchangeInfoProvider, getStorage)

从 CSV 格式的文本文件导入到存储的信件 。

dataType
数据类型信息.
fields
导入田地.
securityStorage
金融工具元信息存储。
exchangeInfoProvider
交易所和交易委员会供应商。
getStorage
由 SecurityId 获取 IMarketDataStorage 的函数 。

属性

UpdateDuplicateSecurities
public bool UpdateDuplicateSecurities { get; set; }
value = csvImporter.UpdateDuplicateSecurities
csvImporter.UpdateDuplicateSecurities = value

更新重复的金融工具, 如果它们已经存在。

方法

Import
public ValueTask<ValueTuple<int, DateTime?>> Import(Stream stream, Action<int> updateProgress, CancellationToken cancellationToken)
result = csvImporter.Import(stream, updateProgress, cancellationToken)

从 CSV 文件导入 。

stream
档案流.
updateProgress
进度通知.
cancellationToken
CancellationToken

返回值: 数并上回.

事件

SecurityUpdated
public event Action<Security, bool> SecurityUpdated
csvImporter.SecurityUpdated += handler

金融工具更新事件。