SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sat Nov 25, 2017 12:43 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Thu Jan 12, 2017 4:17 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 204
Dear Team,

I have a few specific questions regarding the usage of the IB provider:
1.) If I want to change the monitored account from the IB execution provider during live trading, how could I do that? I tried with this:
Code:
var accountDataEntry = AccountDataManager.GetSnapshot(IB.Id, IB.Id);
but then I only get the same account. And I cannot find a way, to change the monitored account.
2.) If I want to change the default allocation account when I am trading live, how can I do that? Or can you direct me in the direction on how I could accomplish, what I tried in OQ2013 like this:
Code:
Order Test = MarketOrder(Instrument,OrderSide.Sell,0)
Test.IB.FaGroup = "All";
TestI.IB.FaProfile = "50all";

But I currenlty cannot see a way to access the provider properties from IB via the order properties.

Thanks for your support.
Mike


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 12:19 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 204
can anybody help with this?


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 1:06 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 386
Hello Mike,
try this solution:
Attachment:
IB_settings.zip [3.56 KiB]
Downloaded 38 times


ps don't forget check the reference for IB library.


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 1:33 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 204
thanks. works like charm and I get the concept.

But I cannot transpose that concept onto my question number 2: how could I cahnge this per Order?

Or would I need to, once I generated the order, attach/assign an instance of a provider to that order?

Any ideas? Can you post some demo code?

thanks in advance
Mike


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 2:02 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 386
2) This feature not implemented in OQ2014.


Top
 Profile  
 
PostPosted: Thu Jan 19, 2017 2:35 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 204
you knew I was going to ask this:
any idea if you will implement it in the future?

If so, any idea for a timeline?

So, basically, you say for every account, I should have an instance of OQ running, until this is implemented, right?


Top
 Profile  
 
PostPosted: Wed Mar 22, 2017 8:27 pm 
Offline

Joined: Tue Oct 13, 2009 12:19 pm
Posts: 204
Dear Team,

now, I tried to apply your concept to a live setup.

I have two IB TWS running. One listens on port: 7496 and the other on port 7495. I have OQ set to the port 7496.

Now, when I try to implement your code in your sample and add:
Code:
 
ib.Port = 7495;
ib.ClientId = 42;
ib.Connect();


at the end. Then I run my strategy, I can see, in the OQ GUI after IB provider connected, that I the changes have been made in the gui, but OQ still connects to the IB TWS port 7496. So the wrong TWS for this strategy.

It seems like, that for the connect, OQ still uses the old settings and not the new settings which I have set programmatically.

Any idea what the reason might be?

Regards
Michael


Top
 Profile  
 
PostPosted: Mon Apr 10, 2017 1:24 pm 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 386
I reproduced your scenario and it works correctly for me.
Both instances of OQ2014 are connected to their TWS:
Attachment:
IBx2.png
IBx2.png [ 269.32 KiB | Viewed 754 times ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 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:  
Powered by phpBB® Forum Software © phpBB Group