In another thread I talked about how borrowing on margin generates interest fees with Interactive Brokers.
I have another question: With LEAN, how would one allocate cash for paying margin interest fees while also simultaneously borrowing on margin? To my knowledge, to borrow on margin, you need to set your trade's leverage above 1.0. However by doing that you leave no room for liquid cash to pay the interest fees.
Any help is greatly appreciated.
Link Liang
Hi Stephen,
Currently we don't support modeling Interest Charged on Margin Loans. Meanwhile, you could try to reserve some liquid cash by manually setting requiredFreeBuyingPowerPercent in BuyingPowerModel. In that way we can avoid insufficient buying power error. I have attached a use case, hope it helps.
Stephen Oehler
Link, thank you so much for the response. I'll look into using that parameter. You said that LEAN doesn't currently account for margin fees in backtesting. In live mode, how often does LEAN sync up "total buying power" from IB to account for charges that LEAN doesn't currently model?
Xin Wei
Hi Stephen,
LEAN resets the cash every day to sync with the IB account.
For more information regarding live trading, please send your question through support tab in QC Terminal. Thank you.
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!