public override void DeleteDataSeries(Instrument instrument, byte type, BarType barType = BarType.Time, long barSize = 60)
{
DataSeries dataSeries;
if (type == DataObjectType.Bar)
{
var iId = instrument.Id;
dataSeries = GetBarDataSeriesInCache(instrument, barType, barSize, false);
if (barType == BarType.Time && barSize <= TimeSpan.TicksPerDay / TimeSpan.TicksPerSecond)
{
this.byIId_BSize[iId][(int)barSize] = null;
}
else
{
this.byType_IId_BSize[type] = this.byType_IId_BSize[type] ?? new IdArray<Dictionary<long, DataSeries>>();
this.byType_IId_BSize[type][iId] = this.byType_IId_BSize[type][iId] ?? new Dictionary<long, DataSeries>();
this.byType_IId_BSize[type][iId].Remove(barSize);
}
this.dataFile.Delete(DataSeriesNameHelper.GetName(instrument, barType, barSize));
}
else
{
dataSeries = this.byType[type][instrument.Id];
if (dataSeries != null)
this.byType[type].Remove(instrument.Id);
this.dataFile.Delete(DataSeriesNameHelper.GetName(instrument, type));
}
}