How do i check buying power? And gracefully avoid: Runtime Error
Order Error: id: 81: Insufficient buying power to complete order
QUANTCONNECT COMMUNITY
How do i check buying power? And gracefully avoid: Runtime Error
Order Error: id: 81: Insufficient buying power to complete order
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.
Jared Broad
Portfolio.GetBuyingPower(string symbol, OrderDirection direction = OrderDirection.Hold)
This code is calculated here on GitHub. When you place a trade (synchronous trade) it instantly updates the cash position remaining on your account. The raw buying power for a new asset which you have no holdings would be cash * leverage.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.
Mike Ellertson
public void OnData(TradeBars data) { ... Debug(Time.ToShortDateString() + " Buying Power = " + Portfolio.GetBuyingPower("SPY", OrderDirection.Buy)); ... }
153 | 21:40:40: Build Error: File: Main.cs Line:48 Column:68 - 'SecurityPortfolioManager' does not contain a definition for 'GetBuyingPower' and no extension method 'GetBuyingPower' accepting a first argument of type 'SecurityPortfolioManager' could be found (are you missing a using directive or an assembly reference?)JoshuaGardner
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!