RollingStrategyBase

RollingStrategyBase#

class sigtech.framework.strategies.rolling_strategy.RollingStrategyBase

Baseclasses: DailyStrategy

Subclasses: RollingFutureStrategy, RollingBondStrategy, RollingStructureBasketStrategy, RollingFXForwardStrategy, RollingOptionsStrategyBase, RollingSwapStrategy, RollingCreditIndexStrategy

Base strategy for all rolling strategy variation.

Keyword arguments:

  • rolling_frequencies: List of strings used to set roll dates, e.g. [‘3M’] (optional). If nothing is passed, the strategy uses ‘1BD’ frequency for trading.

  • roll_offset: Offsets the roll date by x days from when the roll schedule originally dated the roll.

  • custom_rolling_table: dataframe where the index is a datetime index and the and the columns are the decision_dt and the contract to be rolled in. All other schedule parameters (i.e. roll_offset or rolling_frequencies) are ignored if the list is non-empty.

  • extra_holidays (list or str): Additional holiday calendars. You can pass either a list or a string: ['CMX(T) CALENDAR','SINGEX_JP(T) CALENDAR'] or 'CMX(T) CALENDAR,SINGEX_JP(T) CALENDAR'

extra_holidays: Optional[Union[list, str]]
property holidays

List of known holiday calendars.

roll_offset: Optional[str]
rolling_frequencies: Optional[list[str]]
property rolling_table

Builds the strategy’s rolling table.

Returns:

Built rolling table as a pandas DataFrame.

bd_schedule()

Business days schedule for the strategy.

rolling_schedule()

Determine the dates to trade on.

schedule_information()

Return the schedule information for this group.

strategy_initialization(dt)

Initial decision run on the start date of the strategy. :param dt: Reference datetime.