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
Closing positions
What's the best way to close previous positions when I have new order position sizes calculated by account size? For example, if I enter a position for 1 lot in EURUSD, and (purely hypothetically) that trade doubles the size of the account. My next order position size would be for 2 lots. That makes it difficult to close the first position if all I'm going to do is do an opposite position because the order quantity would change. The help I've received from the api support is to request positions and then do an opposite order based on what comes back. I've never seen that put into code. |
What do you mean by the sentence "enter a position for 1 lot in EURUSD that trade would double the size of the account"? Your account size is measured by the NLV, net liquidation value. That value does not suddenly double if you take on a larger position size.
The way how you have worded your question make me guess that you are familiar with operating a so-called hedging account. That is not how IBKR operates. Your IBKR account is a so-called netting account. This difference makes that you have to look differently at account value, position size, and opening, modifying and closing positions. |
I mean that if I enter a trade for 1 lot and that trade goes so well that it doubles the value of the account. Like if I enter a long position and the value of the eur/usd skyrockets. "Doubling" the account is purely for a hypothetical. It looks like for now, I'll have to manually change the order quantity value as I see fit. |
You don't have to adjust quantities manually. As IBKR support already told you, you can request updates for all relevant information about the account, the positions, and open orders so that your client application can calculate quantities for orders as you see fit. You would probably monitor the value of a position as it increases or decreases, the available margin in the account, the required margin for a given order, the net liquidation value for the account and others. Take a look at:
闯ü谤驳别苍
?
On Fri, Mar 21, 2025 at 03:17 PM, donye wrote:
|
to navigate to use esc to dismiss