Add helper methods to construct iron condor strategy name strings for ensuring consistency between backtest and trades tables
This commit is contained in:
parent
8379184b62
commit
d51bec8a46
@ -7,6 +7,9 @@ from .option_type import OptionType
|
||||
class CreditTargetStrategy(OptionSpreadStrategy):
|
||||
credit_target: float
|
||||
|
||||
def iron_condor_strategy(credit_target: float) -> str:
|
||||
return f'${credit_target:.2f} Iron Condor'
|
||||
|
||||
def create_strategies(credit_target: float, entry_time: str, number_of_contracts: int = 1):
|
||||
call_spread_strategy = CreditTargetStrategy(
|
||||
credit_target = credit_target,
|
||||
|
@ -7,6 +7,9 @@ from .option_type import OptionType
|
||||
class DeltaTargetStrategy(OptionSpreadStrategy):
|
||||
delta_target: float
|
||||
|
||||
def iron_condor_strategy(delta_target: float) -> str:
|
||||
return f'{int(delta_target * 100)} Delta Iron Condor'
|
||||
|
||||
def create_strategies(delta_target: float, entry_time: str, number_of_contracts: int = 1):
|
||||
call_spread_strategy = DeltaTargetStrategy(
|
||||
delta_target = delta_target,
|
||||
|
Loading…
Reference in New Issue
Block a user