Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
One Problem with Interactive Brokers

Hi Everyone,

I have one problem with Interactive Brokers... Since I am a student and does not have a full time job, I cannot open Margin Account. So, basically, I can only do long positions on US equities.... This is all well and fine, since I am currently only interested in doing long strategies to minimize the risks...

The main problem with Interactive Brokers is that it takes up to three days to settle the cash after you sells the stock.
Let's say you have 2000 $ in your account and bought 2000 $ worth of MSFT.... And, you liquidate all your positions 2100 $ some time later...... The problem is that you can't use that 2100 $ to buy other stocks, including MSFT, right away... you have to wait about 3 days to finish the transaction... Only then, you can use that money. As you can imagine, that is a great limitation.... Basically, you have to come up with strategies that is not too frequent if you want to use a significant part of your cash.....

I tried to talk about it with IB customer service and did not get anywhere..... I understand it is not a problem of Quantopian.... But, I was wondering if Quantopian is in a better position to make a deal with Interactive Brokers to either speed up transaction or be able to use IB money's of equal amount while waiting to finish the transaction....

Any suggestion would be appreciated !

17 responses

Since the settlement is T+3, wouldn't that always be the issue if you do not have a margin account? So you want Quantopian to give you credit?

I am pretty sure that this problem applies to all brokerages, not just to Interactive Brokers.

If you want to be placing trades that frequently and not holding enough cash in reserve to get you through the settlement period, then you really do need a margin account, regardless of which broker you're using and whether you're trading algorithmically or manually.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Some T+3 reading

If my algo tries to buy within that period, funds not yet available, what would happen?

If the funds are not yet available, the order will get rejected by IB and will appear as such in the live trading dashboard. You can also see the high-level rejection message passed along from IB.

Disclaimer

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances.

Hi, Nyan. The real problem is Quantopian needs to collaborate with other brokers like TD, ThinkorSwim, Suretrader etc... Interactive Brokers requires 10K to open an account, not to many people have 10 grand sitting around to trade.

Hi,

It is true that Quantopian should work with other brokers too. That would be terrific. IB does require 10K to open account. IB used to have an option to open an account with a lot less than 10K for someone younger than 25. I don't remember if the exact amount, but I think it is 3000 $ . I am not sure if they still do that. My primary objective of this post is to raise awareness about the limitation of the cash account in IB and consider that limitation while coding their strategies here.

By the way, could there be a problem with IB if the order is rejected too many times because the transaction is not settled yet ( and there is not enough cash. )

When doing live trading on Quantiopian with IB, does the cash balance in the portfolio object reflect IB's actual cash availability (i.e. settled transactions) or is it optimistically including unsettled transactions?

As others have said, T+3 will limit you whenever you trade with any broker or even directly. It just takes that long to transfer the funds. However, this also means it takes T+3 to transfer the cash from your account to the other person's. Basically, if you sell a stock on day 1, you will get that money for the sale on day 4. However, if you buy a stock on day 2, you will need the money to buy that stock on day 5. So, you get the money on day 4 and use it on day 5. All transactions are just delayed for 3 days unless it's faster (which won't happen unless you have the funds there to begin with). This is how day trading works - see this forum question Look at jono1887's response and fzbkk's third post.

So, now I know for a fact that Interactive Brokers reports the pre-settlement balance, rather than the post-settlement balance. As a result, Quantopian has attempted to place multiple orders today which could not be filled because I did not have sufficient settled cash.

Is there any way that Quantopian could be configured to get the settled cash balance rather than IB's "total cash" value? I can't see any way to reasonably get this data from within my algorithm, and having this disparity actually causes problems for my algorithm (and could cause problems with IB as well), which is rather unfortunate.

So, for example, today I generated a WHOLE BUNCH of rejected trades. This isn't good.

I am told that for IRA accounts (for which margin is against the law) Interactive Brokers by default places this T+3 restriction but allows you to override it and use T+0 after jumping through a few hoops. I would be surprised if the same does not apply to your situation. BTW, I use IB and have found that it is common for reps to give incorrect answers. You may need to ask a different rep.

I'm actually a little surprised by this as even though I am a relatively new investor, I know my e-trade account allows me to use unsettled funds immediately as long as I have enough in my account (not including the amount made by the sale) to cover the amount I'm trying to buy. The only stipulation is I can't sell those newly purchased stocks until the funds have settled "officially." I'm not sure if that's an uncommon situation among brokers or if IB is the outlier in their stance.

Holding safe cash is probably part of any diversified portfolio and making large trades (say over 30% of your account balance) probably not part of a good trading strategy, so if you simply held, say, 30% of your total in cash and scattered your trades over time, wouldn't that solve your problem?

Having cash holdings makes sense, but IB is sort of a sandboxed account specifically for algorithmic stock trading and not necessarily for "safe" investing. I keep my cash holdings in other accounts that are intended for cash holdings.

I certainly wouldn't put my entire life savings into IB to be managed by Quantopian, nor do I even keep a significant portion of my stock there. This is an experiment, and I'm never putting up more money than I'm willing to lose. YMMV, of course.

Cash holdings are a safety net against bad trades, and not a trading strategy on their own.

Also, even maintaining a cash buffer doesn't help my particular algorithm; on one day it might decide to dump all holdings, and then repurchase an entirely different set of holdings. And it might do this on a daily basis. The only way to do this in a way that works with T+3 settlement is to only allow 25% of the holdings to ever be turned into stock at any given time, which is grossly inefficient.

J. this is a pretty common problem to run into, if you do not already have a margin account, it will alleviate a lot of the liquidity issues you're having, but not all of them. I've had this happen a few times as well, the message from IB is that you will either need to deposit more money, or hedge your positions. IB doesn't do margin calls, they just reject orders; this is good because you won't be in violation of any regulations, but it's bad if only one leg of a multi-leg strategy executes and leaves you over-exposed. I highly suggest the margin account to simplify your problem, it's way harder to code in all the T+3 stuff.

Yeah, I'm planning on adding a margin account at some point. It'd still be nice if the portfolio object reported available cash separately from expected cash value, though.