SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Thu Oct 24, 2019 12:14 am

All times are UTC + 3 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sat May 19, 2018 9:02 am 

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

when I run this scenario in VS 2017:
public override void Run()
            StrategyManager.Mode = StrategyMode.Live;

            strategy = new MyStrategy(framework, "ProviderTest");

            Instrument instrument1 = InstrumentManager.Instruments["ES M18"];

            strategy.ExecutionProvider = ProviderManager.GetExecutionProvider(ProviderId.IB);
            strategy.DataProvider = ProviderManager.GetDataProvider(ProviderId.IB);


, I get this error System.NullReferenceException when VS starts StartStrategy. And it happens after the second time it debugs into MyStrategy in here:
public MyStrategy(Framework framework, string name)
            : base(framework, name)         { }
When I change StrategyManager.Mode = StrategyMode.Live; to StrategyManager.Mode = StrategyMode.Backtest or StrategyMode.Paper;
all runs fine.

Sure enough, if I run above code in OQ2014, all runs fine. Any idea?

PostPosted: Mon May 21, 2018 10:06 am 

Joined: Wed May 05, 2010 9:49 pm
Posts: 536
Hello Mike,
first, Initialize(); should not be used in scenario when you add instruments programmatically.
next, can you provide error text and details(stack trace).

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