We've done some testing and made a few changes to the cash management system. The previous cash management system only updated cash when orders were closed and the profit loss was applied to our account. This is fine with only one leverage value but gets tricky when more FX, equities and our new custom types are thrown together.
We've swapped it out with a new system which instantly updates the cash position when the asset is bought or sold, updating the buying power. This is simpler and gives better representations of the cash position over time. There will be no difference in your backtests results, just your Portfolio.Cash variable. This also means we will rename the "Equity" chart curve to "Portfolio Value" to better reflect that the chart is the Cash+Market-Value-of-Assets(Equity).
During testing we also discovered we need to better handle margin calls. This is especially relevant for shorting ill-liquid assets where its fairly easy to trigger a margin call. We'll be implementing this in the next week to automatically liquidate positions when the cash reserves available are less than X% on a margin. This percentage varies with brokers and stocks so we'll make it a flexible function.
Although its not fun work its making QuantConnect more robust as we march towards live trading! We hope you continue to enjoy QuantConnect.
Jared Broad
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!