Option Strategies

Long Straddle

Introduction

Long Straddle is an options trading strategy involving the going long in both an ATM call and an ATM put option, where both options have the same underlying asset, strike price and expiration date. This strategy aims to profit from volatile movements in the underlying stock, either positive or negative.

The payoff is as follows:

$Payoff_{call}=(Price_{underlying}-Strike)^{+}$

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

$Profit/Loss=(Payoff_{call}+Payoff_{put}-debit\ paid_{call}-debit\ paid_{put})\times multiplier-commissions$

The maximum profit is unlimited, if the underlying price is risen to infinity at expiration.

Maximum loss is the net debit paid when opening the trade, where is underlying price is unchanged and both options become worthless.

Implementation

Follow these steps to implement the long straddle strategy.

  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, 4, 1);
        SetEndDate(2017, 6, 30);
        SetCash(100000);
    
        var option = AddOption("GOOG", Resolution.Minute);
        _symbol = option.Symbol;
        option.SetFilter(universe => universe.Strikes(-5, 5)
                                                .Expiration(TimeSpan.FromDays(30), TimeSpan.FromDays(60)));
    }
    def Initialize(self) -> None:
        self.SetStartDate(2017, 4, 1)
        self.SetEndDate(2017, 6, 30)
        self.SetCash(100000)
        
        option = self.AddOption("GOOG", Resolution.Minute)
        self.symbol = option.Symbol
    
        # set our strike/expiry filter for this option chain
        option.SetFilter(-5, 5, timedelta(30), timedelta(60))
  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;
    
        // sort the optionchain by expiration date and choose the furthest date
        var expiry = chain.OrderBy(x => x.Expiry).Last().Expiry;
    
        // filter the call options from the contracts expires on that date
        var calls = chain.Where(x => x.Expiry == expiry && x.Right == OptionRight.Call);
        if (calls.Count() == 0) return;
    
        // get the contracts according to their strike prices
        var callContract = calls.OrderBy(x => x.Strike).First();
        var putContract = chain.Where(x => x.Expiry == expiry && 
                                            x.Right == OptionRight.Put && 
                                            x.Strike == callContract.Strike)
                                .First();
    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
    
        # sort the optionchain by expiration date and choose the furthest date
        expiry = sorted(chain, key = lambda x: x.Expiry, reverse=True)[0].Expiry
    
        # filter the call options from the contracts expires on that date
        call = [i for i in chain if i.Expiry == expiry and i.Right == 0]
    
        # sort the contracts according to their strike prices
        call_contracts = sorted(call, key = lambda x: x.Strike)
    
        if len(call_contracts) == 0: return
        self.call = call_contracts[0]
    
        for i in chain:
            if i.Expiry == expiry and i.Right == 1 and i.Strike == call_contracts[0].Strike:
                self.put = i
  5. Buy the call option and the put option at the same time and wait until expiration.
  6.     Buy(callContract.Symbol, 1);
        Buy(putContract.Symbol, 1);
    }
    self.Buy(self.call.Symbol, 1)
    self.Buy(self.put.Symbol, 1)

Summary

In this algorithm, we've realised the below payout at expiration (2017-5-18).

ItemsPrice
Price of call$ 28.60
Price of put$ 19.60
Strike price$ 825.00
Price of underlying at expiration$ 934.01
Commission per trade$ 1.00
$Payoff_{call}=(934.01-825.00)^{+}=108.99$

$Payoff_{put}=(825.00-934.01)^{+}=0$

$Payoff_{total}=(108.99+0-28.6-19.6)\times100-1.00\times2=6075$

So, the strategy gains $6075.

Algorithm

Backtest (Using SetFilter)

Backtest (Using OptionChainProvider)

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

Did you find this page helpful?

Contribute to the documentation: