SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Oct 20, 2020 10:37 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Dec 26, 2007 6:06 pm 
Offline

Joined: Thu May 03, 2007 4:08 pm
Posts: 92
Hi,

I am wondering if it is possible to close position with limit orders. Thank you.

Best regards,
yheumd


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 26, 2007 8:17 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
Hi,

what do you mean exactly? You can send an opposite limit order (with Position.Qty) indeed but I am not sure this is what you want to do.

Regards,
Anton


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 1:24 am 
Offline

Joined: Thu May 03, 2007 4:08 pm
Posts: 92
Hi, Anton:

Thanks.

We need it for closing positions in IB advisor account. We use NetLiq as the allocation method to allocate shares to different subaccount. However, since NetLiq is changing, sometimes we ended up with zero position in master account, but one share long in one subaccount and one share short in the other subaccount, when we meant to close both subaccounts. To solve this problem, we need to use "close position" command in IB. Currently, OpenQuant only have close position command for market order, which would not be ideal when the current price is not the target price we desired. So, we would like OpenQuant to have a close position command with limit order. Ideally, we hope we can also specify the account info when we send such order.

In addition, could you also add a method to inquire the broker (IB) for holding shares of a particular instrument?

Thank you very much.
Best regards,
yheumd


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 27, 2007 1:23 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
Hi,

here is an example on IB FA accounts

http://www.smartquant.com/forums/viewto ... 7288#17288

ClosePosition method simply sends an opposite market order with Position.Qty. Why don't you reaplce it with your own code, something like

if (HasPosition)
SellLimit(Position.Qty, price);

?

Regards,
Anton


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