TradingEnvironment
dataclass
TradingEnvironment.attach_to_strategy
EnvironmentBuilder
build().
Parameters
EnvironmentBuilder.with_datafeed
datafeed instead of the default local one.
build() then requires a matching resolver from with_resolver.
EnvironmentBuilder.with_resolver
resolver instead of the default local resolver registry.
EnvironmentBuilder.with_broker
broker instead of the default SimulationBroker.
EnvironmentBuilder.with_portfolio
portfolio instead of one built from initial_equity.
Its own fee calculator stands: with_fee_calculator is then ignored.
EnvironmentBuilder.with_pulse_index
pulse_index as the clock, in preference to any calendar.
build() still derives the underlyings’ common settlements when with_datetimes
is absent; only the resulting value goes unused.
EnvironmentBuilder.with_datetimes
datetimes instead of on the underlyings’ common settlements.
Copied, and ignored if with_pulse_index supplies a clock of its own. Mutually
exclusive with with_date_range: an explicit calendar is already bounded.
EnvironmentBuilder.with_date_range
available_settlements, so the calendar is bisected rather than
derived whole and trimmed. Mutually exclusive with with_datetimes, and ignored if
with_pulse_index supplies a clock of its own.
Parameters
EnvironmentBuilder.with_fee_calculator
fee_calculator to the default Portfolio built by build().
Ignored if a portfolio was already supplied via with_portfolio.
EnvironmentBuilder.build
ExecutionResult
dataclass
StrategyExecutor
Bases: ABC
Abstract base class for strategy executors.
StrategyExecutor.execute
abstractmethod
SequentialBatchExecutor
Bases: StrategyExecutor
Executes multiple strategies in sequence.
SequentialBatchExecutor.execute
stop_on_error=False did, and it left a sweep
looking finished until strategy.stats raised.
AllassoTradeMachine
AllassoTradeMachine.sequential
classmethod
AllassoTradeMachine.run
warm_readers
get_reader caches, so this only front-loads that work: warming a
datafeed twice (a sweep builds one environment per strategy) costs a dict lookup per pulse.
Providers that are not pdc’s local ones have nothing to open and are skipped, as is an
underlying whose tree the provider does not cover (a futures-only root has no option
snapshots); those keep the lazy path.
run_sequentially
EnvironmentBuilder per strategy, built from that strategy’s own underlying_id,
so a sweep is just a list of strategies here. Every strategy gets its own portfolio, broker
and pulse index; the datafeed and resolver are shared, which is what makes the warmed readers
worth paying for once.
The pulse calendar is the underlyings’ common settlements, optionally bounded by
start_datetime / end_datetime, which are handed to pdc’s available_settlements
and are inclusive at both ends. datetimes replaces that calendar outright instead, so it
cannot be combined with the bounds.
Parameters
Raises
Returns

