Hi
I'm seeing an Insufficient buying power issue. My account is 2x leverage, and total cash is 50k, after bought 48.5k stocks, the remaining margin should be around 50k + 1.5k(remaining cash), right?But the algorithm forbids me to submit a $1.5k buying order, the error is the following:New Order Event: Time: 12/11/2020 15:33:09 OrderID: 20 EventID: 1 Symbol: YALA Status: Invalid Quantity: 71 Message: Order Error: id: 20, Insufficient buying power to complete order (Value:1578.33), Reason: Id: 20, Initial Margin: 1578.33, Free Margin: 1377.3612
account setting:
SetBrokerageModel(BrokerageName.Alpaca, AccountType.Margin);
Please help.Thank you in advance, I appreciate your help.
Derek Melchin
Hi Jeff,
When we purchase securities with a margin account, we spend cash and our margin is automatically scaled down relative to the amount of leverage we have. See the attached backtest and plots for reference. For further assistance, attach a backtest that demonstrates the error.
Best,
Derek Melchin
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.
Jeff Swimming
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!