Quick question: how robust is LEAN in its ability to track settled cash/margin and fill orders if the user occasionally deposits or withdraws cash, or conducts trades, in the live trading account manually, assuming he or she does so while the algo is expected to be dormant during a particular time of the day?
Specifically, I'm wondering if the user retains the ability to do the following while an algo is live trading on an account:
-can he manually liquidate a bad position
-can he manually withdraw cash occasionally to pay for taxes on gains, or secure some gains he has made, etc.
-can he manually deposit additional funds to bolster buying power
Thanks!
Jared Broad
Officially its not something LEAN supports -- manually interfering at all changes the state of the brokerage account and can send your algorithm into a tail spin. When we detect there has been manual intervention we actually kill the algorithm ASAP. For manual trading -- we provide a manual trading interface in our live environment. So if you need to cancel an order can do it "through your algorithm" which will maintain your code state. Manually adding/removing cash is harder to do as not all brokerages provide good (cash event) API's in the case of changes. Where possible we try to synchronize the brokerage cash-algorithm state once a day at midnight. This was designed to handle small differences (e.g. small unexpected fees).
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.
Stephen Oehler
Ok thanks for the heads-up Jared; good to know there is a manual trading interface for safety's sake.
Stephen Oehler
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!