Lean
$LEAN_TAG$
|
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... | |
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.
|
static |
Creates a Covered Call strategy that consists of selling one call contract and buying 1 lot of the underlying.
canonicalOption | Option symbol |
strike | The strike price for the call option contract |
expiration | The expiration date for the call option contract |
Definition at line 45 of file OptionStrategies.cs.
|
static |
Creates a Protective Call strategy that consists of buying one call contract and selling 1 lot of the underlying.
canonicalOption | Option symbol |
strike | The strike price for the call option contract |
expiration | The expiration date for the call option contract |
Definition at line 82 of file OptionStrategies.cs.
|
static |
Creates a Covered Put strategy that consists of selling 1 put contract and 1 lot of the underlying.
canonicalOption | Option symbol |
strike | The strike price for the put option contract |
expiration | The expiration date for the put option contract |
Definition at line 95 of file OptionStrategies.cs.
|
static |
Creates a Protective Put strategy that consists of buying 1 put contract and 1 lot of the underlying.
canonicalOption | Option symbol |
strike | The strike price for the put option contract |
expiration | The expiration date for the put option contract |
Definition at line 132 of file OptionStrategies.cs.
|
static |
Creates a Naked Call strategy that consists of selling 1 call contract.
canonicalOption | Option symbol |
strike | The strike price for the call option contract |
expiration | The expiration date for the call option contract |
Definition at line 145 of file OptionStrategies.cs.
|
static |
Creates a Naked Put strategy that consists of selling 1 put contract.
canonicalOption | Option symbol |
strike | The strike price for the put option contract |
expiration | The expiration date for the put option contract |
Definition at line 172 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
leg1Strike | The strike price of the short call |
leg2Strike | The strike price of the long call |
expiration | Option expiration date |
Definition at line 201 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
leg1Strike | The strike price of the long put |
leg2Strike | The strike price of the short put |
expiration | Option expiration date |
Definition at line 244 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
leg1Strike | The strike price of the long call |
leg2Strike | The strike price of the short call |
expiration | Option expiration date |
Definition at line 288 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
leg1Strike | The strike price of the short put |
leg2Strike | The strike price of the long put |
expiration | Option expiration date |
Definition at line 331 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
strike | The strike price of the both legs |
expiration | Option expiration date |
Definition at line 373 of file OptionStrategies.cs.
|
static |
Creates a Short Straddle strategy that consists of selling a call and a put, both with the same strike price and expiration.
canonicalOption | Option symbol |
strike | The strike price for the option contracts |
expiration | The expiration date for the option contracts |
Definition at line 406 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
callLegStrike | The strike price of the long call |
putLegStrike | The strike price of the long put |
expiration | Option expiration date |
Definition at line 421 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
callLegStrike | The strike price of the short call |
putLegStrike | The strike price of the short put |
expiration | Option expiration date |
Definition at line 465 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
higherStrike | The upper strike price of the long call |
middleStrike | The middle strike price of the two short calls |
lowerStrike | The lower strike price of the long call |
expiration | Option expiration date |
Definition at line 481 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
higherStrike | The upper strike price of the long call |
middleStrike | The middle strike price of the two short calls |
lowerStrike | The lower strike price of the long call |
expiration | Option expiration date |
Alias for CallButterfly
Definition at line 535 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
higherStrike | The upper strike price of the short call |
middleStrike | The middle strike price of the two long calls |
lowerStrike | The lower strike price of the short call |
expiration | Option expiration date |
Definition at line 552 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
higherStrike | The upper strike price of the long put |
middleStrike | The middle strike price of the two short puts |
lowerStrike | The lower strike price of the long put |
expiration | Option expiration date |
Definition at line 570 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
higherStrike | The upper strike price of the long put |
middleStrike | The middle strike price of the two short puts |
lowerStrike | The lower strike price of the long put |
expiration | Option expiration date |
Alias for PutButterfly
Definition at line 627 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
higherStrike | The upper strike price of the short put |
middleStrike | The middle strike price of the two long puts |
lowerStrike | The lower strike price of the short put |
expiration | Option expiration date |
Definition at line 644 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
strike | The strike price of the both legs |
nearExpiration | Near expiration date for the short option |
farExpiration | Far expiration date for the long option |
Definition at line 661 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
strike | The strike price of the both legs |
nearExpiration | Near expiration date for the long option |
farExpiration | Far expiration date for the short option |
Definition at line 701 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
strike | The strike price of the both legs |
nearExpiration | Near expiration date for the short option |
farExpiration | Far expiration date for the long option |
Definition at line 717 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
strike | The strike price of the both legs |
nearExpiration | Near expiration date for the long option |
farExpiration | Far expiration date for the short option |
Definition at line 757 of file OptionStrategies.cs.
|
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.
canonicalOption | Option symbol |
longPutStrike | Long put option strike price |
shortPutStrike | Short put option strike price |
shortCallStrike | Short call option strike price |
longCallStrike | Long call option strike price |
expiration | Expiration date for all the options |
Definition at line 775 of file OptionStrategies.cs.