Hi, I am using the Visual Studio IDE to build some local testing.
I am using Interactive Brokers for paper trading. I am facing the following problem:
As far as I understand, first the Algorithm is initialized, then the engine will connect to the broker. however, in the algorithm initialziation, the 'AddEquity` method tries to load historical data from the broker connection. This will throw NotConnected errors, because the SetupHandler will only connect after the Algorithm has been initialized. Therefore, I will end up in the 60second timeout.
Am i missing something conceptual or doing something wrong? Thank you!
Anne-Mirthe Stam
Basically it is the GetLastKnownPrice method fired by the security seeder that tries to connect to the broker api.
Anne-Mirthe Stam
Looks like adapting the 'BrokerageSetupHandler' works. I have moved the 'connect to brokerage' logic to precede the 'Initializing algorithm' code. All unit tests are fine. Altough my problem might be solved I am unsure whether this will cause other problems. Any ideas?
Anne-Mirthe Stam
Well, apparently it does generate problems, as the OrderProcesor has not been set when swapping the init order. :(
Jared Broad
Thank you for reporting Anne, we're aware of this now and will work on a fix ASAP.
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.
Anne-Mirthe Stam
Thank you Jared. I am curious how this will be solved. :) keep up the good work
Jared Broad
Resolved Anne, thank you. https://github.com/QuantConnect/Lean/pull/723
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.
Anne-Mirthe Stam
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!