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

Connecting to TT from OpenQuant
http://www.smartquant.com/forums/viewtopic.php?f=60&t=14865
Page 1 of 1

Author:  zbxxxx [ Wed Oct 24, 2018 9:42 pm ]
Post subject:  Connecting to TT from OpenQuant

Hi, I've successfully managed to get OQ to connect to TT ; able to view DAX through Quote Monitor.
Having difficulty connecting through C# interface as I appear to be missing fields

My code is as follows :

string strategyName = "DAXPROD";

MyStrategy strategy = new MyStrategy(framework, strategyName);

strategy.DataProvider = ProviderManager.GetDataProvider("TT API");
strategy.ExecutionProvider = ProviderManager.GetExecutionProvider("TT API");

Instrument theDAX = InstrumentManager.Instruments["Eurex DAX Dec18"];

Looking at the log file I have :

19:33:27.22855 [System] Resolving TradingTechnologies.TTAPI, Version=7.17.65.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
19:33:27.23050 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.TTAPI.dll'
19:33:27.48752 [System] Loaded TradingTechnologies.TTAPI, Version=7.17.84.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
19:33:27.56352 [System] Dispatcher thread is started
19:33:27.56949 [System] Resolving TradingTechnologies.Logging, Version=7.9.84.0, Culture=neutral, PublicKeyToken=eb3fc33c1c85a812
19:33:27.56949 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.Logging.dll'
19:33:27.57653 [System] Loaded TradingTechnologies.Logging, Version=7.9.84.0, Culture=neutral, PublicKeyToken=eb3fc33c1c85a812
19:33:27.95348 [System] Dispatcher is attached
19:33:27.95750 [System] Creating XTraderModeTTAPI
19:33:27.99448 [System] Resolving TradingTechnologies.TTAPI.Tradebook, Version=7.17.84.0, PublicKeyToken=423079b15fc884a6
19:33:27.99448 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.TTAPI.Tradebook.dll'
19:33:27.99750 [System] Loaded TradingTechnologies.TTAPI.Tradebook, Version=7.17.84.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
19:33:28.01850 [System] Resolving TradingTechnologies.TTAPI, Version=7.17.84.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
19:33:28.01948 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.TTAPI.dll'
19:33:28.01948 [System] Loaded TradingTechnologies.TTAPI, Version=7.17.84.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
19:33:29.30851 [System] XTraderModeTTAPI is initialized successfully
19:33:29.30951 [System] Starting XTraderModeTTAPI
19:33:29.42850 [System] ConnectionStatusUpdate: code=Success message=
19:33:29.43850 [System] Resolving TradingTechnologies.TTAPI.Tradebook, Version=7.17.65.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
19:33:29.43850 [System] Loading 'C:\tt\ttapi\bin\TradingTechnologies.TTAPI.Tradebook.dll'
19:33:29.43950 [System] Loaded TradingTechnologies.TTAPI.Tradebook, Version=7.17.84.0, Culture=neutral, PublicKeyToken=423079b15fc884a6
19:33:29.50450 [Instruments] Lookup instrument: Contract={}
19:33:29.56650 [Instruments] InstrumentUpdate: IsFinal=False Error={Message:"The following markets have no Price feeds ready: Eurex" StackTrace:"" HelpLink:"" Source:"" HResult:"-2146233088"} Instrument={null}

I'm guessing there's a simple fix .. is there any example code I could see ?

Thanks

Author:  azuric [ Thu Oct 25, 2018 1:10 pm ]
Post subject:  Re: Connecting to TT from OpenQuant

Is there any sample code for this?

Author:  zbxxxx [ Thu Oct 25, 2018 2:39 pm ]
Post subject:  Re: Connecting to TT from OpenQuant

My original code for IQFeed is this :

string strategyName = "DAXPROD";

MyStrategy strategy = new MyStrategy(framework, strategyName);

strategy.DataProvider = ProviderManager.GetDataProvider("IQFeed");
strategy.ExecutionProvider = ProviderManager.GetExecutionProvider("ExecutionSimulator");

Instrument theDAX = InstrumentManager.Instruments["XG#"];

which works perfectly .. it's only when I swap over to TT API that things don't work
i.e.

string strategyName = "DAXPROD";

MyStrategy strategy = new MyStrategy(framework, strategyName);

strategy.DataProvider = ProviderManager.GetDataProvider("TT API");
strategy.ExecutionProvider = ProviderManager.GetExecutionProvider("ExecutionSimulator");

Instrument theDAX = InstrumentManager.Instruments["Eurex DAX Dec2018"];

Author:  zbxxxx [ Thu Oct 25, 2018 4:40 pm ]
Post subject:  Re: Connecting to TT from OpenQuant

Fixed ...

You need to wait for connection to occur with DataProvider before continuing on to asking for Instruments etc

while (!strategy.DataProvider.IsConnected)
{
strategy.DataProvider.Connect(1000);
// Console.WriteLine("Trying to Connect");
}

Did think it was a simple enough solution

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