DynamicSwaptionsStrategy#
-
class sigtech.framework.strategies.rolling_swaption_baskets.DynamicSwaptionsStrategy
Baseclasses:
RollingOptionsStrategyBase
Strategy trading a custom basket of swaptions.
The swaptions traded must be from the swaption group specified by``group_name`` input.
The swaptions traded can be passed in as a dictionary to trade_dictionary. The keys determine the trade dates.
For example:
swaption_group = sig.SwaptionGroup.get_group('USD') trade_dictionary = {dtm.date(2020, 1, 15) : { swaption_group.get_swaption(start_date=dtm.date(2019, 12, 14), expiry='3M', swap_tenor='5Y', option_type='Payer', strike='ATM'): 100, swaption_group.get_swaption(start_date=dtm.date(2019, 12, 14), expiry='3M', swap_tenor='5Y', option_type='Receiver', strike='ATM'): -100 } } strat = sig.DynamicSwaptionsStrategy( start_date=dtm.date(2020, 1, 6), end_date=dtm.date(2020, 6, 20), currency='USD', group_name=swaption_group.name, trade_dictionary=trade_dictionary ) strat.history().plot();
Alternatively, a basket_creation_method function can be passed in which gets called on each roll dates and provides a dictionary or tuple of swaptions to trade. The method should take the strategy, decision time and positions as input and return a dictionary of swaptions.
For example:
from sigtech.framework.utils.numeric_utils import date_to_datetime swaption_group = sig.SwaptionGroup.get_group('USD') def basket_creation_method(strategy, dt, positions): size_date = strategy.size_date_from_decision_dt(dt) return {swaption_group.get_swaption(start_date=size_date, expiry='3M', swap_tenor='5Y', option_type='Payer', strike='ATM'): -200} strat = sig.DynamicSwaptionsStrategy( start_date=dtm.date(2020, 1, 6), end_date=dtm.date(2021, 6, 20), currency='USD', group_name=swaption_group.name, rolling_frequencies=['1M', ], basket_creation_method=basket_creation_method, ) strat.history().plot();
The following
RollingOptionsStrategyBase
parameters are relevant for this strategy:target_type
: Value to target, can be'Fixed'
,'PV'
,'Gamma'
or'Vega'
.target_quantity
: Quantity to target.rolling_frequencies
: List of rolling frequencies, e.g.['3M']
.roll_dates
: Explicit list of roll dates.close_out_at_roll
: Flag specifying whether to close existing swaption positions before the roll.
Additional attributes:
trade_dictionary
(dict): Dictionary of date, swaption basket pairs.basket_creation_method
(object): Method to call to determine options to trade.group_name
(string): Name of the swaption group. The currency group by default.
-
property groups
Groups this group belongs to.
-
property rolling_table
Builds the strategy’s rolling table.
- Returns:
Built rolling table as a pandas DataFrame.
-
basket_creation_method: Optional[Callable]
-
close_out_at_roll: Optional[bool]
-
group_name: Optional[str]
-
maturity: Optional[Union[str, date]]
-
trade_dictionary: Optional[dict]
-
group()
Trade group for the swaptions.
-
roll_options(dt)
Set swaption positions.
- Parameters:
dt – Decision datetime.