SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Jul 16, 2019 1:40 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Jun 12, 2019 11:10 pm 
Offline

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

when connecting to IB as a provider, I get these exception messages:
Quote:
source EventHandler exception: at OpenQuant.MyStrategy.OnProviderError(ProviderError error)
at SmartQuant.Strategy.MpHa8R2vVVw(ProviderError error)
at SmartQuant.Strategy.MpHa8R2vVVw(ProviderError error)
at SmartQuant.Strategy.MpHa8R2vVVw(ProviderError error)
at SmartQuant.StrategyManager.KoauRix983(ProviderError )
at SmartQuant.EventManager.KyTpadpMfB(Event )
at SmartQuant.EventManager.OnEvent(Event e) System.NullReferenceException: Object reference not set to an instance of an object.
at OpenQuant.MyStrategy.OnProviderError(ProviderError error)
at SmartQuant.Strategy.MpHa8R2vVVw(ProviderError error)
at SmartQuant.Strategy.MpHa8R2vVVw(ProviderError error)
at SmartQuant.Strategy.MpHa8R2vVVw(ProviderError error)
at SmartQuant.StrategyManager.KoauRix983(ProviderError )
at SmartQuant.EventManager.KyTpadpMfB(Event )
at SmartQuant.EventManager.OnEvent(Event e) ev.TypeId 21

and this one as well:
Quote:
source EventHandler exception: at System.Threading.Monitor.Enter(Object obj)
at OpenQuant.MyStrategy.OnProviderError(ProviderError error)
at SmartQuant.Strategy.OQUtsMwVdu0(ProviderError error)
at SmartQuant.Strategy.OQUtsMwVdu0(ProviderError error)
at SmartQuant.Strategy.OQUtsMwVdu0(ProviderError error)
at SmartQuant.StrategyManager.NvLbeZGRlY(ProviderError )
at SmartQuant.EventManager.IfHrNiEnOk(Event )
at SmartQuant.EventManager.OnEvent(Event e) System.ArgumentNullException: Value cannot be null.
at System.Threading.Monitor.Enter(Object obj)
at OpenQuant.MyStrategy.OnProviderError(ProviderError error)
at SmartQuant.Strategy.OQUtsMwVdu0(ProviderError error)
at SmartQuant.Strategy.OQUtsMwVdu0(ProviderError error)
at SmartQuant.Strategy.OQUtsMwVdu0(ProviderError error)
at SmartQuant.StrategyManager.NvLbeZGRlY(ProviderError )
at SmartQuant.EventManager.IfHrNiEnOk(Event )
at SmartQuant.EventManager.OnEvent(Event e) ev.TypeId 21

for this code:
Code:
protected override void OnException(string source, SmartQuant.Event ev, Exception exception)
      {
         string msg = "source " + source + " exception: " + exception.StackTrace + " " + exception.ToString() + " ev.TypeId " + ev.TypeId;
         Console.WriteLine(msg);
         base.OnException(source, ev, exception);
      }


I have an event filter for the strategy - which looks like this:

Code:
public override Event Filter(Event e)
        {
            try
            {
                switch (e.TypeId)
                {
                    case DataObjectType.Level2:
                    case DataObjectType.Level2Snapshot:
                    case DataObjectType.Level2Update:
                        return null;                     
                }
                return e;
            }
            catch (Exception ex)
            {
                Console.WriteLine("Error in MyEventsFilter. Error is: {0}", ex.Message);
                return null;
            }
        }

any idea, how I could interfere this or further debug? Or maybe even, what do you think is the reason for this?

Thanks
Mike


Top
 Profile  
 
PostPosted: Sat Jun 22, 2019 8:32 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6816
Hi Michael,

it's hard to say without proper debugging but we will add a protection against null events in the event manager. It should not happen and if this happens then there is definitely something wrong and should be fixed, but the framework and startegy will not crash at least.

Regards,
Anton


Top
 Profile  
 
PostPosted: Sat Jun 22, 2019 8:34 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6816
Though exception trace above points to OnProviderError in your strategy code...


Top
 Profile  
 
PostPosted: Sat Jun 22, 2019 8:36 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6816
Event seems to be handled correctly by the event manager

public const byte ProviderError = 21;

and

at SmartQuant.EventManager.OnEvent(Event e) ev.TypeId 21 in your debug trace...

so yes, it gets a provider error event and passes it to your strategy...


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

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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:  
cron
Powered by phpBB® Forum Software © phpBB Group