Lean  $LEAN_TAG$
QuantConnect.Securities.Option.OptionStrategies Class Reference

Provides methods for creating popular OptionStrategy instances. These strategies can be directly bought and sold via: QCAlgorithm.Buy(OptionStrategy strategy, int quantity) QCAlgorithm.Sell(OptionStrategy strategy, int quantity) More...

Static Public Member Functions

static OptionStrategy CoveredCall (Symbol canonicalOption, decimal strike, DateTime expiration)
 Creates a Covered Call strategy that consists of selling one call contract and buying 1 lot of the underlying. More...
 
static OptionStrategy ProtectiveCall (Symbol canonicalOption, decimal strike, DateTime expiration)
 Creates a Protective Call strategy that consists of buying one call contract and selling 1 lot of the underlying. More...
 
static OptionStrategy CoveredPut (Symbol canonicalOption, decimal strike, DateTime expiration)
 Creates a Covered Put strategy that consists of selling 1 put contract and 1 lot of the underlying. More...
 
static OptionStrategy ProtectivePut (Symbol canonicalOption, decimal strike, DateTime expiration)
 Creates a Protective Put strategy that consists of buying 1 put contract and 1 lot of the underlying. More...
 
static OptionStrategy NakedCall (Symbol canonicalOption, decimal strike, DateTime expiration)
 Creates a Naked Call strategy that consists of selling 1 call contract. More...
 
static OptionStrategy NakedPut (Symbol canonicalOption, decimal strike, DateTime expiration)
 Creates a Naked Put strategy that consists of selling 1 put contract. More...
 
static OptionStrategy BearCallSpread (Symbol canonicalOption, decimal leg1Strike, decimal leg2Strike, DateTime expiration)
 Method creates new Bear Call Spread strategy, that 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. This is a credit spread. More...
 
static OptionStrategy BearPutSpread (Symbol canonicalOption, decimal leg1Strike, decimal leg2Strike, DateTime expiration)
 Method creates new Bear Put Spread strategy, that consists of two puts with the same expiration but different strikes. The strike price of the short put is below the strike of the long put. This is a debit spread. More...
 
static OptionStrategy BullCallSpread (Symbol canonicalOption, decimal leg1Strike, decimal leg2Strike, DateTime expiration)
 Method creates new Bull Call Spread strategy, that consists of two calls with the same expiration but different strikes. The strike price of the short call is higher than the strike of the long call. This is a debit spread. More...
 
static OptionStrategy BullPutSpread (Symbol canonicalOption, decimal leg1Strike, decimal leg2Strike, DateTime expiration)
 Method creates new Bull Put Spread strategy, that consists of two puts with the same expiration but different strikes. The strike price of the short put is above the strike of the long put. This is a credit spread. More...
 
static OptionStrategy Straddle (Symbol canonicalOption, decimal strike, DateTime expiration)
 Method creates new Straddle strategy, that is a combination of buying a call and buying a put, both with the same strike price and expiration. More...
 
static OptionStrategy ShortStraddle (Symbol canonicalOption, decimal strike, DateTime expiration)
 Creates a Short Straddle strategy that consists of selling a call and a put, both with the same strike price and expiration. More...
 
static OptionStrategy Strangle (Symbol canonicalOption, decimal callLegStrike, decimal putLegStrike, DateTime expiration)
 Method creates new Strangle strategy, that buying a call option and a put option with the same expiration date The strike price of the call is above the strike of the put. More...
 
static OptionStrategy ShortStrangle (Symbol canonicalOption, decimal callLegStrike, decimal putLegStrike, DateTime expiration)
 Creates a Short Strangle strategy that consists of selling a call and a put, with the same expiration date and the call strike being above the put strike. More...
 
static OptionStrategy CallButterfly (Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike, DateTime expiration)
 Method creates new Call Butterfly strategy, that consists of two short calls at a middle strike, and one long call each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike. More...
 
static OptionStrategy ButterflyCall (Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike, DateTime expiration)
 Creates a new Butterfly Call strategy that consists of two short calls at a middle strike, and one long call each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike. More...
 
static OptionStrategy ShortButterflyCall (Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike, DateTime expiration)
 Creates a new Butterfly Call strategy that consists of two long calls at a middle strike, and one short call each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike. More...
 
static OptionStrategy PutButterfly (Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike, DateTime expiration)
 Method creates new Put Butterfly strategy, that consists of two short puts at a middle strike, and one long put each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike. More...
 
static OptionStrategy ButterflyPut (Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike, DateTime expiration)
 Creates a new Butterfly Put strategy that consists of two short puts at a middle strike, and one long put each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike. More...
 
static OptionStrategy ShortButterflyPut (Symbol canonicalOption, decimal higherStrike, decimal middleStrike, decimal lowerStrike, DateTime expiration)
 Creates a new Butterfly Put strategy that consists of two long puts at a middle strike, and one short put each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike. More...
 
static OptionStrategy CallCalendarSpread (Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)
 Creates new Call Calendar Spread strategy which consists of a short and a long call with the same strikes but with the long call having a further expiration date. More...
 
static OptionStrategy ShortCallCalendarSpread (Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)
 Creates new Short Call Calendar Spread strategy which consists of a short and a long call with the same strikes but with the short call having a further expiration date. More...
 
static OptionStrategy PutCalendarSpread (Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)
 Creates new Put Calendar Spread strategy which consists of a short and a long put with the same strikes but with the long put having a further expiration date. More...
 
static OptionStrategy ShortPutCalendarSpread (Symbol canonicalOption, decimal strike, DateTime nearExpiration, DateTime farExpiration)
 Creates new Short Put Calendar Spread strategy which consists of a short and a long put with the same strikes but with the short put having a further expiration date. More...
 
static OptionStrategy IronCondor (Symbol canonicalOption, decimal longPutStrike, decimal shortPutStrike, decimal shortCallStrike, decimal longCallStrike, DateTime expiration)
 Creates a new Iron Condor strategy which consists of a long put, a short put, a short call and a long option, all with the same expiration date and with increasing strikes prices in the mentioned order. More...
 

Detailed Description

Provides methods for creating popular OptionStrategy instances. These strategies can be directly bought and sold via: QCAlgorithm.Buy(OptionStrategy strategy, int quantity) QCAlgorithm.Sell(OptionStrategy strategy, int quantity)

See also OptionStrategyDefinitions

Definition at line 31 of file OptionStrategies.cs.

Member Function Documentation

◆ CoveredCall()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.CoveredCall ( Symbol  canonicalOption,
decimal  strike,
DateTime  expiration 
)
static

Creates a Covered Call strategy that consists of selling one call contract and buying 1 lot of the underlying.

Parameters
canonicalOptionOption symbol
strikeThe strike price for the call option contract
expirationThe expiration date for the call option contract
Returns
Option strategy specification

Definition at line 45 of file OptionStrategies.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProtectiveCall()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ProtectiveCall ( Symbol  canonicalOption,
decimal  strike,
DateTime  expiration 
)
static

Creates a Protective Call strategy that consists of buying one call contract and selling 1 lot of the underlying.

Parameters
canonicalOptionOption symbol
strikeThe strike price for the call option contract
expirationThe expiration date for the call option contract
Returns
Option strategy specification

Definition at line 82 of file OptionStrategies.cs.

Here is the call graph for this function:

◆ CoveredPut()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.CoveredPut ( Symbol  canonicalOption,
decimal  strike,
DateTime  expiration 
)
static

Creates a Covered Put strategy that consists of selling 1 put contract and 1 lot of the underlying.

Parameters
canonicalOptionOption symbol
strikeThe strike price for the put option contract
expirationThe expiration date for the put option contract
Returns
Option strategy specification

Definition at line 95 of file OptionStrategies.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ProtectivePut()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ProtectivePut ( Symbol  canonicalOption,
decimal  strike,
DateTime  expiration 
)
static

Creates a Protective Put strategy that consists of buying 1 put contract and 1 lot of the underlying.

Parameters
canonicalOptionOption symbol
strikeThe strike price for the put option contract
expirationThe expiration date for the put option contract
Returns
Option strategy specification

Definition at line 132 of file OptionStrategies.cs.

Here is the call graph for this function:

◆ NakedCall()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.NakedCall ( Symbol  canonicalOption,
decimal  strike,
DateTime  expiration 
)
static

Creates a Naked Call strategy that consists of selling 1 call contract.

Parameters
canonicalOptionOption symbol
strikeThe strike price for the call option contract
expirationThe expiration date for the call option contract
Returns
Option strategy specification

Definition at line 145 of file OptionStrategies.cs.

◆ NakedPut()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.NakedPut ( Symbol  canonicalOption,
decimal  strike,
DateTime  expiration 
)
static

Creates a Naked Put strategy that consists of selling 1 put contract.

Parameters
canonicalOptionOption symbol
strikeThe strike price for the put option contract
expirationThe expiration date for the put option contract
Returns
Option strategy specification

Definition at line 172 of file OptionStrategies.cs.

◆ BearCallSpread()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.BearCallSpread ( Symbol  canonicalOption,
decimal  leg1Strike,
decimal  leg2Strike,
DateTime  expiration 
)
static

Method creates new Bear Call Spread strategy, that 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. This is a credit spread.

Parameters
canonicalOptionOption symbol
leg1StrikeThe strike price of the short call
leg2StrikeThe strike price of the long call
expirationOption expiration date
Returns
Option strategy specification

Definition at line 201 of file OptionStrategies.cs.

◆ BearPutSpread()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.BearPutSpread ( Symbol  canonicalOption,
decimal  leg1Strike,
decimal  leg2Strike,
DateTime  expiration 
)
static

Method creates new Bear Put Spread strategy, that consists of two puts with the same expiration but different strikes. The strike price of the short put is below the strike of the long put. This is a debit spread.

Parameters
canonicalOptionOption symbol
leg1StrikeThe strike price of the long put
leg2StrikeThe strike price of the short put
expirationOption expiration date
Returns
Option strategy specification

Definition at line 244 of file OptionStrategies.cs.

◆ BullCallSpread()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.BullCallSpread ( Symbol  canonicalOption,
decimal  leg1Strike,
decimal  leg2Strike,
DateTime  expiration 
)
static

Method creates new Bull Call Spread strategy, that consists of two calls with the same expiration but different strikes. The strike price of the short call is higher than the strike of the long call. This is a debit spread.

Parameters
canonicalOptionOption symbol
leg1StrikeThe strike price of the long call
leg2StrikeThe strike price of the short call
expirationOption expiration date
Returns
Option strategy specification

Definition at line 288 of file OptionStrategies.cs.

◆ BullPutSpread()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.BullPutSpread ( Symbol  canonicalOption,
decimal  leg1Strike,
decimal  leg2Strike,
DateTime  expiration 
)
static

Method creates new Bull Put Spread strategy, that consists of two puts with the same expiration but different strikes. The strike price of the short put is above the strike of the long put. This is a credit spread.

Parameters
canonicalOptionOption symbol
leg1StrikeThe strike price of the short put
leg2StrikeThe strike price of the long put
expirationOption expiration date
Returns
Option strategy specification

Definition at line 331 of file OptionStrategies.cs.

◆ Straddle()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.Straddle ( Symbol  canonicalOption,
decimal  strike,
DateTime  expiration 
)
static

Method creates new Straddle strategy, that is a combination of buying a call and buying a put, both with the same strike price and expiration.

Parameters
canonicalOptionOption symbol
strikeThe strike price of the both legs
expirationOption expiration date
Returns
Option strategy specification

Definition at line 373 of file OptionStrategies.cs.

Here is the caller graph for this function:

◆ ShortStraddle()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ShortStraddle ( Symbol  canonicalOption,
decimal  strike,
DateTime  expiration 
)
static

Creates a Short Straddle strategy that consists of selling a call and a put, both with the same strike price and expiration.

Parameters
canonicalOptionOption symbol
strikeThe strike price for the option contracts
expirationThe expiration date for the option contracts
Returns
Option strategy specification

Definition at line 406 of file OptionStrategies.cs.

Here is the call graph for this function:

◆ Strangle()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.Strangle ( Symbol  canonicalOption,
decimal  callLegStrike,
decimal  putLegStrike,
DateTime  expiration 
)
static

Method creates new Strangle strategy, that buying a call option and a put option with the same expiration date The strike price of the call is above the strike of the put.

Parameters
canonicalOptionOption symbol
callLegStrikeThe strike price of the long call
putLegStrikeThe strike price of the long put
expirationOption expiration date
Returns
Option strategy specification

Definition at line 421 of file OptionStrategies.cs.

Here is the caller graph for this function:

◆ ShortStrangle()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ShortStrangle ( Symbol  canonicalOption,
decimal  callLegStrike,
decimal  putLegStrike,
DateTime  expiration 
)
static

Creates a Short Strangle strategy that consists of selling a call and a put, with the same expiration date and the call strike being above the put strike.

Parameters
canonicalOptionOption symbol
callLegStrikeThe strike price of the short call
putLegStrikeThe strike price of the short put
expirationOption expiration date
Returns
Option strategy specification

Definition at line 465 of file OptionStrategies.cs.

Here is the call graph for this function:

◆ CallButterfly()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.CallButterfly ( Symbol  canonicalOption,
decimal  higherStrike,
decimal  middleStrike,
decimal  lowerStrike,
DateTime  expiration 
)
static

Method creates new Call Butterfly strategy, that consists of two short calls at a middle strike, and one long call each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike.

Parameters
canonicalOptionOption symbol
higherStrikeThe upper strike price of the long call
middleStrikeThe middle strike price of the two short calls
lowerStrikeThe lower strike price of the long call
expirationOption expiration date
Returns
Option strategy specification

Definition at line 481 of file OptionStrategies.cs.

Here is the caller graph for this function:

◆ ButterflyCall()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ButterflyCall ( Symbol  canonicalOption,
decimal  higherStrike,
decimal  middleStrike,
decimal  lowerStrike,
DateTime  expiration 
)
static

Creates a new Butterfly Call strategy that consists of two short calls at a middle strike, and one long call each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike.

Parameters
canonicalOptionOption symbol
higherStrikeThe upper strike price of the long call
middleStrikeThe middle strike price of the two short calls
lowerStrikeThe lower strike price of the long call
expirationOption expiration date
Returns
Option strategy specification

Alias for CallButterfly

Definition at line 535 of file OptionStrategies.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShortButterflyCall()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ShortButterflyCall ( Symbol  canonicalOption,
decimal  higherStrike,
decimal  middleStrike,
decimal  lowerStrike,
DateTime  expiration 
)
static

Creates a new Butterfly Call strategy that consists of two long calls at a middle strike, and one short call each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike.

Parameters
canonicalOptionOption symbol
higherStrikeThe upper strike price of the short call
middleStrikeThe middle strike price of the two long calls
lowerStrikeThe lower strike price of the short call
expirationOption expiration date
Returns
Option strategy specification

Definition at line 552 of file OptionStrategies.cs.

Here is the call graph for this function:

◆ PutButterfly()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.PutButterfly ( Symbol  canonicalOption,
decimal  higherStrike,
decimal  middleStrike,
decimal  lowerStrike,
DateTime  expiration 
)
static

Method creates new Put Butterfly strategy, that consists of two short puts at a middle strike, and one long put each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike.

Parameters
canonicalOptionOption symbol
higherStrikeThe upper strike price of the long put
middleStrikeThe middle strike price of the two short puts
lowerStrikeThe lower strike price of the long put
expirationOption expiration date
Returns
Option strategy specification

Definition at line 570 of file OptionStrategies.cs.

Here is the caller graph for this function:

◆ ButterflyPut()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ButterflyPut ( Symbol  canonicalOption,
decimal  higherStrike,
decimal  middleStrike,
decimal  lowerStrike,
DateTime  expiration 
)
static

Creates a new Butterfly Put strategy that consists of two short puts at a middle strike, and one long put each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike.

Parameters
canonicalOptionOption symbol
higherStrikeThe upper strike price of the long put
middleStrikeThe middle strike price of the two short puts
lowerStrikeThe lower strike price of the long put
expirationOption expiration date
Returns
Option strategy specification

Alias for PutButterfly

Definition at line 627 of file OptionStrategies.cs.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ShortButterflyPut()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ShortButterflyPut ( Symbol  canonicalOption,
decimal  higherStrike,
decimal  middleStrike,
decimal  lowerStrike,
DateTime  expiration 
)
static

Creates a new Butterfly Put strategy that consists of two long puts at a middle strike, and one short put each at a lower and upper strike. The upper and lower strikes must both be equidistant from the middle strike.

Parameters
canonicalOptionOption symbol
higherStrikeThe upper strike price of the short put
middleStrikeThe middle strike price of the two long puts
lowerStrikeThe lower strike price of the short put
expirationOption expiration date
Returns
Option strategy specification

Definition at line 644 of file OptionStrategies.cs.

Here is the call graph for this function:

◆ CallCalendarSpread()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.CallCalendarSpread ( Symbol  canonicalOption,
decimal  strike,
DateTime  nearExpiration,
DateTime  farExpiration 
)
static

Creates new Call Calendar Spread strategy which consists of a short and a long call with the same strikes but with the long call having a further expiration date.

Parameters
canonicalOptionOption symbol
strikeThe strike price of the both legs
nearExpirationNear expiration date for the short option
farExpirationFar expiration date for the long option
Returns
Option strategy specification

Definition at line 661 of file OptionStrategies.cs.

Here is the caller graph for this function:

◆ ShortCallCalendarSpread()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ShortCallCalendarSpread ( Symbol  canonicalOption,
decimal  strike,
DateTime  nearExpiration,
DateTime  farExpiration 
)
static

Creates new Short Call Calendar Spread strategy which consists of a short and a long call with the same strikes but with the short call having a further expiration date.

Parameters
canonicalOptionOption symbol
strikeThe strike price of the both legs
nearExpirationNear expiration date for the long option
farExpirationFar expiration date for the short option
Returns
Option strategy specification

Definition at line 701 of file OptionStrategies.cs.

Here is the call graph for this function:

◆ PutCalendarSpread()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.PutCalendarSpread ( Symbol  canonicalOption,
decimal  strike,
DateTime  nearExpiration,
DateTime  farExpiration 
)
static

Creates new Put Calendar Spread strategy which consists of a short and a long put with the same strikes but with the long put having a further expiration date.

Parameters
canonicalOptionOption symbol
strikeThe strike price of the both legs
nearExpirationNear expiration date for the short option
farExpirationFar expiration date for the long option
Returns
Option strategy specification

Definition at line 717 of file OptionStrategies.cs.

Here is the caller graph for this function:

◆ ShortPutCalendarSpread()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.ShortPutCalendarSpread ( Symbol  canonicalOption,
decimal  strike,
DateTime  nearExpiration,
DateTime  farExpiration 
)
static

Creates new Short Put Calendar Spread strategy which consists of a short and a long put with the same strikes but with the short put having a further expiration date.

Parameters
canonicalOptionOption symbol
strikeThe strike price of the both legs
nearExpirationNear expiration date for the long option
farExpirationFar expiration date for the short option
Returns
Option strategy specification

Definition at line 757 of file OptionStrategies.cs.

Here is the call graph for this function:

◆ IronCondor()

static OptionStrategy QuantConnect.Securities.Option.OptionStrategies.IronCondor ( Symbol  canonicalOption,
decimal  longPutStrike,
decimal  shortPutStrike,
decimal  shortCallStrike,
decimal  longCallStrike,
DateTime  expiration 
)
static

Creates a new Iron Condor strategy which consists of a long put, a short put, a short call and a long option, all with the same expiration date and with increasing strikes prices in the mentioned order.

Parameters
canonicalOptionOption symbol
longPutStrikeLong put option strike price
shortPutStrikeShort put option strike price
shortCallStrikeShort call option strike price
longCallStrikeLong call option strike price
expirationExpiration date for all the options
Returns
Option strategy specification

Definition at line 775 of file OptionStrategies.cs.


The documentation for this class was generated from the following file: