Keyboard Shortcuts
ctrl + shift + ? :
Show all keyboard shortcuts
ctrl + g :
Navigate to a group
ctrl + shift + f :
Find
ctrl + / :
Quick actions
esc to dismiss
Likes
Search
reqPositionsMulti does not work as intended
I am having trouble with the C# API requesting positions via reqPositionsMulti with a modelCode. When I query with an empty string I get all open positions, however, when I populate modelCode with a non-empty string that was attached to the modelCode parameter in the Order class when submitting orders then? "positionMulti" does not return anything.?
Is there a special string that returns ALL positions, regardless of which modelCode was used when submitting orders? At this moment neither works.? |
To add, my goal is to tag orders with different modelCodes in order to keep positions apart. For example. If I buy 100 shares of Apple with modelCode "Strategy1" and short 100 shares of Apple with modelCode "Strategy2" my net position in TWS would be 0 but when I request positions I want to see two positions, one for each modelcode with their own averagePrice and positions. But I do not seem to be able to get there....
|
Dojo321 wrote: ".. net position in TWS would be 0 but when I request positions I want to see two positions, .. "
This is not possible with an IB account. Your IB account is a netting account, meaning that only the net result of all trading activities in a ticker symbol is available as position size. IB does not provide a so-called "hedging account", which is what you would need for your purpose. |
So, this pertains to specific model portfolios that were set up in advisor accounts in seems??
How do you then keep positions apart for specific strategies? Does this all have to be handled on the user side? I have written an OMS, would I need to keep my positions apart myself inside the OMS? I was hoping to be able to distinguish positions that pertain to specific strategies similar to orders/fills. I am not looking to create hedge accounts but for example, I often trade baskets that are made up of individual assets and at the same time trade individual assets that make up some of the baskets yet I want to see positions and position pnl in a segregated fashion for the baskets and the individual assets. I can easily manage it on my end but it is harder to synchronize and reconcile with broker positions if I am unable to obtain the average prices of positions that represent a slice of the entire net position in my IB account...? |
The has a field called
toggle quoted message
Show quoted text
that you can use as you wish. The string you set is also carried over to objects´³¨¹°ù²µ±ð²Ô On Tue, Aug 2, 2022 at 09:59 AM, Dojo321 wrote: So, this pertains to specific model portfolios that were set up in advisor accounts in seems?? |
to navigate to use esc to dismiss