RollingSwapStrategy#
-
class sigtech.framework.strategies.rolling_swap_strategy.RollingSwapStrategy
Baseclasses:
RollingStrategyBase
Strategy handling the rolling of forward starting IMM swaps. Swaps are receivers (receiving fixed, paying floating).
Keyword arguments:
tenor: Swap tenor.
roll_offset: Roll days offset to the IMM swap reset dates.
forward_start_months: Forward swap start date (in months, multiple of 3).
rolling_frequency_months: Rolling frequency (in months, multiple of 3, if not specified it coincides with
forward_start_months)
.swap_currency: Swap’s underlying currency, if None strategy currency is driving the underlying swaps traded.
pv01_target: Trade PV01 if
pv01_target_type
isFixed
, else PV01 per unit of notional.pv01_target_type:
Fixed
orRelative
, default isFixed
.notional_target: Fixed notional amount for every traded swap. If
None
- notional scales with strategy valuation.custom_roll_table: Optional. If supplied should be a list of tuples like (swap roll date, swap start date)
Example object creation:
rs = sig.RollingSwapStrategy( tenor="10Y", currency="USD", swap_currency="USD", rolling_frequency_months=6, forward_start_months=6, start_date=dtm.date(2010, 1, 4) ) rs = sig.RollingSwapStrategy( tenor="10Y", currency="USD", swap_currency="USD", rolling_frequency_months=6, forward_start_months=6, start_date=dtm.date(2010, 1, 4), pv01_target=100, pv01_target_type='Fixed' ) rs = sig.RollingSwapStrategy( tenor="10Y", currency="USD", swap_currency="USD", rolling_frequency_months=6, forward_start_months=6, start_date=dtm.date(2010, 1, 4), pv01_target=0.001, pv01_target_type='Relative' )
-
custom_roll_table: Optional[list[tuple[datetime.date, datetime.date]]]
-
forward_start_months: Optional[int]
-
property holidays
List of known holiday calendars.
-
notional_target: Optional[float]
-
pv01_target: Optional[float]
-
pv01_target_type: Optional[Literal['Fixed', 'Relative']]
-
roll_offset: Optional[str]
-
rolling_frequency_months: Optional[int]
-
property rolling_table
Builds the strategy’s rolling table.
- Returns:
Built rolling table as a pandas DataFrame.
-
swap_currency: Optional[str]
-
swap_type: Optional[Literal['OIS', 'IBOR']]
-
tenor: str
-
bd_schedule() StrategySchedule
Combined schedule of the group’s and TradingManager’s holidays.
-
generate_roll_dates(d: date)
Populates the roll dates from a given date until the end of the swap.
- Parameters:
d – Input date.
- Returns:
-
static next_imm_date(d: date, offset: int, currency: str) date
Get the next IMM date for a currency given an input date.
- Parameters:
d – Input date.
offset – Input offset.
currency – Currency identifier.
- Returns:
Date.
-
rolling_schedule()
Determine the dates to trade on.
-
schedule_information() StrategySchedule
Schedule using the group’s holidays.
-
strategy_initialization(dt)
Initial decision run on the start date of the strategy.
- Parameters:
dt – Reference datetime.
-
swap_pv01(dt: datetime) float
Returns the swap PV01 value at the given datetime.
- Parameters:
dt – Reference datetime.
- Returns:
The swap PV01, scaled by the amount of the swap held.
-
swap_pv01_series() Series
Return the swap PV01 time series over the whole history of the swap.
-
swap_rate(dt: datetime) float
Return the swap rate at the given datetime.
- Parameters:
dt – Reference datetime.
- Returns:
The swap rate.
-
swap_rate_series() Series
Return the swap rate time series over the whole history of the swap.