I'm planning to open an account with IB. I talked to them on the phone and they said I need a minimum of $25K to be able to trade frequently (the day trader rule of 4 or more trades in 5 business days). They also mentioned that if your balance falls below $25K the system will stop trading because the account becomes non-day-trader and will keep the open orders until the current orders are settled.
I would like to understand how QC Lean deals with such situations. For instance if your algo makes enough loss that the account falls below $25K what will happen to the rest of the orders that were submitted before that moment? will they go to a queue and wait for the settlement the next (or two) business day(s)? do they just get rejected from execution by Lean? or the algo crashes with a Runtime Error?
Thanks.
Patrick Star
Second question. IB told me that there is a data fee of $4.50 per month for US equity. When I open the IB account should I also add that to the account? or the data is provided by QC?
Alexandre Catarino
First, this behavior is not modelled by InteractiveBrokersBrokerageModel, So, if you want to model it in backtesting, you will have to add the logics. The same logic would be used in live mode to close the positions when balance falls below $25K.
If you don't add the logics to deal with it, when you place a new order under that condition, it will not be accepted by IB and its API will hopefully return an error/warning message that will tell us why. The orders will not go to a queue, They will be marked as Cancelled or Invalid.
QuantConnect provides the datafeed you need. It is included in the prime subscription but you must allow blind trading in your IB settings.
Patrick Star
Wonderful! thanks a lot.
Patrick Star
Another question. Currently my algo is very simple, just adds the security, calculates some signals, and places orders based on the signals (something similar to a moving average). I'm not handling any stops, limits, bid/ask calculations (for now I don't need them). Also I'm not configuring brokerage models. In backtests and QC live demo I'm calculating the trading costs manually through extending SecurityTransactionModel and ISecurityTransactionModel and overriding GetOrderFee.
When I go live with IB, should I remove that line of code to let your engine apply the IB's brokerage model instead? I assume you do that by default when you go live with a broker, right?
Patrick Star
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 QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect 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. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!