Hi,
I'm getting ready to take my algorithm live on an IB portfolio margin account. I've setup a backtest which simulates IB's portfolio margin by setting each security's MarginModel to a custom SecurityMarginModel with estimated initial and maintenance margin requirements.
I'm trying to understand how QC's margin model will behave when trading live.
- Does Portfolio.MarginRemaining get "Excess Liquidity" from IB or by using QC's model?
- If QC's model is in effect when trading live, does that mean that QC will issue margin calls when the broker might not?
- Do the OnMarginCall and OnMarginCallWarning methods trigger when trading live?
- Does OnMarginCall[Warning] trigger when QC's model determines that margin is low?
- Does OnMarginCall[Warning] trigger when the broker determines that margin is low?
- Should I use MarginCallModel.Null when trading live to disable QC's margin model?
- If I'm using MarginCallModel.Null, is there any way for my algorithm to observe IB's "Excess Liquidity"?
- If I'm using MarginCallModel.Null, is there any way for my algorithm to react to margin calls/warnings from IB?
Thanks!
Shile Wen
Hi Mirza,
In live-trading, the brokerage model is set to the brokerage used for live deployment, so any brokerage model/settings in the algorithm will be overridden.
Best,
Shile Wen
Mirza1238u4353
Thanks for that encouraging info! I signed up for a researcher seat with a live node to try it out. I created an algorithm which just gathers stats from my live (non paper) account using SetRuntimeStatistic() / Debug().
I can see that Portfolio.TotalPortfolioValue and Portfolio.TotalHoldingsValue match what I see on IB's site/app.
When I log Portfolio.MarginRemaining, I see a number that doesn't match IB's "Excess Liquidity".
If I use IB's margin calculator to compare Portfolio Margin vs Reg-T Margin, it looks like QuantConnect is actually showing me Reg-T Margin when I query Portfolio.MarginRemaining, even though my IB account is using Portfolio Margin.
Am I using the wrong API or doing something wrong?
Gahl Goziker
Hi Mirza,
Please use the support tab of the IDE to submit the live algorithm logs for support. The full logs will help us diagnose the issue, as it depends heavily on IB and your account.
The Private Support tab is the 5th tab in the IDE’s sidebar. Private support can also be accessed by contacting support@quantconnect.com.
Please see this video for reference on submitting a support request.
Best,
Gahl Goziker
Mirza1238u4353
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!