Hi everyone. I often get some of my orders rejected due to the initial margin requirement being exceeded, when I try to place many orders at once. Usually, it is by some tiny number. I tried reducing the number of shares on the larger orders or putting position-closing orders first in the queue but that does not seem to help much. I am trying to trade at the market open, or market close. Because I am placing hundreds of orders via an API and I am trying to get filled at an opening, or a closing price, I would rather not break the orders up into position-opening and position-closing batches. Any suggestions for adjustments I can make to get more of my orders accepted would be highly appreciated. Thanks!
In that case would I not only worry about margin requirements, but even more about my spending on commissions. The margin requirement for stocks is usually a percentage of the value. Not much you can change about that, other than reducing the number of shares you buy.
Yeah. That's what I am thinking. I just need to figure out how to adjust and re-submit the orders on the fly via the API.
Suppose the margin percentage is x%. You look up your available cash amount in your account (e.g. z USD). Then you can buy stocks for a total value of z/x. Numerical example: your account has 25 k USD in cash. The margin requirement is 50%. This means that you can buy an additional (25 k USD / 50%) = 50 k USD value of stock.
I hear you. But I don't think this is how IB verifies that the initial margin requirements are met. I have about 20K of excess liquidity in my account and none of the orders I am trying to place exceed a 10K dollar amount, most are much less. I also don't necessarily get rejections on the largest orders. The warning messages I get from the API are of the following form: "Order rejected [blah, blah] Your overnight account balance is 994352.78, while a balance of 995125.37 is required to attain the desired position". Or something like that. All the orders all paper traded, btw. If I break the orders up into position closing and position opening batches, then everything runs fine. But again this is undesirable as I will be trying to submit all orders into an auction when live trading.
Another weird thing I noticed is that sometimes my account Net Liquidity and daily P&L will go up, but excess liquidity will go down. I imagine that this is because I hold some long positions that require 100% maintenance margin, and as the price for those stocks increases, so does the maintenance requirement. I am really not sure about this though.