Option Strategies
Long Iron Condor
Introduction
The Long 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, where B>underlying price |
-1 near-OTM put | C, where C<underlying price |
1 far-OTM put | D, where C−D=A−B |
The long iron condor consists of buying a far OTM call, buying a far OTM put, selling a near ATM call, and selling a near ATM put. This strategy profits from an decrease in price movement (implied volatility) and time decay since ATM options decay sharper.
Implementation
Follow these steps to implement the long 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 long 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 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]
Approach A: Call the OptionStrategies.iron_condor
method with the details of each leg and then pass the result to the buy
method.
iron_condor = OptionStrategies.iron_condor( self._symbol, far_put.strike, near_put.strike, near_call.strike, far_call.strike, expiry) self.buy(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=(CfarT+PfarT−CnearT−PnearT−Cfar0−Pfar0+Cnear0+Pnear0)×m−fee whereCfarT=Far OTM call value at time TCnearT=Near OTM call value at time TPfarT=Far OTM put value at time TPnearT=Near ATM put value at time TST=Underlying asset price at time TKCfar=Far OTM call strike priceKCnear=Near OTM call strike priceKPfar=Far OTM put strike priceKPnear=Near OTM put strike pricePT=Payout total at time TCfar0=Far OTM call value at position opening (credit received)Cnear0=Near OTM call value at position opening (debit paid)Pfar0=Far OTM put value at position opening (credit received)Pnear0=Near OTM put value at position opening (debit paid)m=Contract multiplierT=Time of expirationThe following chart shows the payoff at expiration:

The maximum profit is the net credit received after commission when opening the trade, where KPOTM<ST<KCOTM.
The maximum loss is KCfar−KCnear+Cnear0+Pnear0−Cfar0−Pfar0, where KPOTM>ST or 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.85 | 857.50 |
Far-OTM put | 3.80 | 815.00 |
Near-OTM call | 1.65 | 852.50 |
Near-OTM put | 3.50 | 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+1.65+3.50−1.85−3.80)×100−1×4=−54So, the strategy loses $54.
The following algorithm implements a long iron condor Option strategy:
class LongIronCondorOptionStrategy(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] iron_condor = OptionStrategies.iron_condor( self._symbol, far_put.strike, near_put.strike, near_call.strike, far_call.strike, expiry) self.buy(iron_condor, 2)
Other Examples
For more examples, see the following algorithms: