I sometimes catch exception in this:
Code:
DateTime temp = dt1;
while (temp + new TimeSpan(1, 0, 0, 0) < dt2)
{
DataSimulator.DateTime1 = temp;
DataSimulator.DateTime2 = temp + new TimeSpan(1, 0, 0, 0);
temp += new TimeSpan(1, 0, 0, 0);
try
{
StartBacktest();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
The exception says:
Code:
System.IO.EndOfStreamException: Unable to read beyond the end of the stream。
in System.IO.__Error.EndOfFile()
in System.IO.BinaryReader.FillBuffer(Int32 numBytes)
in System.IO.BinaryReader.ReadInt64()
in SmartQuant.NetDataFile_.yUQPMJFLyB(NetDataSeries , Int64 , Boolean )
in SmartQuant.NetDataSeries.GetIndex(DateTime dateTime, SearchOption option)
in Jps11lpriQ5NSp0Ku8j.BCDLl4pmi6Ds517tFby..ctor(IDataSeries , DateTime , DateTime , EventQueue , DataProcessor )
in SmartQuant.DataSimulator.OnConnected()
in SmartQuant.Provider.set_Status(ProviderStatus value)
in SmartQuant.DataSimulator.Connect()
in SmartQuant.Strategy.cSXFdr8iit(Strategy , InstrumentList , Int32 )
in SmartQuant.InstrumentStrategy.f9lUUbMwQ9()
in SmartQuant.StrategyManager.StartStrategy(Strategy strategy, StrategyMode mode)
in SmartQuant.Scenario.StartStrategy(StrategyMode mode)
in SmartQuant.Scenario.StartBacktest()
in OpenQuant.Backtest.Run() in C:\Users\lenovo\Desktop\MySampleProviders\All_Providers\OpenQuantPlugins\Strategy_Reversal\Backtest\Scenario.cs: line 102
And the file
data.quant never changed even after closing
FileServer.exeHow can I fix this exception?