SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Dec 09, 2019 5:04 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Oct 24, 2018 9:42 pm 
Offline

Joined: Mon Apr 02, 2018 1:39 pm
Posts: 14
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


Top
 Profile  
 
PostPosted: Thu Oct 25, 2018 1:10 pm 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 232
Is there any sample code for this?


Top
 Profile  
 
PostPosted: Thu Oct 25, 2018 2:39 pm 
Offline

Joined: Mon Apr 02, 2018 1:39 pm
Posts: 14
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"];


Top
 Profile  
 
PostPosted: Thu Oct 25, 2018 4:40 pm 
Offline

Joined: Mon Apr 02, 2018 1:39 pm
Posts: 14
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


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