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

TT API with XTrader
http://www.smartquant.com/forums/viewtopic.php?f=86&t=14992
Page 1 of 1

Author:  azuric [ Tue Jan 07, 2020 1:10 pm ]
Post subject:  TT API with XTrader

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()

Author:  azuric [ Tue Jan 07, 2020 1:11 pm ]
Post subject:  Re: TT API with XTrader

TT API does connect and pull data fine for the instruments manually

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

Author:  azuric [ Tue Jan 07, 2020 1:43 pm ]
Post subject:  Re: TT API with XTrader

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}

Author:  mikembb [ Mon Jan 13, 2020 10:23 pm ]
Post subject:  Re: TT API with XTrader

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

Author:  azuric [ Sat Jan 18, 2020 8:36 am ]
Post subject:  Re: TT API with XTrader

Hi I figured it out by using thread.sleep for 10 secs just before the startstrategy(). After that everything works normally.

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