If my orders are going to InteractiveBrokers, are the Orders and Portfolio collections:
- Read from IB anytime I go to read them?
- A copy of what is sent to IB, and will diverge from what is actually in IB if there is any miscommunication? Or if I place an order directly in IB on shares first purchased via my app?
- Cached from IB and synced with IB regularly?
- Something else?
thanks - dave
Jared Broad
IB does not permit multiple logins to the same account. If you attempt to login to TWS it will log the algorithm out.
The algorithm models the portfolio of IB fairly accurately. Over the last 6 years, we've fine-tuned the models to be almost perfect. Each day the cash is synchronized at 745am to correct small discrepancies from interest rate charges etc
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.
David Thielen
Hi;
Ok, good to know about no dual logins. When you say cash, I assume you mean cache (although checking as cash does have a legit meaning in your sentence).
thanks - dave
Mak K
Hi Dave,
Not to speak for Jared but I think he meant cash and not cache here. Basing this on “to correct small discrepancies from interest rate charges etc”
Thanks!
David Thielen
Ok, so what if the following occurs:
In this case, won't they now be out of sync as QC will never know that order was executed while IB is confident that QC is aware of it?
Or is this situation handled? For example, when the algo starts up does it ask IB for all recent transactions and then apply any it was unaware of?
??? - thanks - dave
ps - I ask because this was a giant issue in game programming (which I did back in the day) where each client game was using its cached values of what the server was at. You have to do that for performance reasons. And yet, as programmers are imperfect, they would get out of sync.
We had a number of tricks we used to synchronize at times without the user seeing a pause. But in a game we could also allow a divergence between client and server and the worst that happened was units died slower/faster than they should. In investing it's money.
Jared Broad
IB retains the state / is the state-"master" and will restore the state on the next load of the algorithm.
We have dealt with most thread-safety issues over the last 6 years of live trading more than 250,000 user strategies. We cannot answer edge cases like described above in documentation because it's not applicable to most users.
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.
David Thielen
What you list as how it works is a solid approach. (The previous answers had me concerned.) So thank you for answering the question.
- dave
David Thielen
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!