开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Re: How do I find out the margin requirements for a US stock through the TWS API?


 

Well, it sounds very anti-intuitive that one cannot determine if a trade will go through by using data available at the time of entering a trade - but has to 'reverse engineer' by issuing 'what if' trades and seeing their result. Is this really the case?

On Sat, Nov 2, 2024 at 6:35?PM 闯ü谤驳别苍 Reinold via <TwsApiOnGroupsIo=[email protected]> wrote:

@rossh_yh?
I assume you wanted to suggest the flag as described in the "" or ""
?
@?kos Maróy

The margin information you are asking for is very generic and probably identical for all STK instruments on large exchanges in the US. That information is not available through TWS API and has only marginal value.

The actual margin required for a trade is much more nuanced and depends on the risk your account and positions pose at the time of trade. Factors include the account type (cash, margin, IRA, ...), the combination of positions currently in the account, and the overall market situation. In fact, under certain situations, account margin requirements may be reduced when you add a position that reduces the overall risk. And, consequently, required margin increases when you close it.

With TWS API you can monitor the various current account level margin requirements in real time by subscribing to . The actual margin impact for any given order can be checked, as rossh_yh? pointed out, by placing that order with the WhatIf flag set to true.

You may want to search the group's archive since we had several discussion about this.

闯ü谤驳别苍

?
?
?
On Sat, Nov 2, 2024 at 11:04 AM, rossh_yh wrote:
Place the order with the Verify param set.

Join [email protected] to automatically receive all group messages.