SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Dec 18, 2018 6:35 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu Jul 20, 2017 11:47 am 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 237
Dear Team,

my client has upgraded to Version: 1.0.6407.31947 and he got the following error with the IB provider when subscribing for SP and VIX future:
Quote:
EventManager::OnException Exception occured in EventHandler - 07/19/2017 15:57:44.213 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.vA6tN4tX0w(Level2Update )
at SmartQuant.EventManager.qmfsIbV3aI(Event )
at SmartQuant.EventManager.OnEvent(Event e)

Time is in EST.

With his previous version, this did not happen.

Any idea what might have changed that caused this error?

Thanks
Mike


Top
 Profile  
 
PostPosted: Thu Apr 12, 2018 3:41 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 237
Hi there.

I fixed it with this MyEventFilter.cs

Code:
using System;
using System.Collections.Generic;
using SmartQuant;

namespace OpenQuant
{
    public class MyEventFilter : EventFilter
    {
        public MyEventFilter(Framework framework)
            : base(framework)
        {
            //Global
        }

        public override Event Filter(Event e)
        {
            try
            {
                switch (e.TypeId)
                {
                    case DataObjectType.Level2:
                    case DataObjectType.Level2Snapshot:
                    case DataObjectType.Level2Update:

                        return null;
                        break;
                }
                return e;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyEventsFilter. Error is: {0}", ex.Message);
                return null;
            }
        }
    }
}


and this call in the Scenario:
framework.EventManager.Filter = new MyEventFilter(framework);

therefore, I conclude, that it is not possible to use Level2 data with the IB provider as of now.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: Google [Bot] and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group