PiecewiseStrategy

PiecewiseStrategy#

class sigtech.framework.strategies.strategy_piecewise.PiecewiseStrategy

Baseclasses: DailyStrategy

Subclasses: StrategyPiecewiseDirectly, StrategyPiecewise

A strategy that is a composite of several underlying sub-strategies on non-overlapping time periods.

Example:

import datetime as dtm

sig.PiecewiseStrategy(
    currency='USD',
    start_date=dtm.date(2001, 1, 4),
    strategy_weights=[
        [dtm.date(2001, 1, 5), 'USD NK INDEX LONG FRONT RF Strategy'],
        [dtm.date(2004, 2, 24), 'USD NH INDEX LONG FRONT RF Strategy']
    ]
)
direct_entry: Optional[bool]
enable_tracking: Optional[bool]
strategy_weights: list[list[Union[datetime.date, str]]]
tracking_threshold: Optional[float]
calendar_schedule()

Calendar schedule as a piecewise combination of sub-schedules.

clone_object(params=None)

Return a clone of the strategy with amended parameters.

Parameters:

params – Amended parameters.

Returns:

PiecewiseStrategy object.

clone_strategy(params=None) deprecated

Return a clone of the strategy with amended parameters.

Parameters:

params – Amended parameters.

Returns:

PiecewiseStrategy object.

strategy_initialization(dt)

Initial decision run on the start date of the strategy.

Parameters:

dt – Reference datetime.

trade_schedule()

Trade schedule as a piecewise combination of sub-schedules.