Add CoveredPut and ProtectivePut strategies helper factory methods (#7297)
This commit is contained in:
@@ -58,6 +58,9 @@ class CoveredAndProtectiveCallStrategiesAlgorithm(QCAlgorithm):
|
||||
raise Exception(f"Expected position group to have 2 positions. Actual: {len(positions)}")
|
||||
|
||||
optionPosition = [position for position in positions if position.Symbol.SecurityType == SecurityType.Option][0]
|
||||
if optionPosition.Symbol.ID.OptionRight != OptionRight.Call:
|
||||
raise Exception(f"Expected option position to be a call. Actual: {optionPosition.Symbol.ID.OptionRight}")
|
||||
|
||||
underlyingPosition = [position for position in positions if position.Symbol.SecurityType == SecurityType.Equity][0]
|
||||
expectedOptionPositionQuantity = -2
|
||||
expectedUnderlyingPositionQuantity = 2 * self.Securities[self._option_symbol].SymbolProperties.ContractMultiplier
|
||||
|
||||
Reference in New Issue
Block a user