SmartQuant Discussion
http://www.smartquant.com/forums/

EndOfStreamException in StartBacktest()
http://www.smartquant.com/forums/viewtopic.php?f=60&t=14961
Page 1 of 1

Author:  dave10030 [ Mon Sep 30, 2019 8:58 pm ]
Post subject:  EndOfStreamException in StartBacktest()

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.exe

How can I fix this exception?

Author:  skuvv [ Tue Oct 01, 2019 9:38 am ]
Post subject:  Re: EndOfStreamException in StartBacktest()

Hi,
Please, reproduce this problem in the default strategy (with default data) from the OQ2014 installation and send us a modified version.
This will allow us to debug your situation.

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/