Hello all. I'm new to QuantConnect and have been working on a simple mean reversion algorithm. It works well, until I add the line:
self.SetBrokerageModel(BrokerageName.InteractiveBrokersBrokerage, AccountType.Cash)
After this, the status of most of my trades become invalid. There is no error message or explanation for it. Does anyone know why this would be happenning? Thank you!
Link Liang
Hi Justin,
Welcome to QuantConnect! Usually an error message is thrown for an invalid order. If you don't see any explanation in the log, you could add this in your algorithm to log every order event:
Â
def OnOrderEvent(self, orderEvent): Â Â self.Log(orderEvent)
With the information you provided, it's hard to narrow down where the problem could be. I'm guessing the reason of invalid orders is `Insufficient buying power to complete order`. For an IB cash account, "Securities settlement generally takes place on the third business day following the sale transaction." More information is here.
Hope it helps.
Justin Cramer
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!