CycleDuration#

tradeexecutor.strategy.cycle.CycleDuration class.

class CycleDuration[source]#

Bases: Enum

Strategy cycle duration options.

This enum defines what strategy cycle durations backtesting and live testing engine supports.

It is also the value you can enter as trading_strategy_cycle option for your strategies.

All cycles are aligned to the wall clock time. E.g. 24h cycle is always run at 00:00.

See Strategy cycle for more information.

__init__()#

Methods

to_timedelta()

Get the duration of the strategy cycle as Python timedelta object.

Attributes

cycle_1m

Run decide_trades() every minute

cycle_5m

Run decide_trades() every 5 minutes

cycle_15m

Run decide_trades() every 15 minutes

cycle_1h

Run decide_trades() every hour

cycle_4h

Run decide_trades() every 4 hours

cycle_8h

Run decide_trades() for every 8 hours

cycle_16h

Run decide_trades() for every 16 hours

cycle_24h

Run decide_trades() for every 24h hours

cycle_1m = '1m'#

Run decide_trades() every minute

cycle_5m = '5m'#

Run decide_trades() every 5 minutes

cycle_15m = '15m'#

Run decide_trades() every 15 minutes

cycle_1h = '1h'#

Run decide_trades() every hour

cycle_4h = '4h'#

Run decide_trades() every 4 hours

cycle_8h = '8h'#

Run decide_trades() for every 8 hours

cycle_16h = '16h'#

Run decide_trades() for every 16 hours

cycle_24h = '24h'#

Run decide_trades() for every 24h hours

to_timedelta()[source]#

Get the duration of the strategy cycle as Python timedelta object.

Return type

timedelta