DynamicMultiOptionsStrategy

DynamicMultiOptionsStrategy#

class sigtech.framework.strategies.rolling_options_baskets.DynamicMultiOptionsStrategy

Baseclasses: RollingOptionsStrategyBase

Strategy trading a basket of options from multiple groups.

The abstract roll_options method should be implemented for the desired behaviour.

An example of using this strategy to trade two FX option groups is shown below:

import sigtech.framework as sig

class ExampleDynamicMultiOptionsStrategy(sig.DynamicMultiOptionsStrategy):
    def roll_options(self, dt):
        size_date = self.size_date_from_decision_dt(dt)

        usdeur = sig.FXOTCOptionsGroup.get_group('USDEUR')
        usdeur_maturity_date = usdeur.convert_maturity_tenor_to_date(size_date, '1M')
        usdeur_atm = usdeur.atm_from_type('Call', size_date, usdeur_maturity_date, 'DN')
        usdeur_call = usdeur.get_option('Call', usdeur_atm, size_date, usdeur_maturity_date)

        usdgbp = sig.FXOTCOptionsGroup.get_group('USDGBP')
        usdgbp_maturity_date = usdgbp.convert_maturity_tenor_to_date(size_date, '1M')
        usdgbp_atm = usdgbp.atm_from_type('Call', size_date, usdgbp_maturity_date, 'DN')
        usdgbp_call = usdgbp.get_option('Call', usdgbp_atm, size_date, usdgbp_maturity_date)

        self.set_option_positions(dt, ((usdeur_call, 1), (usdgbp_call, 1)))

rs = ExampleDynamicMultiOptionsStrategy(currency='USD',
                                        start_date=dtm.date(2012, 1, 3),
                                        end_date=dtm.date(2013, 9, 24),
                                        group_names=[sig.FXOTCOptionsGroup.get_group('USDEUR').name,
                                                     sig.FXOTCOptionsGroup.get_group('USDGBP').name],
                                        target_type='Fixed',
                                        roll_dates=[dtm.date(2012, 2, 16),
                                                    dtm.date(2012, 3, 20),
                                                    dtm.date(2012, 4, 18)],
                                        )

rs.history()
close_out_at_roll: Optional[bool]
group_names: list[str]
maturity: Optional[Union[str, date]]
property rolling_table

Builds the strategy’s rolling table.

Returns:

Built rolling table as a pandas DataFrame.

roll_options(dt, positions=None)

Set option positions.

Parameters:

dt – Decision datetime.