Hi, is there any way for CalculateOrderQuantity or setHolding to take into consideration margin requirements for shorting stocks?
As attached main.py, I'm trying to short AMC stock (or any hard to borrow stocks).
SetCash(100000), self.CalculateOrderQuantity("AMC", -0.9)
marketOrder successful, with 1662 shares x 55USD = 91410 (90% of portfolio)
It backtest succesful. But in reality, the total amount will probably only be 30% of your portfolio (think SetHolding(0.3)) because shorting them requires a Maintenance Margin, in which its requirement could be up to x3 the amount.
In my IBKR paper account, shorting 100 shares of AMC = 5757, Margin required: 5757 * 3 = 17,106
And running live trading will encounter this error
Order rejected - reason:YOUR ORDER IS NOT ACCEPTED. IN ORDER TO OBTAIN THE DESIRED POSITION YOUR EQUITY WITH LOAN VALUE [1154077.00 USD] MUST EXCEED THE INITIAL MARGIN [2877799.82 USD]. Origin: [Id=3] IBPlaceOrder: AMC (STK AMC USD Smart NYSE 0 )
Varad Kabade
Hi Sergey Kolpakov,
For issues with live trading, please contact support@quantconnect.com with the live deployment attached.
Best,
Varad Kabade
ZingerB
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!