SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Oct 21, 2020 12:11 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: TT API with XTrader
PostPosted: Tue Jan 07, 2020 1:10 pm 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 236
Hi I am trying to get a system live but getting issues. using your SMACrossover system:

Code:
            
                  Instrument instrument1 = InstrumentManager.Instruments["Eurex FDAX Mar20"];
         Instrument instrument2 = InstrumentManager.Instruments["Eurex FDAX Jun20"];

         // Create SMA Crossover strategy
         strategy = new MyStrategy(framework, "SMACrossover");

         // Add instrument

         strategy.DataProvider = ProviderManager.GetDataProvider(11);
         strategy.ExecutionProvider = ProviderManager.GetExecutionProvider(11);
         
         while (!strategy.DataProvider.IsConnected)
         {
            strategy.DataProvider.Connect(1000);
            // Console.WriteLine("Trying to Connect");
         }

         strategy.AddInstrument(instrument1);
         strategy.AddInstrument(instrument2);

         // Add 1 minute bars
         BarFactory.Clear();
         BarFactory.Add(instrument1, BarType.Time, barSize);
         BarFactory.Add(instrument2, BarType.Time, barSize);
         // Run the strategy
         StartStrategy();;


gives error:

System.NullReferenceException: 'Object reference not set to an instance of an object.' for StartStrategy()


Last edited by azuric on Tue Jan 07, 2020 1:54 pm, edited 3 times in total.

Top
 Profile  
 
 Post subject: Re: TT API with XTrader
PostPosted: Tue Jan 07, 2020 1:11 pm 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 236
TT API does connect and pull data fine for the instruments manually

But it doesn't connect properly then OQ2014 freezes completely and crashes.


Last edited by azuric on Tue Jan 07, 2020 1:52 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: TT API with XTrader
PostPosted: Tue Jan 07, 2020 1:43 pm 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 236
10:39:57.99667 [System] Resolving TradingTechnologies.TTAPI, Version=7.17.86.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
10:39:57.99767 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.TTAPI.dll'
10:39:58.21258 [System] Loaded TradingTechnologies.TTAPI, Version=7.17.86.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
10:39:58.26855 [System] Dispatcher thread is started
10:39:58.27255 [System] Resolving TradingTechnologies.Logging, Version=7.9.86.0, Culture=neutral, PublicKeyToken=eb3fc33c1c85a812
10:39:58.27255 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.Logging.dll'
10:39:58.27755 [System] Loaded TradingTechnologies.Logging, Version=7.9.86.0, Culture=neutral, PublicKeyToken=eb3fc33c1c85a812
10:39:58.60740 [System] Dispatcher is attached
10:39:58.61040 [System] Creating XTraderModeTTAPI
10:39:58.63939 [System] Resolving TradingTechnologies.TTAPI.Tradebook, Version=7.17.86.0, PublicKeyToken=423079b15fc884a6
10:39:58.63939 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.TTAPI.Tradebook.dll'
10:39:58.64139 [System] Loaded TradingTechnologies.TTAPI.Tradebook, Version=7.17.86.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
10:40:00.42859 [System] XTraderModeTTAPI is initialized successfully
10:40:00.42859 [System] Starting XTraderModeTTAPI
10:40:00.55853 [System] ConnectionStatusUpdate: code=Success message=
10:40:00.56453 [System] Resolving TradingTechnologies.TTAPI.Tradebook, Version=7.17.86.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
10:40:00.56453 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.TTAPI.Tradebook.dll'
10:40:00.56553 [System] Loaded TradingTechnologies.TTAPI.Tradebook, Version=7.17.86.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
10:40:00.59552 [Execution] CustomerDefaultsChanged
10:40:00.62151 [Instruments] Lookup instrument: Contract={}
10:40:00.66449 [Instruments] Lookup instrument: Contract={}
10:40:00.66949 [Instruments] InstrumentUpdate: IsFinal=False Error={Message:"The following markets have no Price feeds ready: Eurex" StackTrace:"" HelpLink:"" Source:"" HResult:"-2146233088"} Instrument={null}


Top
 Profile  
 
 Post subject: Re: TT API with XTrader
PostPosted: Mon Jan 13, 2020 10:23 pm 
Offline

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

does the strategy work with another data provider?

I sometimes had luck, when changing the order around of first adding instruments to the strategy and then connecting...

Hope that helps.
Mike


Top
 Profile  
 
 Post subject: Re: TT API with XTrader
PostPosted: Sat Jan 18, 2020 8:36 am 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 236
Hi I figured it out by using thread.sleep for 10 secs just before the startstrategy(). After that everything works normally.


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

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users 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