Has this been fixed? Doesn't look like it. If I put in a spread order, put the buy order in first then the sell order and use the option spread order as defined in the documentation it still requires margin as if I had only sold a naked option.
QUANTCONNECT COMMUNITY
Has this been fixed? Doesn't look like it. If I put in a spread order, put the buy order in first then the sell order and use the option spread order as defined in the documentation it still requires margin as if I had only sold a naked option.
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.
Mia Alissi
Hi David! Here’s some important information regarding margin on spread orders in QuantConnect:
1. Entering Spread Legs Individually Shows Naked Margin Requirements
If you're submitting the buy order first for one leg of a spread (for example, the long put), and then the sell order for the other leg (the short put), QuantConnect (and most broker logic) considers the first order independently. For a moment, you hold a naked option, so the margin required is as if you’re short a naked option, not a spread. This is expected with leg-by-leg orders and is not a bug—it's the default margin logic.
2. Margin Advantage Only When Submitting as a Spread
To get spread margin treatment (smaller margin requirement), you must submit the orders as a single spread using the
OptionStrategieshelper tools and thebuymethod, e.g.:This ensures the engine (and brokerage model) recognizes your intention to establish a defined-risk spread and reserves margin accordingly.
3. Documentation and Example
From QuantConnect documentation:
4. If You Leg In, Margin Will Temporarily Be for Naked Positions
If you "leg in" by buying or selling legs separately, QuantConnect will not give you spread margin; you'll be charged margin as if holding the riskiest part alone, until the spread is completed. This is standard, not a QC-specific bug.
To get proper spread margin:
Summary:
If you want reduced margin for a spread, use the spread order API (pass the whole OptionStrategy to
buy, do not leg in). Otherwise, each leg is margined independently.If you're doing this and still seeing naked option margin, let support know with details—otherwise, this behavior is the expected result. Let me know if you want a code example!
Sources: Bull Put Spread - QuantConnect.com, Bear Put Spread - QuantConnect.com, Bull Call Spread - QuantConnect.com, Buying Power - QuantConnect.com, docs writing algorithms securities asset classes equity options requesting data individual contracts
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.
David E
I am putting them in as a spread
David E
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!