Hi All,
I am slowing getting my head around the concepts in LEAN, and I have a question about OptionStrategies. The example shows them being called like so, with self.Sell. self.Sell(OptionStrategies.Straddle(self.option_symbol, atmStraddle.Strike, atmStraddle.Expiry), 2)This (I think) places two market orders for each leg, which seems to work fine. I do however have two questions:
1. Is is possible to call these strategies with a limit order, so I can aim for an order around the midpoint of the spread?
2. Is it possible to call these strategies with a profit-taker type limit order (perhaps a limit/market order?) This would save me having to constantly monitor positions and then place a market order at that point.
Appreciate the help!
Rahul Chowdhury
Hey Daniel,
1. We can create a OptionStrategy that executes using limit orders by changing the OrderType and OrderPrice of the OptionLegs in the strategy.
straddle = OptionStrategies.Straddle(self.option_symbol, strike, expiry) for leg in straddle.OptionLegs: leg.OrderType = OrderType.Limit leg.OrderPrice = ...
2. There isn't any way to automatically create take profits/stop losses using OptionStrategy. Instead, we will need to manually implement a straddle strategy and create take profit/stop loss orders. I've attached an example where we manually trade a straddle with take profits and stop losses, however it uses market orders to enter trades.
Best
Rahul
VamsiG
Following up on this question, my understanding is that the limit price will not be for the straddle as a whole, but we need to figure the limit prices on each of the legs and place an order. Right?
By any chance, do you have in the works the ability place a limit order for a combo.
Derek Melchin
Hi VamsiG,
Yes, we need to figure the limit prices on each of the legs.
Currently orders need to be placed individually. There are no combo orders implemented at the moment. We have plans to work on improving options trading.
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.
Foren Power
Very cool strategy, Rahul Chowdhury!
Question: Is there already an issue open on github for midpoint option combo orders.
Specifically, to trade a vertical spread selling a lower strike option and buying a higher strike for the same expiration it allows one to approximately put a trade in midpoint + (1% cost from midpoint to NAT (rounded up to nearest incriment above midpoint)) appropriate for credit and debit spreads. This provides quick execution and much better fills in my experience. Somehow it only fills if it gets both legs of the trade filled at the near midpoint price. That I do not understand.
Once I bought a deep out of the money ebay call with a market order and instantly lost 25% on execution. So if it isn't an issue may I have help opening it because I'm not sure if my wording is precise enough.
Prior research--I saw the one for combo order buying power calculation and null buying power.
I would be glad to chip in on this project by research, contribute what I can financially, or a cup of tea.
Derek Melchin
Hi Foren,
The BearCallSpread is already implemented in LEAN. This option strategy consists of two calls with the same expiration but different strikes. The strike price of the short call is below the strike of the long call.
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.
Senthil Balachandran
Hi
Is there any updates on this, do we have a way to execute limit order (combo order, not on individual legs) on strategies like BearCallSpread
Ashutosh
Hi @senthil-balachandran Feature to execute combo limit order is available in QuantConnect.I was able to build a simple BearCallSpread strategy using a similar logic implementation provided for ComboMarketOrder IronCondor for index options.Attached is the backtest for reference:
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.
Daniel Rose
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!