DynamicRollingFXForwardStrategy

DynamicRollingFXForwardStrategy#

class sigtech.framework.strategies.rolling_fx_forward_strategy.DynamicRollingFXForwardStrategy

Baseclasses: RollingFXForwardStrategy

Strategy going long the “long_currency” in rolling FX forwards and short the strategy currency (typically USD) on specified custom roll dates.

Keyword arguments:

  1. start_date

  2. end_date (optional, default=date.max).

  3. currency

  4. long_currency

  5. forward_tenor - examples - ‘2BD’, ‘1W’, ‘1M’, ‘2M’, ‘3M’, ‘1W-FRI’, ‘3M_IMM’, ‘SOM’, ‘EOM’, ‘YEARLY’.

  6. custom_roll_offset - number of days before maturity of the forward to do the roll. (optional, default method will try to get it from ROLL_OFFSET defined in FXMarket class).

Example object creation:

st = sig.DynamicRollingFXForwardStrategy(long_currency='EUR',
                                     currency='USD',
                                     forward_tenor='3M',
                                     start_date=dtm.date(2016, 1, 14),
                                     end_date=dtm.date(2016, 7, 20),
                                     roll_dates=[dtm.date(2016, 4, 7), dtm.date(2016, 7, 2)],
                                     )
forward_tenor: Optional[str]
roll_dates: list[datetime.date]
calc_dates()

Return the list of roll dates and the first date to use for trading.

close_out(dt, transaction_type)

Close out positions.

Parameters:
  • dt – Reference datetime.

  • transaction_type – Type of trade.

maturity_from_tenor(d)

Return the maturity given the forward tenor on a specific date.

Parameters:

d – Reference date.

Returns:

Maturity.

strategy_initialization(dt)

Initial decision run on the start date of the strategy.

Parameters:

dt – Reference datetime.