Option Strategies
Short Iron Condor
Introduction
The Short Iron Condor is an Option strategy that consists of four contracts. All the contracts have the same underlying Equity and expiration, but the order of strike prices is A>B>C>D. The following table describes the strike prices of each contract:
Position | Strike |
---|---|
-1 far-OTM call | A |
1 near-OTM call | B,whereB>underlying price |
1 near-OTM put | C,whereC<underlying price |
-1 far-OTM put | D,whereC−D=A−B |
The short iron condor consists of selling a far OTM call, selling a far OTM put, buying a near OTM call, and buying a near OTM put. This strategy profits from a increase in price movement (implied volatility).
Implementation
Follow these steps to implement the short iron condor strategy:
- In the
initialize
method, set the start date, end date, cash, and Option universe. - In the
on_data
method, select the contracts in the strategy legs. - In the
on_data
method, place the orders.
def initialize(self) -> None: self.set_start_date(2017, 2, 1) self.set_end_date(2017, 3, 1) self.set_cash(500000) self.universe_settings.asynchronous = True option = self.add_option("GOOG") self._symbol = option.symbol option.set_filter(lambda universe: universe.include_weeklys().iron_condor(30, 5, 10))
The iron_condor
filter narrows the universe down to just the four contracts you need to form a short iron condor.
def on_data(self, slice: Slice) -> None: if self.portfolio[self._symbol.underlying].invested: self.liquidate() if self.portfolio.invested or not self.is_market_open(self._symbol): return chain = slice.option_chains.get(self._symbol) if not chain: return # Find put and call contracts with the farthest expiry expiry = max([x.expiry for x in chain]) chain = sorted([x for x in chain if x.expiry == expiry], key = lambda x: x.strike) put_contracts = [x for x in chain if x.right == OptionRight.PUT] call_contracts = [x for x in chain if x.right == OptionRight.CALL] if len(call_contracts) < 2 or len(put_contracts) < 2: return # Select the strategy legs far_put = put_contracts[0] near_put = put_contracts[1] near_call = call_contracts[0] far_call = call_contracts[1]
Approach A: Call the OptionStrategies.short_iron_condor
method with the details of each leg and then pass the result to the buy
method.
short_iron_condor = OptionStrategies.short_iron_condor( self._symbol, far_put.strike, near_put.strike, near_call.strike, far_call.strike, expiry) self.buy(short_iron_condor, 2)
Approach B: Create a list of Leg
objects and then call the combo_market_order, combo_limit_order, or combo_leg_limit_order method.
legs = [ Leg.create(far_put.symbol, -1), Leg.create(near_put.symbol, 1), Leg.create(far_call.symbol, -1), Leg.create(near_call.symbol, 1) ] self.combo_market_order(legs, 1)
Strategy Payoff
This is a limited-reward-limited-risk strategy. The payoff is
CfarT=(ST−KCfar)+CnearT=(ST−KCnear)+PfarT=(KPfar−ST)+PnearT=(KPnear−ST)+PT=(CnearT+PnearT−CfarT−PfarT−Cnear0−Pnear0+Cfar0+Pfar0)×m−feeThe following chart shows the payoff at expiration:

The maximum profit is KCfar−KCnear−Cnear0−Pnear0+Cfar0+Pfar0, where KPOTM>ST or ST>KCOTM.
The maximum loss is the net debit paid: Cfar0+Pfar0−Cnear0−Pnear0, where KPOTM<ST<KCOTM.
If the Option is American Option, there is a risk of early assignment on the contracts you sell.
Example
The following table shows the price details of the assets in the algorithm:
Asset | Price ($) | Strike ($) |
---|---|---|
Far-OTM call | 1.05 | 857.50 |
Far-OTM put | 2.15 | 815.00 |
Near-OTM call | 2.75 | 852.50 |
Near-OTM put | 4.80 | 820.00 |
Underlying Equity at expiration | 843.25 | - |
Therefore, the payoff is
CfarT=(ST−KCfar)+=(843.25−857.50)+=0CnearT=(ST−KCnear)+=(843.25−852.50)+=0PfarT=(KPfar−ST)+=(815.00−843.25)+=0PnearT=(KPnear−ST)+=(820.00−843.25)+=0PT=(CnearT+PnearT−CfarT−PfarT−Cnear0−Pnear0+Cfar0+Pfar0)×m−fee=(0+0−0−0−2.75−4.80+1.05+2.15)×100−1×4=−439So, the strategy loses $439.
The following algorithm implements a short iron condor Option strategy:
class ShortIronCondorOptionStrategy(QCAlgorithm): def initialize(self) -> None: self.set_start_date(2017, 4, 1) self.set_end_date(2017, 4, 23) self.set_cash(100000) option = self.add_option("GOOG", Resolution.MINUTE) self._symbol = option.symbol # set our strike/expiry filter for this option chain option.set_filter(lambda x: x.include_weeklys().iron_condor(30, 5, 10)) def on_data(self, slice: Slice) -> None: if self.portfolio.invested or not self.is_market_open(self._symbol): return chain = slice.option_chains.get(self._symbol) if not chain: return # Find put and call contracts with the farthest expiry expiry = max([x.expiry for x in chain]) chain = sorted([x for x in chain if x.expiry == expiry], key = lambda x: x.strike) put_contracts = [x for x in chain if x.right == OptionRight.PUT] call_contracts = [x for x in chain if x.right == OptionRight.CALL] if len(call_contracts) < 2 or len(put_contracts) < 2: return # Select the strategy legs near_call = call_contracts[0] far_call = call_contracts[1] near_put = put_contracts[1] far_put = [x for x in put_contracts if x.Strike == near_put.strike - far_call.strike + near_call.strike][0] short_iron_condor = OptionStrategies.short_iron_condor( self._symbol, far_put.strike, near_put.strike, near_call.strike, far_call.strike, expiry) self.buy(short_iron_condor, 2)