# Option Strategies

### Introduction

Put calendar spread, which also known as put horizontal spread, is a combination of a longer-term (far-leg/front-month) put and a shorter-term (near-leg/back-month) put, where all puts have the same underlying stock and the same strike price.

It consists of buying a longer-term put and selling a shorter-term put. It is a option strategy profitting from an decrease in price movement, as well as time decay value. It is because the theta $\theta$ (the option price decay by 1 day closer to maturity) of shorter-term put is larger than longer-term.

This is a limited-reward-limited-risk strategy. The payoff is taken at the shorter-term expiration. The payoff is as follows:

$Payoff_{shorter\ term\ put}=(Strike-Price_{underlying})^{+}$

$Profit/Loss^{t}=(Price^{t}_{longer\ term\ put}-Payoff_{shorter\ term\ put}+credit\ received_{shorter\ term\ put}-debit\ paid_{longer\ term\ put})\times multiplier-commissions$

where $t$ is the expiration of shorter-term put

The maximum profit is undetermined as a dependent of volatility but limited, where the underlying price stays the same as the trade opened and the spread of the puts are at maximum.

Maximum loss is the net debit paid after commission when opening the trade, where the underlying price moves very deep ITM or OTM so the spread of both puts close to zero.

If the option is American option, there will be a risk of early assignment on the shorted option. Naked longed put would pose risk of losing all debit paid if its position is not closed with shorted put together and the price dropped below its strike.

#### Short Put Butterfly

It consists of selling a longer-term put and buying a shorter-term put. It is a option strategy profitting from an increase in price movement.

The payoff is taken at the shorter-term expiration. This is a limited-reward-limited-risk strategy. The payoff is as follows:

$Profit/Loss^{t}=(Payoff_{shorter\ term\ put}-Price^{t}_{longer\ term\ put}+credit\ received_{longer\ term\ put}-debit\ paid_{shorter\ term\ put})\times multiplier-commissions$

where $t$ is the expiration of shorter-term put

The maximum profit is the net credit received after commission when opening the trade, where the underlying price moves very deep ITM or OTM so the spread of both puts close to zero.

Maximum loss is undetermined as a dependent of volatility but limited, where the underlying price is at the same level when the trade opened and the spread of the 2 puts are at its maximum.

If the option is American option, there will be a risk of early assignment on the shorted option. Also, if the put positions are not closed together, the naked shorted put will have unlimited drawdown risk after the longed put expires.

### Implementation

1. In the Initialize method, set the start date, end date, cash, and Option universe.
2. private Symbol _symbol;

public override void Initialize()
{
SetStartDate(2017, 2, 1);
SetEndDate(2017, 2, 19);
SetCash(500000);

_symbol = option.Symbol;
option.SetFilter(universe => universe.IncludeWeeklys()
.Strikes(-1, 1)
.Expiration(TimeSpan.FromDays(0), TimeSpan.FromDays(62)));
}
def Initialize(self) -> None:
self.SetStartDate(2017, 2, 1)
self.SetEndDate(2017, 2, 19)
self.SetCash(500000)

self.symbol = option.Symbol
option.SetFilter(self.UniverseFunc)

def UniverseFunc(self, universe: OptionFilterUniverse) -> OptionFilterUniverse:
return universe.Strikes(-1, 1).Expiration(timedelta(0), timedelta(62))
3. In the OnData method, select the Option contracts.
4. public override void OnData(Slice slice)
{
if (Portfolio.Invested) return;

// Get the OptionChain of the symbol
var chain = slice.OptionChains.get(_symbol, null);
if (chain == null || chain.Count() == 0) return;

// get at-the-money strike
var atmStrike = chain.OrderBy(x => Math.Abs(x.Strike - chain.Underlying.Price)).First().Strike;

// filter the put options from the contracts which is ATM in the option chain.
var puts = chain.Where(x => x.Strike == atmStrike && x.Right == OptionRight.Put);
if (puts.Count() == 0) return;

// sorted the optionchain by expiration date
var expiries = puts.Select(x => x.Expiry).OrderBy(x => x);

// select the farest expiry as far-leg expiry, and the nearest expiry as near-leg expiry
var nearExpiry = expiries.First();
var farExpiry = expiries.Last();
def OnData(self, slice: Slice) -> None:
# avoid extra orders
if self.Portfolio.Invested: return

# Get the OptionChain of the self.symbol
chain = slice.OptionChains.get(self.symbol, None)
if not chain: return

# get at-the-money strike
atm_strike = sorted(chain, key=lambda x: abs(x.Strike - chain.Underlying.Price))[0].Strike

# filter the put options from the contracts which is ATM in the option chain.
puts = [i for i in chain if i.Strike == atm_strike and i.Right == OptionRight.Put]
if len(puts) == 0: return

# sorted the optionchain by expiration date
expiries = sorted([x.Expiry for x in puts], key = lambda x: x)

# select the farest expiry as far-leg expiry, and the nearest expiry as near-leg expiry
near_expiry = expiries[0]
far_expiry = expiries[-1]
5. In the OnData method, call the OptionStrategies.PutCalendarSpread method and then submit the order.
6.     var optionStrategy = OptionStrategies.PutCalendarSpread(_symbol, atmStrike, nearExpiry, farExpiry);
// We open a position with 1 unit of the option strategy
Sell(optionStrategy, 1);   // if short put calendar spread
}
option_strategy = OptionStrategies.PutCalendarSpread(self.symbol, atm_strike, near_expiry, far_expiry)
# We open a position with 1 unit of the option strategy
self.Sell(option_strategy, 1)   # if short put calendar spread

### Summary

In this algorithm, we've realised the below payout at shorter-term put's expiration (2022-2-19).

ItemsPrice
Price of longer-term put$19.30 Price of shorter-term put$ 11.30
Strike of puts$800.00 Price of longer-term put at shorter-term expiration$ 3.50
Price of underlying at shorter-term expiration$828.07 Commission per trade$ 1.00
$Payoff_{shorter\ term\ put}=(800.00-828.07)^{+}=0$

$Payoff_{total}=(3.50-0+11.30-19.30)\times100-1.00\times2=-452$

So, the strategy losses \$452.

### Algorithm

You can also see our Videos. You can also get in touch with us via Discord.