Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Help with live trading - Quantopian and IB platform

Hi,

I am entering into an agreement with a fund who is interested in live trading my algorithm in the contest on a trial basis. Ideally fund wants me to trade on IB platform but I am going to request them to trade using Quantopian integrated with IB platform. The idea is that they will give me a sub account and I will trade minimum capital for 2 months. I have a few questions and hoping that someone with experience in live trading on Q can guide me.

  1. Leverage: Contest allows 3x leverage. I am using 2.8x leverage. How will this work in live trading? Does it require a special type of IB account?
  2. Settlement: Can I use sale proceeds to trade immediately or should I wait until settlement? I don't have to manage this in contest.
  3. If I stop the algorithm on Q platform, can I close my positions using IB platform without going through Q?
  4. What are the commissions charged by Q platform?

If there are any other complexities in live trading please advise me so that I can propose this approach to the fund.

Best regards,
Pravin

6 responses

Pravin,

Congrats on the interest in your algorithm! We've developed a "go live" process for preparing contest winners and algorithms receiving allocations. I'll ask Alisa to follow up with you and share what we have learned.

I also strongly encourage you to review your algorithm using the tearsheet showcased here: https://www.quantopian.com/posts/tearsheet-analysis-of-algo-performance-in-our-research-envirionment

Please let all of us in the community know how things go!

thanks,
fawce

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.

I have only done IB paper trading so far, but I will do my best to answer your questions:

  1. No, regular day-trading accounts ($25k) are limited by Reg-T leverage, which is 2x for overnight positions (though 4x intraday). However, depending on what you are trading, you might be able to take advantage of a "portfolio margin" account. This requires, I believe, $100k, as well as that you are a US resident, and doesn't apply to many ETFs, especially leveraged ETFs. In any case, if you are trading a hedged portfolio, then portfolio margin might get you up to 3x, or higher.
  2. If it's a margin account, you needn't worry about settlement at all.
  3. Yes, the positions will still be there and you will be able to see them in TWS. In fact, if you set up two user ids for the same account, you can allegedly monitor the portfolio in real-time with one user id while the other user id is used by Quantopian to log in. (this is not possible with paper trading accounts)
  4. I don't think Quantopian charges anything at the moment, all you have to worry about are the Interactive Brokers commissions, which depend on the type of account you have (flat, cost-plus, tiered).

Good luck, sounds exciting!

Simon.

Hi Pravin,

That's exciting to hear about your progress, congratulations! I'll piggy-back off Fawce and Simon's answers to share some more details.

  • Before you go live, run your algorithm through the tearsheet to confirm your algorithm's meta behavior
  • Check your code for robustness and follow these coding tips
  • With every real money account, IB provides a paper account. You can test your strategy on paper before connecting it to the money account. Here is a 3 minute overview of how to setup live trading.
  • Keep in mind that IB only allows one connection per account. If you login to WebTrader/TWS while your algo is running on Quantopian, your algo will get paused and no trades will go through. If you want to simultaneously have your algo run on Q and view your IB account info, you'll need to create a second login (which is free, and pretty straightforward).
  • Algorithms running on Quantopian need USD as the base currency. The funding currency can be anything you wish.
  • Take a look at the live trading help doc for other details about the API and structure.

As for your questions,

  1. The leverage settings are set by IB on the account, they are not controlled by Quantopian. And it looks like Simon covered the specifics
  2. It depends on the type of account, and margin accounts let you trade immediately without waiting for settlement
  3. When an algorithm is stopped on Quantopian, this prevents any future calls to the code. Handle_data() is not called anymore. This does not cancel open orders or liquidate your positions, but these actions can be done directly from your IB account.
  4. Quantopian doesn't charge any commissions for live trading! The only commissions are those from the broker.

Best of luck and let us know how things go!

Alisa

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.

Thanks Fawce, Simon and Alisa for the detailed explanation. Its great that Quantopian doesn't charge any commissions for live trading!

Hi Pravin,

Keep in mind that the Q backtester and simulated trading do not properly account for open orders being cancelled at market close (automatically, by Q). So, you'll want to consider if this might result in problems as you move to trading through IB, using the Q platform.

Also, I suggest considering if you have any personal liability, since it sounds like you'll be trading somebody else's money. If the money suddenly goes "poof" could you be sued, with your personal assets put at risk? If you haven't already, it wouldn't hurt to have a knowledgeable lawyer take a look at the agreement between you and the fund. Also, maybe there are regulatory issues to consider, when directly trading someone else's money?

Grant

Hi Grant,

Thanks for the advice. I will definitely have a knowledgeable lawyer look through the paper work. I think its worth it.

Best regards,
Pravin