alpheast.engine module

class alpheast.engine.BacktestingEngine(options, data_source, strategies, position_sizing_method=None, is_stepping_mode=False)[source]

Bases: object

Orchestrates the event-driven backtesting process. Initializes all main components: EventQueue, DataHandler, Strategies, PortfolioManager, SimulatedExecutionHandler and runs the main event loop.

run()[source]

Runs the main event loop of the backtesting engine

Return type:

Optional[BacktestResults]

step_forward()[source]

Processes one time step (one market event and all subsequent events) Returns True if a market event was processed.

Return type:

bool

reset()[source]

Resets the engine’s internal state for a new sequence of step-by-step execution. This should be called when starting a new backtest simulation in stepping mode. Assumes the engine was initially created with enable_stepping_mode=True.