SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Jul 18, 2018 5:20 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Custom provider
PostPosted: Tue May 29, 2018 7:12 pm 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 218
Hi,

I have built a custom provider. How do import and set OQ2014 to use it?

I cant see it in the providers window.


Top
 Profile  
 
 Post subject: Re: Custom provider
PostPosted: Wed May 30, 2018 5:18 am 
Offline

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

if you cannot add it via Tools -> Options - Configuration - Providers

Go into directory %AppData% (copy that into your win explorer) then: ...\AppData\Roaming\SmartQuant Ltd\OpenQuant 2014\config configuration.xml and add your provider in there.

Regards
Mike


Top
 Profile  
 
 Post subject: Re: Custom provider
PostPosted: Wed May 30, 2018 9:22 am 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 218
I have added it to the providers using tools and I can also see it uploaded both there and in the configuration.xml file although strangely the config file says it is not x64 when I built it as x64.

However I still cannot find it in the providers window.

Any ideas.

Btw I was actually wwondering how do you programmatically use a specific provider. Is it as simple as:

strategy.DataProvider = ProviderManager.GetDataProvider(101);
strategy.ExecutionProvider = ProviderManager.GetExecutionProvider(101);


Top
 Profile  
 
 Post subject: Re: Custom provider
PostPosted: Wed May 30, 2018 9:55 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 430
Hello,
provider should implement specific interface to be visible in Providers window:
  • IDataProvider for Market Data
  • IExecutionProvider for Execution
  • IInstrumentProvider for Instrument
  • IHistoricalDataProvider for Historical Data
  • IFundamentalProvider for Fundamental

In case when you didn't implement interfaces (except IProvider), you can get your provider using the following methods:
IProvider provider = ProviderManager.GetProvider(101);
IProvider provider = ProviderManager.GetProvider("providerName");


Top
 Profile  
 
 Post subject: Re: Custom provider
PostPosted: Wed May 30, 2018 6:41 pm 
Offline

Joined: Wed Aug 08, 2007 6:32 pm
Posts: 218
Thanks I managed to get it working fine. Just one question if I want to trade live on that custom provider. How do I programmatically force it use the provider and switch automatically to live mode in scenario?


Top
 Profile  
 
 Post subject: Re: Custom provider
PostPosted: Wed May 30, 2018 9:01 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 233
Switching to either mode in the Scenario can be done with this:
Code:
StrategyManager.Mode = StrategyMode.Live;


and this is how you could add that once you have your strategy setup in your sceanrio:
Code:
strategy = new MyStrategy(framework, "RealTimeTrader");
strategy.ExecutionProvider = ProviderManager.GetExecutionProvider("providerName");
strategy.DataProvider = ProviderManager.GetDataProvider("providerName");



Hope this works for you.
Mike


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 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