DynamicMultiSwaptionsStrategy

DynamicMultiSwaptionsStrategy#

class sigtech.framework.strategies.rolling_swaption_baskets.DynamicMultiSwaptionsStrategy

Baseclasses: RollingOptionsStrategyBase

Strategy trading a basket of swaptions from multiple groups.

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

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

import sigtech.framework as sig

class ExampleDynamicMultiSwaptionsStrategy(sig.DynamicMultiSwaptionsStrategy):
    def roll_options(self, dt):
        usd = sig.SwaptionGroup.get_group('USD')
        eur = sig.SwaptionGroup.get_group('EUR')

        size_date = self.size_date_from_decision_dt(dt)

        usd_rcv = usd.get_swaption(start_date=size_date,
                                   expiry='3M',
                                   swap_tenor='5Y',
                                   option_type='Receiver',
                                   strike='ATM')

        eur_pay = eur.get_swaption(start_date=size_date,
                                   expiry='3M',
                                   swap_tenor='5Y',
                                   option_type='Payer',
                                   strike='ATM')

        self.set_option_positions(dt, ((usd_rcv, 100), (eur_pay, 100)))

rs = ExampleDynamicMultiSwaptionsStrategy(start_date=dtm.date(2020, 1, 3),
                                          end_date=dtm.date(2020, 9, 24),
                                          currency='USD',
                                          group_names=[sig.SwaptionGroup.get_group('USD').name,
                                                      sig.SwaptionGroup.get_group('EUR').name],
                                          roll_dates=[dtm.date(2020, 2, 16),
                                                      dtm.date(2020, 3, 20),
                                                      dtm.date(2020, 4, 18)],
                                          )

rs.history().plot();
close_out_at_roll: Optional[bool]
group_names: list[str]
maturity: Optional[Union[str, date]]
roll_options(dt)

Set swaption positions.

Parameters:

dt – Decision datetime.