numeraire.core.simulate.RebalanceSchedule#
- class numeraire.core.simulate.RebalanceSchedule(data_calendar: DatetimeIndex, signal_dates: DatetimeIndex, spans: tuple[tuple[int, int], ...])[source]#
Bases:
objectDecision (signal) dates mapped to the half-open data-row spans they govern.
spans[k] = (lo, hi)means thek-th signal’s target holds over data rowslo..hi-1—lois the first return row strictly after the signal date,hiis the next signal’s first row (or the end of data). Decouples the decision calendar from the data frequency (e.g. month-end decisions over daily returns).- __init__(data_calendar: DatetimeIndex, signal_dates: DatetimeIndex, spans: tuple[tuple[int, int], ...]) None#
Methods
__init__(data_calendar, signal_dates, spans)from_rule(data_calendar[, rule])Derive signal dates from the data calendar (
month_end: last data date per month).from_signals(data_calendar, signal_dates)Schedule from explicit signal dates (each trades on the next data row after it).
Attributes
data_calendarsignal_datesspans- classmethod from_signals(data_calendar: DatetimeIndex, signal_dates: DatetimeIndex) RebalanceSchedule[source]#
Schedule from explicit signal dates (each trades on the next data row after it).
- classmethod from_rule(data_calendar: DatetimeIndex, rule: str = 'month_end') RebalanceSchedule[source]#
Derive signal dates from the data calendar (
month_end: last data date per month).