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

Error when running strategy in realtime
http://www.smartquant.com/forums/viewtopic.php?f=43&t=14719
Page 1 of 1

Author:  AlgoLondon2017 [ Thu Jun 22, 2017 2:23 pm ]
Post subject:  Error when running strategy in realtime

I am trying to run a strategy in realtime but I am getting the following error. I am subscribing to IB, EUR/USD.

EventManager::OnException Exception occured in EventHandler - 6/22/2017 12:21:54.082 SmartQuant.Level2Update - System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.SortedList`2.RemoveAt(Int32 index)
at SmartQuant.OrderBook.Set(Level2Update update)
at SmartQuant.DataManager.b3CmKVeqiD(Level2Update )
at SmartQuant.EventManager.GJOAP5yB81(Event )
at SmartQuant.EventManager.OnEvent(Event e)

Any thoughts?

Author:  kkkwj [ Fri Jun 23, 2017 1:47 am ]
Post subject:  Re: Error when running strategy in realtime

Not that you want to hear my thoughts on this error, but my guess is that your code is trying to reference beyond the limits of an array or series (a collection). Maybe you have a loop index, or an item index that is the wrong value.

Author:  AlgoLondon2017 [ Fri Jun 23, 2017 5:55 pm ]
Post subject:  Re: Error when running strategy in realtime

Actually the error is not coming from the strategy. The error pops up when I open QuoteMonitor for Interactive Brokers and add symbols to it.

Any thoughts!?

EventManager::OnException Exception occured in EventHandler - 1/1/0001 00:00:00.000 SmartQuant.Level2Update - System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource)
at System.Collections.Generic.SortedList`2.RemoveAt(Int32 index)
at SmartQuant.OrderBook.Set(Level2Update update)
at SmartQuant.DataManager.b3CmKVeqiD(Level2Update )
at SmartQuant.EventManager.GJOAP5yB81(Event )
at SmartQuant.EventManager.OnEvent(Event e)

Author:  kkkwj [ Fri Jun 23, 2017 6:10 pm ]
Post subject:  Re: Error when running strategy in realtime

Good info, I guess it's not your strategy. And you're running OQ2014 (I think), which I have no experience with.

At least with my old version, adding and removing instruments from the Quote Monitor (or more common for me, to the real-time data importer) can be tricky and can cause errors. With the data importer, I'm always careful to only add/remove symbols when the data collector is not monitoring, else I get errors (maybe something like yours). Removing seems to be more of a problem.

The quote monitor doesn't have a button to start or stop it, so its behavior might be different. But my working theory is that both of them are monitoring, and they might be sharing some code to manage the list of symbols being monitored. All I can suggest is that you not remove symbols from the monitor. Instead, close the monitor and add the symbols back.

If it consistently happens after rebooting OQ, and if IB EURUSD is the first symbol being monitored, another long shot idea is that it might be in the instrument definition. Maybe the AltId group values are not right, or something like that. I'm sorry I can't be of more help.

Author:  skuvv [ Tue Jun 27, 2017 4:26 pm ]
Post subject:  Re: Error when running strategy in realtime

Problem fixed,
try it with new release.

Author:  mikembb [ Thu Apr 12, 2018 3:42 pm ]
Post subject:  Re: Error when running strategy in realtime

not really fixed the issue till today.

But this is a fix, if you do not need level2 data:
http://www.smartquant.com/forums/viewtopic.php?f=86&t=14726&p=41071#p41071

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